...

Source file src/github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2015-10-01/media/models.go

Documentation: github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2015-10-01/media

     1  package media
     2  
     3  // Copyright (c) Microsoft Corporation. All rights reserved.
     4  // Licensed under the MIT License. See License.txt in the project root for license information.
     5  //
     6  // Code generated by Microsoft (R) AutoRest Code Generator.
     7  // Changes may cause incorrect behavior and will be lost if the code is regenerated.
     8  
     9  import (
    10  	"encoding/json"
    11  	"github.com/Azure/go-autorest/autorest"
    12  )
    13  
    14  // The package's fully qualified name.
    15  const fqdn = "github.com/Azure/azure-sdk-for-go/services/mediaservices/mgmt/2015-10-01/media"
    16  
    17  // APIEndpoint the properties for a Media Services REST API endpoint.
    18  type APIEndpoint struct {
    19  	// Endpoint - The Media Services REST endpoint.
    20  	Endpoint *string `json:"endpoint,omitempty"`
    21  	// MajorVersion - The version of Media Services REST API.
    22  	MajorVersion *string `json:"majorVersion,omitempty"`
    23  }
    24  
    25  // APIError the error returned from a failed Media Services REST API call.
    26  type APIError struct {
    27  	// Code - Error code.
    28  	Code *string `json:"code,omitempty"`
    29  	// Message - Error message.
    30  	Message *string `json:"message,omitempty"`
    31  }
    32  
    33  // CheckNameAvailabilityInput the request body for CheckNameAvailability API.
    34  type CheckNameAvailabilityInput struct {
    35  	// Name - The name of the resource. A name must be globally unique.
    36  	Name *string `json:"name,omitempty"`
    37  	// Type - The type of the resource - mediaservices.
    38  	Type *string `json:"type,omitempty"`
    39  }
    40  
    41  // CheckNameAvailabilityOutput the response body for CheckNameAvailability API.
    42  type CheckNameAvailabilityOutput struct {
    43  	autorest.Response `json:"-"`
    44  	// NameAvailable - Specifies if the name is available.
    45  	NameAvailable *bool `json:"nameAvailable,omitempty"`
    46  	// Reason - Specifies the reason if the name is not available. Possible values include: 'None', 'Invalid', 'AlreadyExists'
    47  	Reason EntityNameUnavailabilityReason `json:"reason,omitempty"`
    48  	// Message - Specifies the detailed reason if the name is not available.
    49  	Message *string `json:"message,omitempty"`
    50  }
    51  
    52  // Operation a Media Services REST API operation
    53  type Operation struct {
    54  	// Name - READ-ONLY; Operation name: {provider}/{resource}/{operation}
    55  	Name *string `json:"name,omitempty"`
    56  	// Display - The object that represents the operation.
    57  	Display *OperationDisplay `json:"display,omitempty"`
    58  }
    59  
    60  // MarshalJSON is the custom marshaler for Operation.
    61  func (o Operation) MarshalJSON() ([]byte, error) {
    62  	objectMap := make(map[string]interface{})
    63  	if o.Display != nil {
    64  		objectMap["display"] = o.Display
    65  	}
    66  	return json.Marshal(objectMap)
    67  }
    68  
    69  // OperationDisplay the object that represents the operation.
    70  type OperationDisplay struct {
    71  	// Provider - READ-ONLY; Service provider: Microsoft.Media
    72  	Provider *string `json:"provider,omitempty"`
    73  	// Resource - READ-ONLY; Resource on which the operation is performed: Invoice, etc.
    74  	Resource *string `json:"resource,omitempty"`
    75  	// Operation - READ-ONLY; Operation type: Read, write, delete, etc.
    76  	Operation *string `json:"operation,omitempty"`
    77  }
    78  
    79  // MarshalJSON is the custom marshaler for OperationDisplay.
    80  func (o OperationDisplay) MarshalJSON() ([]byte, error) {
    81  	objectMap := make(map[string]interface{})
    82  	return json.Marshal(objectMap)
    83  }
    84  
    85  // OperationListResult result of the request to list Media Services operations.
    86  type OperationListResult struct {
    87  	autorest.Response `json:"-"`
    88  	// Value - READ-ONLY; List of Media Services operations supported by the Microsoft.Media resource provider.
    89  	Value *[]Operation `json:"value,omitempty"`
    90  	// NextLink - READ-ONLY; URL to get the next set of operation list results if there are any.
    91  	NextLink *string `json:"nextLink,omitempty"`
    92  }
    93  
    94  // MarshalJSON is the custom marshaler for OperationListResult.
    95  func (olr OperationListResult) MarshalJSON() ([]byte, error) {
    96  	objectMap := make(map[string]interface{})
    97  	return json.Marshal(objectMap)
    98  }
    99  
   100  // RegenerateKeyInput the request body for a RegenerateKey API.
   101  type RegenerateKeyInput struct {
   102  	// KeyType - The keyType indicating which key you want to regenerate, Primary or Secondary. Possible values include: 'Primary', 'Secondary'
   103  	KeyType KeyType `json:"keyType,omitempty"`
   104  }
   105  
   106  // RegenerateKeyOutput the response body for a RegenerateKey API.
   107  type RegenerateKeyOutput struct {
   108  	autorest.Response `json:"-"`
   109  	// Key - The new value of either the primary or secondary key.
   110  	Key *string `json:"key,omitempty"`
   111  }
   112  
   113  // Resource the Azure Resource Manager resource.
   114  type Resource struct {
   115  	// ID - READ-ONLY; The id of the resource.
   116  	ID *string `json:"id,omitempty"`
   117  	// Name - READ-ONLY; The name of the resource.
   118  	Name *string `json:"name,omitempty"`
   119  	// Type - READ-ONLY; The type of the resource
   120  	Type *string `json:"type,omitempty"`
   121  	// Location - The geographic location of the resource. This must be one of the supported and registered Azure Geo Regions (for example, West US, East US, Southeast Asia, and so forth).
   122  	Location *string `json:"location,omitempty"`
   123  	// Tags - Tags to help categorize the resource in the Azure portal.
   124  	Tags map[string]*string `json:"tags"`
   125  }
   126  
   127  // MarshalJSON is the custom marshaler for Resource.
   128  func (r Resource) MarshalJSON() ([]byte, error) {
   129  	objectMap := make(map[string]interface{})
   130  	if r.Location != nil {
   131  		objectMap["location"] = r.Location
   132  	}
   133  	if r.Tags != nil {
   134  		objectMap["tags"] = r.Tags
   135  	}
   136  	return json.Marshal(objectMap)
   137  }
   138  
   139  // Service the properties of a Media Service resource.
   140  type Service struct {
   141  	autorest.Response `json:"-"`
   142  	// ServiceProperties - The additional properties of a Media Service resource.
   143  	*ServiceProperties `json:"properties,omitempty"`
   144  	// ID - READ-ONLY; The id of the resource.
   145  	ID *string `json:"id,omitempty"`
   146  	// Name - READ-ONLY; The name of the resource.
   147  	Name *string `json:"name,omitempty"`
   148  	// Type - READ-ONLY; The type of the resource
   149  	Type *string `json:"type,omitempty"`
   150  	// Location - The geographic location of the resource. This must be one of the supported and registered Azure Geo Regions (for example, West US, East US, Southeast Asia, and so forth).
   151  	Location *string `json:"location,omitempty"`
   152  	// Tags - Tags to help categorize the resource in the Azure portal.
   153  	Tags map[string]*string `json:"tags"`
   154  }
   155  
   156  // MarshalJSON is the custom marshaler for Service.
   157  func (s Service) MarshalJSON() ([]byte, error) {
   158  	objectMap := make(map[string]interface{})
   159  	if s.ServiceProperties != nil {
   160  		objectMap["properties"] = s.ServiceProperties
   161  	}
   162  	if s.Location != nil {
   163  		objectMap["location"] = s.Location
   164  	}
   165  	if s.Tags != nil {
   166  		objectMap["tags"] = s.Tags
   167  	}
   168  	return json.Marshal(objectMap)
   169  }
   170  
   171  // UnmarshalJSON is the custom unmarshaler for Service struct.
   172  func (s *Service) UnmarshalJSON(body []byte) error {
   173  	var m map[string]*json.RawMessage
   174  	err := json.Unmarshal(body, &m)
   175  	if err != nil {
   176  		return err
   177  	}
   178  	for k, v := range m {
   179  		switch k {
   180  		case "properties":
   181  			if v != nil {
   182  				var serviceProperties ServiceProperties
   183  				err = json.Unmarshal(*v, &serviceProperties)
   184  				if err != nil {
   185  					return err
   186  				}
   187  				s.ServiceProperties = &serviceProperties
   188  			}
   189  		case "id":
   190  			if v != nil {
   191  				var ID string
   192  				err = json.Unmarshal(*v, &ID)
   193  				if err != nil {
   194  					return err
   195  				}
   196  				s.ID = &ID
   197  			}
   198  		case "name":
   199  			if v != nil {
   200  				var name string
   201  				err = json.Unmarshal(*v, &name)
   202  				if err != nil {
   203  					return err
   204  				}
   205  				s.Name = &name
   206  			}
   207  		case "type":
   208  			if v != nil {
   209  				var typeVar string
   210  				err = json.Unmarshal(*v, &typeVar)
   211  				if err != nil {
   212  					return err
   213  				}
   214  				s.Type = &typeVar
   215  			}
   216  		case "location":
   217  			if v != nil {
   218  				var location string
   219  				err = json.Unmarshal(*v, &location)
   220  				if err != nil {
   221  					return err
   222  				}
   223  				s.Location = &location
   224  			}
   225  		case "tags":
   226  			if v != nil {
   227  				var tags map[string]*string
   228  				err = json.Unmarshal(*v, &tags)
   229  				if err != nil {
   230  					return err
   231  				}
   232  				s.Tags = tags
   233  			}
   234  		}
   235  	}
   236  
   237  	return nil
   238  }
   239  
   240  // ServiceCollection the collection of Media Service resources.
   241  type ServiceCollection struct {
   242  	autorest.Response `json:"-"`
   243  	// Value - The collection of Media Service resources.
   244  	Value *[]Service `json:"value,omitempty"`
   245  }
   246  
   247  // ServiceKeys the response body for a ListKeys API.
   248  type ServiceKeys struct {
   249  	autorest.Response `json:"-"`
   250  	// PrimaryAuthEndpoint - The primary authorization endpoint.
   251  	PrimaryAuthEndpoint *string `json:"primaryAuthEndpoint,omitempty"`
   252  	// SecondaryAuthEndpoint - The secondary authorization endpoint.
   253  	SecondaryAuthEndpoint *string `json:"secondaryAuthEndpoint,omitempty"`
   254  	// PrimaryKey - The primary key for the Media Service resource.
   255  	PrimaryKey *string `json:"primaryKey,omitempty"`
   256  	// SecondaryKey - The secondary key for the Media Service resource.
   257  	SecondaryKey *string `json:"secondaryKey,omitempty"`
   258  	// Scope - The authorization scope.
   259  	Scope *string `json:"scope,omitempty"`
   260  }
   261  
   262  // ServiceProperties the additional properties of a Media Service resource.
   263  type ServiceProperties struct {
   264  	// APIEndpoints - READ-ONLY; Read-only property that lists the Media Services REST API endpoints for this resource. If supplied on a PUT or PATCH, the value will be ignored.
   265  	APIEndpoints *[]APIEndpoint `json:"apiEndpoints,omitempty"`
   266  	// StorageAccounts - The storage accounts for this resource.
   267  	StorageAccounts *[]StorageAccount `json:"storageAccounts,omitempty"`
   268  }
   269  
   270  // MarshalJSON is the custom marshaler for ServiceProperties.
   271  func (sp ServiceProperties) MarshalJSON() ([]byte, error) {
   272  	objectMap := make(map[string]interface{})
   273  	if sp.StorageAccounts != nil {
   274  		objectMap["storageAccounts"] = sp.StorageAccounts
   275  	}
   276  	return json.Marshal(objectMap)
   277  }
   278  
   279  // StorageAccount the properties of a storage account associated with this resource.
   280  type StorageAccount struct {
   281  	// ID - The id of the storage account resource. Media Services relies on tables and queues as well as blobs, so the primary storage account must be a Standard Storage account (either Microsoft.ClassicStorage or Microsoft.Storage). Blob only storage accounts can be added as secondary storage accounts (isPrimary false).
   282  	ID *string `json:"id,omitempty"`
   283  	// IsPrimary - Is this storage account resource the primary storage account for the Media Service resource. Blob only storage must set this to false.
   284  	IsPrimary *bool `json:"isPrimary,omitempty"`
   285  }
   286  
   287  // SyncStorageKeysInput the request  body for a SyncStorageKeys API.
   288  type SyncStorageKeysInput struct {
   289  	// ID - The id of the storage account resource.
   290  	ID *string `json:"id,omitempty"`
   291  }
   292  

View as plain text