object_storage_endpoints.go raw

   1  package linodego
   2  
   3  import "context"
   4  
   5  // ObjectStorageEndpointType constants start with Notification and include all known Linode API Notification Types.
   6  type ObjectStorageEndpointType string
   7  
   8  // NotificationType constants represent the actions that cause a Notification. New types may be added in the future.
   9  const (
  10  	ObjectStorageEndpointE0 ObjectStorageEndpointType = "E0"
  11  	ObjectStorageEndpointE1 ObjectStorageEndpointType = "E1"
  12  	ObjectStorageEndpointE2 ObjectStorageEndpointType = "E2"
  13  	ObjectStorageEndpointE3 ObjectStorageEndpointType = "E3"
  14  )
  15  
  16  // ObjectStorageEndpoint represents a linode object storage endpoint object
  17  type ObjectStorageEndpoint struct {
  18  	Region       string                    `json:"region"`
  19  	S3Endpoint   *string                   `json:"s3_endpoint"`
  20  	EndpointType ObjectStorageEndpointType `json:"endpoint_type"`
  21  }
  22  
  23  // ListObjectStorageEndpoints lists all endpoints in all regions
  24  func (c *Client) ListObjectStorageEndpoints(ctx context.Context, opts *ListOptions) ([]ObjectStorageEndpoint, error) {
  25  	return getPaginatedResults[ObjectStorageEndpoint](ctx, c, "object-storage/endpoints", opts)
  26  }
  27