1package storage 2 3// Copyright (c) Microsoft and contributors. All rights reserved. 4// 5// Licensed under the Apache License, Version 2.0 (the "License"); 6// you may not use this file except in compliance with the License. 7// You may obtain a copy of the License at 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// 14// See the License for the specific language governing permissions and 15// limitations under the License. 16// 17// Code generated by Microsoft (R) AutoRest Code Generator. 18// Changes may cause incorrect behavior and will be lost if the code is regenerated. 19 20import ( 21 "encoding/json" 22 "github.com/Azure/go-autorest/autorest" 23 "github.com/Azure/go-autorest/autorest/azure" 24 "github.com/Azure/go-autorest/autorest/date" 25) 26 27// The package's fully qualified name. 28const fqdn = "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-02-01/storage" 29 30// Account the storage account. 31type Account struct { 32 autorest.Response `json:"-"` 33 // Sku - READ-ONLY; Gets the SKU. 34 Sku *Sku `json:"sku,omitempty"` 35 // Kind - READ-ONLY; Gets the Kind. Possible values include: 'Storage', 'StorageV2', 'BlobStorage' 36 Kind Kind `json:"kind,omitempty"` 37 // Identity - The identity of the resource. 38 Identity *Identity `json:"identity,omitempty"` 39 // AccountProperties - Properties of the storage account. 40 *AccountProperties `json:"properties,omitempty"` 41 // Tags - Resource tags. 42 Tags map[string]*string `json:"tags"` 43 // Location - The geo-location where the resource lives 44 Location *string `json:"location,omitempty"` 45 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 46 ID *string `json:"id,omitempty"` 47 // Name - READ-ONLY; The name of the resource 48 Name *string `json:"name,omitempty"` 49 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 50 Type *string `json:"type,omitempty"` 51} 52 53// MarshalJSON is the custom marshaler for Account. 54func (a Account) MarshalJSON() ([]byte, error) { 55 objectMap := make(map[string]interface{}) 56 if a.Identity != nil { 57 objectMap["identity"] = a.Identity 58 } 59 if a.AccountProperties != nil { 60 objectMap["properties"] = a.AccountProperties 61 } 62 if a.Tags != nil { 63 objectMap["tags"] = a.Tags 64 } 65 if a.Location != nil { 66 objectMap["location"] = a.Location 67 } 68 return json.Marshal(objectMap) 69} 70 71// UnmarshalJSON is the custom unmarshaler for Account struct. 72func (a *Account) UnmarshalJSON(body []byte) error { 73 var m map[string]*json.RawMessage 74 err := json.Unmarshal(body, &m) 75 if err != nil { 76 return err 77 } 78 for k, v := range m { 79 switch k { 80 case "sku": 81 if v != nil { 82 var sku Sku 83 err = json.Unmarshal(*v, &sku) 84 if err != nil { 85 return err 86 } 87 a.Sku = &sku 88 } 89 case "kind": 90 if v != nil { 91 var kind Kind 92 err = json.Unmarshal(*v, &kind) 93 if err != nil { 94 return err 95 } 96 a.Kind = kind 97 } 98 case "identity": 99 if v != nil { 100 var identity Identity 101 err = json.Unmarshal(*v, &identity) 102 if err != nil { 103 return err 104 } 105 a.Identity = &identity 106 } 107 case "properties": 108 if v != nil { 109 var accountProperties AccountProperties 110 err = json.Unmarshal(*v, &accountProperties) 111 if err != nil { 112 return err 113 } 114 a.AccountProperties = &accountProperties 115 } 116 case "tags": 117 if v != nil { 118 var tags map[string]*string 119 err = json.Unmarshal(*v, &tags) 120 if err != nil { 121 return err 122 } 123 a.Tags = tags 124 } 125 case "location": 126 if v != nil { 127 var location string 128 err = json.Unmarshal(*v, &location) 129 if err != nil { 130 return err 131 } 132 a.Location = &location 133 } 134 case "id": 135 if v != nil { 136 var ID string 137 err = json.Unmarshal(*v, &ID) 138 if err != nil { 139 return err 140 } 141 a.ID = &ID 142 } 143 case "name": 144 if v != nil { 145 var name string 146 err = json.Unmarshal(*v, &name) 147 if err != nil { 148 return err 149 } 150 a.Name = &name 151 } 152 case "type": 153 if v != nil { 154 var typeVar string 155 err = json.Unmarshal(*v, &typeVar) 156 if err != nil { 157 return err 158 } 159 a.Type = &typeVar 160 } 161 } 162 } 163 164 return nil 165} 166 167// AccountCheckNameAvailabilityParameters the parameters used to check the availability of the storage 168// account name. 169type AccountCheckNameAvailabilityParameters struct { 170 // Name - The storage account name. 171 Name *string `json:"name,omitempty"` 172 // Type - The type of resource, Microsoft.Storage/storageAccounts 173 Type *string `json:"type,omitempty"` 174} 175 176// AccountCreateParameters the parameters used when creating a storage account. 177type AccountCreateParameters struct { 178 // Sku - Required. Gets or sets the sku name. 179 Sku *Sku `json:"sku,omitempty"` 180 // Kind - Required. Indicates the type of storage account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage' 181 Kind Kind `json:"kind,omitempty"` 182 // Location - Required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed. 183 Location *string `json:"location,omitempty"` 184 // Tags - Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters. 185 Tags map[string]*string `json:"tags"` 186 // Identity - The identity of the resource. 187 Identity *Identity `json:"identity,omitempty"` 188 // AccountPropertiesCreateParameters - The parameters used to create the storage account. 189 *AccountPropertiesCreateParameters `json:"properties,omitempty"` 190} 191 192// MarshalJSON is the custom marshaler for AccountCreateParameters. 193func (acp AccountCreateParameters) MarshalJSON() ([]byte, error) { 194 objectMap := make(map[string]interface{}) 195 if acp.Sku != nil { 196 objectMap["sku"] = acp.Sku 197 } 198 if acp.Kind != "" { 199 objectMap["kind"] = acp.Kind 200 } 201 if acp.Location != nil { 202 objectMap["location"] = acp.Location 203 } 204 if acp.Tags != nil { 205 objectMap["tags"] = acp.Tags 206 } 207 if acp.Identity != nil { 208 objectMap["identity"] = acp.Identity 209 } 210 if acp.AccountPropertiesCreateParameters != nil { 211 objectMap["properties"] = acp.AccountPropertiesCreateParameters 212 } 213 return json.Marshal(objectMap) 214} 215 216// UnmarshalJSON is the custom unmarshaler for AccountCreateParameters struct. 217func (acp *AccountCreateParameters) UnmarshalJSON(body []byte) error { 218 var m map[string]*json.RawMessage 219 err := json.Unmarshal(body, &m) 220 if err != nil { 221 return err 222 } 223 for k, v := range m { 224 switch k { 225 case "sku": 226 if v != nil { 227 var sku Sku 228 err = json.Unmarshal(*v, &sku) 229 if err != nil { 230 return err 231 } 232 acp.Sku = &sku 233 } 234 case "kind": 235 if v != nil { 236 var kind Kind 237 err = json.Unmarshal(*v, &kind) 238 if err != nil { 239 return err 240 } 241 acp.Kind = kind 242 } 243 case "location": 244 if v != nil { 245 var location string 246 err = json.Unmarshal(*v, &location) 247 if err != nil { 248 return err 249 } 250 acp.Location = &location 251 } 252 case "tags": 253 if v != nil { 254 var tags map[string]*string 255 err = json.Unmarshal(*v, &tags) 256 if err != nil { 257 return err 258 } 259 acp.Tags = tags 260 } 261 case "identity": 262 if v != nil { 263 var identity Identity 264 err = json.Unmarshal(*v, &identity) 265 if err != nil { 266 return err 267 } 268 acp.Identity = &identity 269 } 270 case "properties": 271 if v != nil { 272 var accountPropertiesCreateParameters AccountPropertiesCreateParameters 273 err = json.Unmarshal(*v, &accountPropertiesCreateParameters) 274 if err != nil { 275 return err 276 } 277 acp.AccountPropertiesCreateParameters = &accountPropertiesCreateParameters 278 } 279 } 280 } 281 282 return nil 283} 284 285// AccountKey an access key for the storage account. 286type AccountKey struct { 287 // KeyName - READ-ONLY; Name of the key. 288 KeyName *string `json:"keyName,omitempty"` 289 // Value - READ-ONLY; Base 64-encoded value of the key. 290 Value *string `json:"value,omitempty"` 291 // Permissions - READ-ONLY; Permissions for the key -- read-only or full permissions. Possible values include: 'Read', 'Full' 292 Permissions KeyPermission `json:"permissions,omitempty"` 293} 294 295// AccountListKeysResult the response from the ListKeys operation. 296type AccountListKeysResult struct { 297 autorest.Response `json:"-"` 298 // Keys - READ-ONLY; Gets the list of storage account keys and their properties for the specified storage account. 299 Keys *[]AccountKey `json:"keys,omitempty"` 300} 301 302// AccountListResult the response from the List Storage Accounts operation. 303type AccountListResult struct { 304 autorest.Response `json:"-"` 305 // Value - READ-ONLY; Gets the list of storage accounts and their properties. 306 Value *[]Account `json:"value,omitempty"` 307} 308 309// AccountProperties properties of the storage account. 310type AccountProperties struct { 311 // ProvisioningState - READ-ONLY; Gets the status of the storage account at the time the operation was called. Possible values include: 'Creating', 'ResolvingDNS', 'Succeeded' 312 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 313 // PrimaryEndpoints - READ-ONLY; Gets the URLs that are used to perform a retrieval of a public blob, queue, or table object. Note that Standard_ZRS and Premium_LRS accounts only return the blob endpoint. 314 PrimaryEndpoints *Endpoints `json:"primaryEndpoints,omitempty"` 315 // PrimaryLocation - READ-ONLY; Gets the location of the primary data center for the storage account. 316 PrimaryLocation *string `json:"primaryLocation,omitempty"` 317 // StatusOfPrimary - READ-ONLY; Gets the status indicating whether the primary location of the storage account is available or unavailable. Possible values include: 'Available', 'Unavailable' 318 StatusOfPrimary AccountStatus `json:"statusOfPrimary,omitempty"` 319 // LastGeoFailoverTime - READ-ONLY; Gets the timestamp of the most recent instance of a failover to the secondary location. Only the most recent timestamp is retained. This element is not returned if there has never been a failover instance. Only available if the accountType is Standard_GRS or Standard_RAGRS. 320 LastGeoFailoverTime *date.Time `json:"lastGeoFailoverTime,omitempty"` 321 // SecondaryLocation - READ-ONLY; Gets the location of the geo-replicated secondary for the storage account. Only available if the accountType is Standard_GRS or Standard_RAGRS. 322 SecondaryLocation *string `json:"secondaryLocation,omitempty"` 323 // StatusOfSecondary - READ-ONLY; Gets the status indicating whether the secondary location of the storage account is available or unavailable. Only available if the SKU name is Standard_GRS or Standard_RAGRS. Possible values include: 'Available', 'Unavailable' 324 StatusOfSecondary AccountStatus `json:"statusOfSecondary,omitempty"` 325 // CreationTime - READ-ONLY; Gets the creation date and time of the storage account in UTC. 326 CreationTime *date.Time `json:"creationTime,omitempty"` 327 // CustomDomain - READ-ONLY; Gets the custom domain the user assigned to this storage account. 328 CustomDomain *CustomDomain `json:"customDomain,omitempty"` 329 // SecondaryEndpoints - READ-ONLY; Gets the URLs that are used to perform a retrieval of a public blob, queue, or table object from the secondary location of the storage account. Only available if the SKU name is Standard_RAGRS. 330 SecondaryEndpoints *Endpoints `json:"secondaryEndpoints,omitempty"` 331 // Encryption - READ-ONLY; Gets the encryption settings on the account. If unspecified, the account is unencrypted. 332 Encryption *Encryption `json:"encryption,omitempty"` 333 // AccessTier - READ-ONLY; Required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool' 334 AccessTier AccessTier `json:"accessTier,omitempty"` 335 // EnableHTTPSTrafficOnly - Allows https traffic only to storage service if sets to true. 336 EnableHTTPSTrafficOnly *bool `json:"supportsHttpsTrafficOnly,omitempty"` 337 // NetworkRuleSet - READ-ONLY; Network rule set 338 NetworkRuleSet *NetworkRuleSet `json:"networkAcls,omitempty"` 339 // IsHnsEnabled - Account HierarchicalNamespace enabled if sets to true. 340 IsHnsEnabled *bool `json:"isHnsEnabled,omitempty"` 341} 342 343// MarshalJSON is the custom marshaler for AccountProperties. 344func (ap AccountProperties) MarshalJSON() ([]byte, error) { 345 objectMap := make(map[string]interface{}) 346 if ap.EnableHTTPSTrafficOnly != nil { 347 objectMap["supportsHttpsTrafficOnly"] = ap.EnableHTTPSTrafficOnly 348 } 349 if ap.IsHnsEnabled != nil { 350 objectMap["isHnsEnabled"] = ap.IsHnsEnabled 351 } 352 return json.Marshal(objectMap) 353} 354 355// AccountPropertiesCreateParameters the parameters used to create the storage account. 356type AccountPropertiesCreateParameters struct { 357 // CustomDomain - User domain assigned to the storage account. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. 358 CustomDomain *CustomDomain `json:"customDomain,omitempty"` 359 // Encryption - Provides the encryption settings on the account. If left unspecified the account encryption settings will remain the same. The default setting is unencrypted. 360 Encryption *Encryption `json:"encryption,omitempty"` 361 // NetworkRuleSet - Network rule set 362 NetworkRuleSet *NetworkRuleSet `json:"networkAcls,omitempty"` 363 // AccessTier - Required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool' 364 AccessTier AccessTier `json:"accessTier,omitempty"` 365 // EnableHTTPSTrafficOnly - Allows https traffic only to storage service if sets to true. 366 EnableHTTPSTrafficOnly *bool `json:"supportsHttpsTrafficOnly,omitempty"` 367 // IsHnsEnabled - Account HierarchicalNamespace enabled if sets to true. 368 IsHnsEnabled *bool `json:"isHnsEnabled,omitempty"` 369} 370 371// AccountPropertiesUpdateParameters the parameters used when updating a storage account. 372type AccountPropertiesUpdateParameters struct { 373 // CustomDomain - Custom domain assigned to the storage account by the user. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. 374 CustomDomain *CustomDomain `json:"customDomain,omitempty"` 375 // Encryption - Provides the encryption settings on the account. The default setting is unencrypted. 376 Encryption *Encryption `json:"encryption,omitempty"` 377 // AccessTier - Required for storage accounts where kind = BlobStorage. The access tier used for billing. Possible values include: 'Hot', 'Cool' 378 AccessTier AccessTier `json:"accessTier,omitempty"` 379 // EnableHTTPSTrafficOnly - Allows https traffic only to storage service if sets to true. 380 EnableHTTPSTrafficOnly *bool `json:"supportsHttpsTrafficOnly,omitempty"` 381 // NetworkRuleSet - Network rule set 382 NetworkRuleSet *NetworkRuleSet `json:"networkAcls,omitempty"` 383} 384 385// AccountRegenerateKeyParameters the parameters used to regenerate the storage account key. 386type AccountRegenerateKeyParameters struct { 387 // KeyName - The name of storage keys that want to be regenerated, possible values are key1, key2. 388 KeyName *string `json:"keyName,omitempty"` 389} 390 391// AccountSasParameters the parameters to list SAS credentials of a storage account. 392type AccountSasParameters struct { 393 // Services - The signed services accessible with the account SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). Possible values include: 'B', 'Q', 'T', 'F' 394 Services Services `json:"signedServices,omitempty"` 395 // ResourceTypes - The signed resource types that are accessible with the account SAS. Service (s): Access to service-level APIs; Container (c): Access to container-level APIs; Object (o): Access to object-level APIs for blobs, queue messages, table entities, and files. Possible values include: 'SignedResourceTypesS', 'SignedResourceTypesC', 'SignedResourceTypesO' 396 ResourceTypes SignedResourceTypes `json:"signedResourceTypes,omitempty"` 397 // Permissions - The signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). Possible values include: 'R', 'D', 'W', 'L', 'A', 'C', 'U', 'P' 398 Permissions Permissions `json:"signedPermission,omitempty"` 399 // IPAddressOrRange - An IP address or a range of IP addresses from which to accept requests. 400 IPAddressOrRange *string `json:"signedIp,omitempty"` 401 // Protocols - The protocol permitted for a request made with the account SAS. Possible values include: 'Httpshttp', 'HTTPS' 402 Protocols HTTPProtocol `json:"signedProtocol,omitempty"` 403 // SharedAccessStartTime - The time at which the SAS becomes valid. 404 SharedAccessStartTime *date.Time `json:"signedStart,omitempty"` 405 // SharedAccessExpiryTime - The time at which the shared access signature becomes invalid. 406 SharedAccessExpiryTime *date.Time `json:"signedExpiry,omitempty"` 407 // KeyToSign - The key to sign the account SAS token with. 408 KeyToSign *string `json:"keyToSign,omitempty"` 409} 410 411// AccountsCreateFuture an abstraction for monitoring and retrieving the results of a long-running 412// operation. 413type AccountsCreateFuture struct { 414 azure.FutureAPI 415 // Result returns the result of the asynchronous operation. 416 // If the operation has not completed it will return an error. 417 Result func(AccountsClient) (Account, error) 418} 419 420// AccountUpdateParameters the parameters that can be provided when updating the storage account 421// properties. 422type AccountUpdateParameters struct { 423 // Sku - Gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS or Premium_LRS, nor can accounts of those sku names be updated to any other value. 424 Sku *Sku `json:"sku,omitempty"` 425 // Tags - Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters. 426 Tags map[string]*string `json:"tags"` 427 // Identity - The identity of the resource. 428 Identity *Identity `json:"identity,omitempty"` 429 // AccountPropertiesUpdateParameters - The parameters used when updating a storage account. 430 *AccountPropertiesUpdateParameters `json:"properties,omitempty"` 431 // Kind - Optional. Indicates the type of storage account. Currently only StorageV2 value supported by server. Possible values include: 'Storage', 'StorageV2', 'BlobStorage' 432 Kind Kind `json:"kind,omitempty"` 433} 434 435// MarshalJSON is the custom marshaler for AccountUpdateParameters. 436func (aup AccountUpdateParameters) MarshalJSON() ([]byte, error) { 437 objectMap := make(map[string]interface{}) 438 if aup.Sku != nil { 439 objectMap["sku"] = aup.Sku 440 } 441 if aup.Tags != nil { 442 objectMap["tags"] = aup.Tags 443 } 444 if aup.Identity != nil { 445 objectMap["identity"] = aup.Identity 446 } 447 if aup.AccountPropertiesUpdateParameters != nil { 448 objectMap["properties"] = aup.AccountPropertiesUpdateParameters 449 } 450 if aup.Kind != "" { 451 objectMap["kind"] = aup.Kind 452 } 453 return json.Marshal(objectMap) 454} 455 456// UnmarshalJSON is the custom unmarshaler for AccountUpdateParameters struct. 457func (aup *AccountUpdateParameters) UnmarshalJSON(body []byte) error { 458 var m map[string]*json.RawMessage 459 err := json.Unmarshal(body, &m) 460 if err != nil { 461 return err 462 } 463 for k, v := range m { 464 switch k { 465 case "sku": 466 if v != nil { 467 var sku Sku 468 err = json.Unmarshal(*v, &sku) 469 if err != nil { 470 return err 471 } 472 aup.Sku = &sku 473 } 474 case "tags": 475 if v != nil { 476 var tags map[string]*string 477 err = json.Unmarshal(*v, &tags) 478 if err != nil { 479 return err 480 } 481 aup.Tags = tags 482 } 483 case "identity": 484 if v != nil { 485 var identity Identity 486 err = json.Unmarshal(*v, &identity) 487 if err != nil { 488 return err 489 } 490 aup.Identity = &identity 491 } 492 case "properties": 493 if v != nil { 494 var accountPropertiesUpdateParameters AccountPropertiesUpdateParameters 495 err = json.Unmarshal(*v, &accountPropertiesUpdateParameters) 496 if err != nil { 497 return err 498 } 499 aup.AccountPropertiesUpdateParameters = &accountPropertiesUpdateParameters 500 } 501 case "kind": 502 if v != nil { 503 var kind Kind 504 err = json.Unmarshal(*v, &kind) 505 if err != nil { 506 return err 507 } 508 aup.Kind = kind 509 } 510 } 511 } 512 513 return nil 514} 515 516// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag. 517type AzureEntityResource struct { 518 // Etag - READ-ONLY; Resource Etag. 519 Etag *string `json:"etag,omitempty"` 520 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 521 ID *string `json:"id,omitempty"` 522 // Name - READ-ONLY; The name of the resource 523 Name *string `json:"name,omitempty"` 524 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 525 Type *string `json:"type,omitempty"` 526} 527 528// BlobContainer properties of the blob container, including Id, resource name, resource type, Etag. 529type BlobContainer struct { 530 autorest.Response `json:"-"` 531 // ContainerProperties - Properties of the blob container. 532 *ContainerProperties `json:"properties,omitempty"` 533 // Etag - READ-ONLY; Resource Etag. 534 Etag *string `json:"etag,omitempty"` 535 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 536 ID *string `json:"id,omitempty"` 537 // Name - READ-ONLY; The name of the resource 538 Name *string `json:"name,omitempty"` 539 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 540 Type *string `json:"type,omitempty"` 541} 542 543// MarshalJSON is the custom marshaler for BlobContainer. 544func (bc BlobContainer) MarshalJSON() ([]byte, error) { 545 objectMap := make(map[string]interface{}) 546 if bc.ContainerProperties != nil { 547 objectMap["properties"] = bc.ContainerProperties 548 } 549 return json.Marshal(objectMap) 550} 551 552// UnmarshalJSON is the custom unmarshaler for BlobContainer struct. 553func (bc *BlobContainer) UnmarshalJSON(body []byte) error { 554 var m map[string]*json.RawMessage 555 err := json.Unmarshal(body, &m) 556 if err != nil { 557 return err 558 } 559 for k, v := range m { 560 switch k { 561 case "properties": 562 if v != nil { 563 var containerProperties ContainerProperties 564 err = json.Unmarshal(*v, &containerProperties) 565 if err != nil { 566 return err 567 } 568 bc.ContainerProperties = &containerProperties 569 } 570 case "etag": 571 if v != nil { 572 var etag string 573 err = json.Unmarshal(*v, &etag) 574 if err != nil { 575 return err 576 } 577 bc.Etag = &etag 578 } 579 case "id": 580 if v != nil { 581 var ID string 582 err = json.Unmarshal(*v, &ID) 583 if err != nil { 584 return err 585 } 586 bc.ID = &ID 587 } 588 case "name": 589 if v != nil { 590 var name string 591 err = json.Unmarshal(*v, &name) 592 if err != nil { 593 return err 594 } 595 bc.Name = &name 596 } 597 case "type": 598 if v != nil { 599 var typeVar string 600 err = json.Unmarshal(*v, &typeVar) 601 if err != nil { 602 return err 603 } 604 bc.Type = &typeVar 605 } 606 } 607 } 608 609 return nil 610} 611 612// CheckNameAvailabilityResult the CheckNameAvailability operation response. 613type CheckNameAvailabilityResult struct { 614 autorest.Response `json:"-"` 615 // NameAvailable - READ-ONLY; Gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or is invalid and cannot be used. 616 NameAvailable *bool `json:"nameAvailable,omitempty"` 617 // Reason - READ-ONLY; Gets the reason that a storage account name could not be used. The Reason element is only returned if NameAvailable is false. Possible values include: 'AccountNameInvalid', 'AlreadyExists' 618 Reason Reason `json:"reason,omitempty"` 619 // Message - READ-ONLY; Gets an error message explaining the Reason value in more detail. 620 Message *string `json:"message,omitempty"` 621} 622 623// ContainerProperties the properties of a container. 624type ContainerProperties struct { 625 // PublicAccess - Specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'PublicAccessContainer', 'PublicAccessBlob', 'PublicAccessNone' 626 PublicAccess PublicAccess `json:"publicAccess,omitempty"` 627 // LastModifiedTime - READ-ONLY; Returns the date and time the container was last modified. 628 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 629 // LeaseStatus - READ-ONLY; The lease status of the container. Possible values include: 'LeaseStatusLocked', 'LeaseStatusUnlocked' 630 LeaseStatus LeaseStatus `json:"leaseStatus,omitempty"` 631 // LeaseState - READ-ONLY; Lease state of the container. Possible values include: 'LeaseStateAvailable', 'LeaseStateLeased', 'LeaseStateExpired', 'LeaseStateBreaking', 'LeaseStateBroken' 632 LeaseState LeaseState `json:"leaseState,omitempty"` 633 // LeaseDuration - READ-ONLY; Specifies whether the lease on a container is of infinite or fixed duration, only when the container is leased. Possible values include: 'Infinite', 'Fixed' 634 LeaseDuration LeaseDuration `json:"leaseDuration,omitempty"` 635 // Metadata - A name-value pair to associate with the container as metadata. 636 Metadata map[string]*string `json:"metadata"` 637 // ImmutabilityPolicy - READ-ONLY; The ImmutabilityPolicy property of the container. 638 ImmutabilityPolicy *ImmutabilityPolicyProperties `json:"immutabilityPolicy,omitempty"` 639 // LegalHold - READ-ONLY; The LegalHold property of the container. 640 LegalHold *LegalHoldProperties `json:"legalHold,omitempty"` 641 // HasLegalHold - READ-ONLY; The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account. 642 HasLegalHold *bool `json:"hasLegalHold,omitempty"` 643 // HasImmutabilityPolicy - READ-ONLY; The hasImmutabilityPolicy public property is set to true by SRP if ImmutabilityPolicy has been created for this container. The hasImmutabilityPolicy public property is set to false by SRP if ImmutabilityPolicy has not been created for this container. 644 HasImmutabilityPolicy *bool `json:"hasImmutabilityPolicy,omitempty"` 645} 646 647// MarshalJSON is the custom marshaler for ContainerProperties. 648func (cp ContainerProperties) MarshalJSON() ([]byte, error) { 649 objectMap := make(map[string]interface{}) 650 if cp.PublicAccess != "" { 651 objectMap["publicAccess"] = cp.PublicAccess 652 } 653 if cp.Metadata != nil { 654 objectMap["metadata"] = cp.Metadata 655 } 656 return json.Marshal(objectMap) 657} 658 659// CustomDomain the custom domain assigned to this storage account. This can be set via Update. 660type CustomDomain struct { 661 // Name - Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. 662 Name *string `json:"name,omitempty"` 663 // UseSubDomainName - Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. 664 UseSubDomainName *bool `json:"useSubDomainName,omitempty"` 665} 666 667// Dimension dimension of blobs, possibly be blob type or access tier. 668type Dimension struct { 669 // Name - Display name of dimension. 670 Name *string `json:"name,omitempty"` 671 // DisplayName - Display name of dimension. 672 DisplayName *string `json:"displayName,omitempty"` 673} 674 675// Encryption the encryption settings on the storage account. 676type Encryption struct { 677 // Services - List of services which support encryption. 678 Services *EncryptionServices `json:"services,omitempty"` 679 // KeySource - The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. Possible values include: 'MicrosoftStorage', 'MicrosoftKeyvault' 680 KeySource KeySource `json:"keySource,omitempty"` 681 // KeyVaultProperties - Properties provided by key vault. 682 KeyVaultProperties *KeyVaultProperties `json:"keyvaultproperties,omitempty"` 683} 684 685// EncryptionService a service that allows server-side encryption to be used. 686type EncryptionService struct { 687 // Enabled - A boolean indicating whether or not the service encrypts the data as it is stored. 688 Enabled *bool `json:"enabled,omitempty"` 689 // LastEnabledTime - READ-ONLY; Gets a rough estimate of the date/time when the encryption was last enabled by the user. Only returned when encryption is enabled. There might be some unencrypted blobs which were written after this time, as it is just a rough estimate. 690 LastEnabledTime *date.Time `json:"lastEnabledTime,omitempty"` 691} 692 693// MarshalJSON is the custom marshaler for EncryptionService. 694func (es EncryptionService) MarshalJSON() ([]byte, error) { 695 objectMap := make(map[string]interface{}) 696 if es.Enabled != nil { 697 objectMap["enabled"] = es.Enabled 698 } 699 return json.Marshal(objectMap) 700} 701 702// EncryptionServices a list of services that support encryption. 703type EncryptionServices struct { 704 // Blob - The encryption function of the blob storage service. 705 Blob *EncryptionService `json:"blob,omitempty"` 706 // File - The encryption function of the file storage service. 707 File *EncryptionService `json:"file,omitempty"` 708 // Table - READ-ONLY; The encryption function of the table storage service. 709 Table *EncryptionService `json:"table,omitempty"` 710 // Queue - READ-ONLY; The encryption function of the queue storage service. 711 Queue *EncryptionService `json:"queue,omitempty"` 712} 713 714// MarshalJSON is the custom marshaler for EncryptionServices. 715func (es EncryptionServices) MarshalJSON() ([]byte, error) { 716 objectMap := make(map[string]interface{}) 717 if es.Blob != nil { 718 objectMap["blob"] = es.Blob 719 } 720 if es.File != nil { 721 objectMap["file"] = es.File 722 } 723 return json.Marshal(objectMap) 724} 725 726// Endpoints the URIs that are used to perform a retrieval of a public blob, queue, table, web or dfs 727// object. 728type Endpoints struct { 729 // Blob - READ-ONLY; Gets the blob endpoint. 730 Blob *string `json:"blob,omitempty"` 731 // Queue - READ-ONLY; Gets the queue endpoint. 732 Queue *string `json:"queue,omitempty"` 733 // Table - READ-ONLY; Gets the table endpoint. 734 Table *string `json:"table,omitempty"` 735 // File - READ-ONLY; Gets the file endpoint. 736 File *string `json:"file,omitempty"` 737 // Web - READ-ONLY; Gets the web endpoint. 738 Web *string `json:"web,omitempty"` 739 // Dfs - READ-ONLY; Gets the dfs endpoint. 740 Dfs *string `json:"dfs,omitempty"` 741} 742 743// Identity identity for the resource. 744type Identity struct { 745 // PrincipalID - READ-ONLY; The principal ID of resource identity. 746 PrincipalID *string `json:"principalId,omitempty"` 747 // TenantID - READ-ONLY; The tenant ID of resource. 748 TenantID *string `json:"tenantId,omitempty"` 749 // Type - The identity type. 750 Type *string `json:"type,omitempty"` 751} 752 753// MarshalJSON is the custom marshaler for Identity. 754func (i Identity) MarshalJSON() ([]byte, error) { 755 objectMap := make(map[string]interface{}) 756 if i.Type != nil { 757 objectMap["type"] = i.Type 758 } 759 return json.Marshal(objectMap) 760} 761 762// ImmutabilityPolicy the ImmutabilityPolicy property of a blob container, including Id, resource name, 763// resource type, Etag. 764type ImmutabilityPolicy struct { 765 autorest.Response `json:"-"` 766 // ImmutabilityPolicyProperty - The properties of an ImmutabilityPolicy of a blob container. 767 *ImmutabilityPolicyProperty `json:"properties,omitempty"` 768 // Etag - READ-ONLY; Resource Etag. 769 Etag *string `json:"etag,omitempty"` 770 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 771 ID *string `json:"id,omitempty"` 772 // Name - READ-ONLY; The name of the resource 773 Name *string `json:"name,omitempty"` 774 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 775 Type *string `json:"type,omitempty"` 776} 777 778// MarshalJSON is the custom marshaler for ImmutabilityPolicy. 779func (IP ImmutabilityPolicy) MarshalJSON() ([]byte, error) { 780 objectMap := make(map[string]interface{}) 781 if IP.ImmutabilityPolicyProperty != nil { 782 objectMap["properties"] = IP.ImmutabilityPolicyProperty 783 } 784 return json.Marshal(objectMap) 785} 786 787// UnmarshalJSON is the custom unmarshaler for ImmutabilityPolicy struct. 788func (IP *ImmutabilityPolicy) UnmarshalJSON(body []byte) error { 789 var m map[string]*json.RawMessage 790 err := json.Unmarshal(body, &m) 791 if err != nil { 792 return err 793 } 794 for k, v := range m { 795 switch k { 796 case "properties": 797 if v != nil { 798 var immutabilityPolicyProperty ImmutabilityPolicyProperty 799 err = json.Unmarshal(*v, &immutabilityPolicyProperty) 800 if err != nil { 801 return err 802 } 803 IP.ImmutabilityPolicyProperty = &immutabilityPolicyProperty 804 } 805 case "etag": 806 if v != nil { 807 var etag string 808 err = json.Unmarshal(*v, &etag) 809 if err != nil { 810 return err 811 } 812 IP.Etag = &etag 813 } 814 case "id": 815 if v != nil { 816 var ID string 817 err = json.Unmarshal(*v, &ID) 818 if err != nil { 819 return err 820 } 821 IP.ID = &ID 822 } 823 case "name": 824 if v != nil { 825 var name string 826 err = json.Unmarshal(*v, &name) 827 if err != nil { 828 return err 829 } 830 IP.Name = &name 831 } 832 case "type": 833 if v != nil { 834 var typeVar string 835 err = json.Unmarshal(*v, &typeVar) 836 if err != nil { 837 return err 838 } 839 IP.Type = &typeVar 840 } 841 } 842 } 843 844 return nil 845} 846 847// ImmutabilityPolicyProperties the properties of an ImmutabilityPolicy of a blob container. 848type ImmutabilityPolicyProperties struct { 849 // ImmutabilityPolicyProperty - The properties of an ImmutabilityPolicy of a blob container. 850 *ImmutabilityPolicyProperty `json:"properties,omitempty"` 851 // Etag - READ-ONLY; ImmutabilityPolicy Etag. 852 Etag *string `json:"etag,omitempty"` 853 // UpdateHistory - READ-ONLY; The ImmutabilityPolicy update history of the blob container. 854 UpdateHistory *[]UpdateHistoryProperty `json:"updateHistory,omitempty"` 855} 856 857// MarshalJSON is the custom marshaler for ImmutabilityPolicyProperties. 858func (ipp ImmutabilityPolicyProperties) MarshalJSON() ([]byte, error) { 859 objectMap := make(map[string]interface{}) 860 if ipp.ImmutabilityPolicyProperty != nil { 861 objectMap["properties"] = ipp.ImmutabilityPolicyProperty 862 } 863 return json.Marshal(objectMap) 864} 865 866// UnmarshalJSON is the custom unmarshaler for ImmutabilityPolicyProperties struct. 867func (ipp *ImmutabilityPolicyProperties) UnmarshalJSON(body []byte) error { 868 var m map[string]*json.RawMessage 869 err := json.Unmarshal(body, &m) 870 if err != nil { 871 return err 872 } 873 for k, v := range m { 874 switch k { 875 case "properties": 876 if v != nil { 877 var immutabilityPolicyProperty ImmutabilityPolicyProperty 878 err = json.Unmarshal(*v, &immutabilityPolicyProperty) 879 if err != nil { 880 return err 881 } 882 ipp.ImmutabilityPolicyProperty = &immutabilityPolicyProperty 883 } 884 case "etag": 885 if v != nil { 886 var etag string 887 err = json.Unmarshal(*v, &etag) 888 if err != nil { 889 return err 890 } 891 ipp.Etag = &etag 892 } 893 case "updateHistory": 894 if v != nil { 895 var updateHistory []UpdateHistoryProperty 896 err = json.Unmarshal(*v, &updateHistory) 897 if err != nil { 898 return err 899 } 900 ipp.UpdateHistory = &updateHistory 901 } 902 } 903 } 904 905 return nil 906} 907 908// ImmutabilityPolicyProperty the properties of an ImmutabilityPolicy of a blob container. 909type ImmutabilityPolicyProperty struct { 910 // ImmutabilityPeriodSinceCreationInDays - The immutability period for the blobs in the container since the policy creation, in days. 911 ImmutabilityPeriodSinceCreationInDays *int32 `json:"immutabilityPeriodSinceCreationInDays,omitempty"` 912 // State - READ-ONLY; The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. Possible values include: 'Locked', 'Unlocked' 913 State ImmutabilityPolicyState `json:"state,omitempty"` 914} 915 916// MarshalJSON is the custom marshaler for ImmutabilityPolicyProperty. 917func (ipp ImmutabilityPolicyProperty) MarshalJSON() ([]byte, error) { 918 objectMap := make(map[string]interface{}) 919 if ipp.ImmutabilityPeriodSinceCreationInDays != nil { 920 objectMap["immutabilityPeriodSinceCreationInDays"] = ipp.ImmutabilityPeriodSinceCreationInDays 921 } 922 return json.Marshal(objectMap) 923} 924 925// IPRule IP rule with specific IP or IP range in CIDR format. 926type IPRule struct { 927 // IPAddressOrRange - Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. 928 IPAddressOrRange *string `json:"value,omitempty"` 929 // Action - The action of IP ACL rule. Possible values include: 'Allow' 930 Action Action `json:"action,omitempty"` 931} 932 933// KeyVaultProperties properties of key vault. 934type KeyVaultProperties struct { 935 // KeyName - The name of KeyVault key. 936 KeyName *string `json:"keyname,omitempty"` 937 // KeyVersion - The version of KeyVault key. 938 KeyVersion *string `json:"keyversion,omitempty"` 939 // KeyVaultURI - The Uri of KeyVault. 940 KeyVaultURI *string `json:"keyvaulturi,omitempty"` 941} 942 943// LeaseContainerRequest lease Container request schema. 944type LeaseContainerRequest struct { 945 // Action - Specifies the lease action. Can be one of the available actions. Possible values include: 'Acquire', 'Renew', 'Change', 'Release', 'Break' 946 Action Action1 `json:"action,omitempty"` 947 // LeaseID - Identifies the lease. Can be specified in any valid GUID string format. 948 LeaseID *string `json:"leaseId,omitempty"` 949 // BreakPeriod - Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60. 950 BreakPeriod *int32 `json:"breakPeriod,omitempty"` 951 // LeaseDuration - Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. 952 LeaseDuration *int32 `json:"leaseDuration,omitempty"` 953 // ProposedLeaseID - Optional for acquire, required for change. Proposed lease ID, in a GUID string format. 954 ProposedLeaseID *string `json:"proposedLeaseId,omitempty"` 955} 956 957// LeaseContainerResponse lease Container response schema. 958type LeaseContainerResponse struct { 959 autorest.Response `json:"-"` 960 // LeaseID - Returned unique lease ID that must be included with any request to delete the container, or to renew, change, or release the lease. 961 LeaseID *string `json:"leaseId,omitempty"` 962 // LeaseTimeSeconds - Approximate time remaining in the lease period, in seconds. 963 LeaseTimeSeconds *string `json:"leaseTimeSeconds,omitempty"` 964} 965 966// LegalHold the LegalHold property of a blob container. 967type LegalHold struct { 968 autorest.Response `json:"-"` 969 // HasLegalHold - READ-ONLY; The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account. 970 HasLegalHold *bool `json:"hasLegalHold,omitempty"` 971 // Tags - Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. 972 Tags *[]string `json:"tags,omitempty"` 973} 974 975// MarshalJSON is the custom marshaler for LegalHold. 976func (lh LegalHold) MarshalJSON() ([]byte, error) { 977 objectMap := make(map[string]interface{}) 978 if lh.Tags != nil { 979 objectMap["tags"] = lh.Tags 980 } 981 return json.Marshal(objectMap) 982} 983 984// LegalHoldProperties the LegalHold property of a blob container. 985type LegalHoldProperties struct { 986 // HasLegalHold - READ-ONLY; The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account. 987 HasLegalHold *bool `json:"hasLegalHold,omitempty"` 988 // Tags - The list of LegalHold tags of a blob container. 989 Tags *[]TagProperty `json:"tags,omitempty"` 990} 991 992// MarshalJSON is the custom marshaler for LegalHoldProperties. 993func (lhp LegalHoldProperties) MarshalJSON() ([]byte, error) { 994 objectMap := make(map[string]interface{}) 995 if lhp.Tags != nil { 996 objectMap["tags"] = lhp.Tags 997 } 998 return json.Marshal(objectMap) 999} 1000 1001// ListAccountSasResponse the List SAS credentials operation response. 1002type ListAccountSasResponse struct { 1003 autorest.Response `json:"-"` 1004 // AccountSasToken - READ-ONLY; List SAS credentials of storage account. 1005 AccountSasToken *string `json:"accountSasToken,omitempty"` 1006} 1007 1008// ListContainerItem the blob container properties be listed out. 1009type ListContainerItem struct { 1010 // ContainerProperties - The blob container properties be listed out. 1011 *ContainerProperties `json:"properties,omitempty"` 1012 // Etag - READ-ONLY; Resource Etag. 1013 Etag *string `json:"etag,omitempty"` 1014 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 1015 ID *string `json:"id,omitempty"` 1016 // Name - READ-ONLY; The name of the resource 1017 Name *string `json:"name,omitempty"` 1018 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 1019 Type *string `json:"type,omitempty"` 1020} 1021 1022// MarshalJSON is the custom marshaler for ListContainerItem. 1023func (lci ListContainerItem) MarshalJSON() ([]byte, error) { 1024 objectMap := make(map[string]interface{}) 1025 if lci.ContainerProperties != nil { 1026 objectMap["properties"] = lci.ContainerProperties 1027 } 1028 return json.Marshal(objectMap) 1029} 1030 1031// UnmarshalJSON is the custom unmarshaler for ListContainerItem struct. 1032func (lci *ListContainerItem) UnmarshalJSON(body []byte) error { 1033 var m map[string]*json.RawMessage 1034 err := json.Unmarshal(body, &m) 1035 if err != nil { 1036 return err 1037 } 1038 for k, v := range m { 1039 switch k { 1040 case "properties": 1041 if v != nil { 1042 var containerProperties ContainerProperties 1043 err = json.Unmarshal(*v, &containerProperties) 1044 if err != nil { 1045 return err 1046 } 1047 lci.ContainerProperties = &containerProperties 1048 } 1049 case "etag": 1050 if v != nil { 1051 var etag string 1052 err = json.Unmarshal(*v, &etag) 1053 if err != nil { 1054 return err 1055 } 1056 lci.Etag = &etag 1057 } 1058 case "id": 1059 if v != nil { 1060 var ID string 1061 err = json.Unmarshal(*v, &ID) 1062 if err != nil { 1063 return err 1064 } 1065 lci.ID = &ID 1066 } 1067 case "name": 1068 if v != nil { 1069 var name string 1070 err = json.Unmarshal(*v, &name) 1071 if err != nil { 1072 return err 1073 } 1074 lci.Name = &name 1075 } 1076 case "type": 1077 if v != nil { 1078 var typeVar string 1079 err = json.Unmarshal(*v, &typeVar) 1080 if err != nil { 1081 return err 1082 } 1083 lci.Type = &typeVar 1084 } 1085 } 1086 } 1087 1088 return nil 1089} 1090 1091// ListContainerItems the list of blob containers. 1092type ListContainerItems struct { 1093 autorest.Response `json:"-"` 1094 // Value - The list of blob containers. 1095 Value *[]ListContainerItem `json:"value,omitempty"` 1096} 1097 1098// ListServiceSasResponse the List service SAS credentials operation response. 1099type ListServiceSasResponse struct { 1100 autorest.Response `json:"-"` 1101 // ServiceSasToken - READ-ONLY; List service SAS credentials of specific resource. 1102 ServiceSasToken *string `json:"serviceSasToken,omitempty"` 1103} 1104 1105// MetricSpecification metric specification of operation. 1106type MetricSpecification struct { 1107 // Name - Name of metric specification. 1108 Name *string `json:"name,omitempty"` 1109 // DisplayName - Display name of metric specification. 1110 DisplayName *string `json:"displayName,omitempty"` 1111 // DisplayDescription - Display description of metric specification. 1112 DisplayDescription *string `json:"displayDescription,omitempty"` 1113 // Unit - Unit could be Bytes or Count. 1114 Unit *string `json:"unit,omitempty"` 1115 // Dimensions - Dimensions of blobs, including blob type and access tier. 1116 Dimensions *[]Dimension `json:"dimensions,omitempty"` 1117 // AggregationType - Aggregation type could be Average. 1118 AggregationType *string `json:"aggregationType,omitempty"` 1119 // FillGapWithZero - The property to decide fill gap with zero or not. 1120 FillGapWithZero *bool `json:"fillGapWithZero,omitempty"` 1121 // Category - The category this metric specification belong to, could be Capacity. 1122 Category *string `json:"category,omitempty"` 1123 // ResourceIDDimensionNameOverride - Account Resource Id. 1124 ResourceIDDimensionNameOverride *string `json:"resourceIdDimensionNameOverride,omitempty"` 1125} 1126 1127// NetworkRuleSet network rule set 1128type NetworkRuleSet struct { 1129 // Bypass - Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None to bypass none of those traffics. Possible values include: 'None', 'Logging', 'Metrics', 'AzureServices' 1130 Bypass Bypass `json:"bypass,omitempty"` 1131 // VirtualNetworkRules - Sets the virtual network rules 1132 VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"` 1133 // IPRules - Sets the IP ACL rules 1134 IPRules *[]IPRule `json:"ipRules,omitempty"` 1135 // DefaultAction - Specifies the default action of allow or deny when no other rules match. Possible values include: 'DefaultActionAllow', 'DefaultActionDeny' 1136 DefaultAction DefaultAction `json:"defaultAction,omitempty"` 1137} 1138 1139// Operation storage REST API operation definition. 1140type Operation struct { 1141 // Name - Operation name: {provider}/{resource}/{operation} 1142 Name *string `json:"name,omitempty"` 1143 // Display - Display metadata associated with the operation. 1144 Display *OperationDisplay `json:"display,omitempty"` 1145 // Origin - The origin of operations. 1146 Origin *string `json:"origin,omitempty"` 1147 // OperationProperties - Properties of operation, include metric specifications. 1148 *OperationProperties `json:"properties,omitempty"` 1149} 1150 1151// MarshalJSON is the custom marshaler for Operation. 1152func (o Operation) MarshalJSON() ([]byte, error) { 1153 objectMap := make(map[string]interface{}) 1154 if o.Name != nil { 1155 objectMap["name"] = o.Name 1156 } 1157 if o.Display != nil { 1158 objectMap["display"] = o.Display 1159 } 1160 if o.Origin != nil { 1161 objectMap["origin"] = o.Origin 1162 } 1163 if o.OperationProperties != nil { 1164 objectMap["properties"] = o.OperationProperties 1165 } 1166 return json.Marshal(objectMap) 1167} 1168 1169// UnmarshalJSON is the custom unmarshaler for Operation struct. 1170func (o *Operation) UnmarshalJSON(body []byte) error { 1171 var m map[string]*json.RawMessage 1172 err := json.Unmarshal(body, &m) 1173 if err != nil { 1174 return err 1175 } 1176 for k, v := range m { 1177 switch k { 1178 case "name": 1179 if v != nil { 1180 var name string 1181 err = json.Unmarshal(*v, &name) 1182 if err != nil { 1183 return err 1184 } 1185 o.Name = &name 1186 } 1187 case "display": 1188 if v != nil { 1189 var display OperationDisplay 1190 err = json.Unmarshal(*v, &display) 1191 if err != nil { 1192 return err 1193 } 1194 o.Display = &display 1195 } 1196 case "origin": 1197 if v != nil { 1198 var origin string 1199 err = json.Unmarshal(*v, &origin) 1200 if err != nil { 1201 return err 1202 } 1203 o.Origin = &origin 1204 } 1205 case "properties": 1206 if v != nil { 1207 var operationProperties OperationProperties 1208 err = json.Unmarshal(*v, &operationProperties) 1209 if err != nil { 1210 return err 1211 } 1212 o.OperationProperties = &operationProperties 1213 } 1214 } 1215 } 1216 1217 return nil 1218} 1219 1220// OperationDisplay display metadata associated with the operation. 1221type OperationDisplay struct { 1222 // Provider - Service provider: Microsoft Storage. 1223 Provider *string `json:"provider,omitempty"` 1224 // Resource - Resource on which the operation is performed etc. 1225 Resource *string `json:"resource,omitempty"` 1226 // Operation - Type of operation: get, read, delete, etc. 1227 Operation *string `json:"operation,omitempty"` 1228 // Description - Description of the operation. 1229 Description *string `json:"description,omitempty"` 1230} 1231 1232// OperationListResult result of the request to list Storage operations. It contains a list of operations 1233// and a URL link to get the next set of results. 1234type OperationListResult struct { 1235 autorest.Response `json:"-"` 1236 // Value - List of Storage operations supported by the Storage resource provider. 1237 Value *[]Operation `json:"value,omitempty"` 1238} 1239 1240// OperationProperties properties of operation, include metric specifications. 1241type OperationProperties struct { 1242 // ServiceSpecification - One property of operation, include metric specifications. 1243 ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"` 1244} 1245 1246// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not 1247// have tags and a location 1248type ProxyResource struct { 1249 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 1250 ID *string `json:"id,omitempty"` 1251 // Name - READ-ONLY; The name of the resource 1252 Name *string `json:"name,omitempty"` 1253 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 1254 Type *string `json:"type,omitempty"` 1255} 1256 1257// Resource common fields that are returned in the response for all Azure Resource Manager resources 1258type Resource struct { 1259 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 1260 ID *string `json:"id,omitempty"` 1261 // Name - READ-ONLY; The name of the resource 1262 Name *string `json:"name,omitempty"` 1263 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 1264 Type *string `json:"type,omitempty"` 1265} 1266 1267// Restriction the restriction because of which SKU cannot be used. 1268type Restriction struct { 1269 // Type - READ-ONLY; The type of restrictions. As of now only possible value for this is location. 1270 Type *string `json:"type,omitempty"` 1271 // Values - READ-ONLY; The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted. 1272 Values *[]string `json:"values,omitempty"` 1273 // ReasonCode - The reason for the restriction. As of now this can be "QuotaId" or "NotAvailableForSubscription". Quota Id is set when the SKU has requiredQuotas parameter as the subscription does not belong to that quota. The "NotAvailableForSubscription" is related to capacity at DC. Possible values include: 'QuotaID', 'NotAvailableForSubscription' 1274 ReasonCode ReasonCode `json:"reasonCode,omitempty"` 1275} 1276 1277// MarshalJSON is the custom marshaler for Restriction. 1278func (r Restriction) MarshalJSON() ([]byte, error) { 1279 objectMap := make(map[string]interface{}) 1280 if r.ReasonCode != "" { 1281 objectMap["reasonCode"] = r.ReasonCode 1282 } 1283 return json.Marshal(objectMap) 1284} 1285 1286// ServiceSasParameters the parameters to list service SAS credentials of a specific resource. 1287type ServiceSasParameters struct { 1288 // CanonicalizedResource - The canonical path to the signed resource. 1289 CanonicalizedResource *string `json:"canonicalizedResource,omitempty"` 1290 // Resource - The signed services accessible with the service SAS. Possible values include: Blob (b), Container (c), File (f), Share (s). Possible values include: 'SignedResourceB', 'SignedResourceC', 'SignedResourceF', 'SignedResourceS' 1291 Resource SignedResource `json:"signedResource,omitempty"` 1292 // Permissions - The signed permissions for the service SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). Possible values include: 'R', 'D', 'W', 'L', 'A', 'C', 'U', 'P' 1293 Permissions Permissions `json:"signedPermission,omitempty"` 1294 // IPAddressOrRange - An IP address or a range of IP addresses from which to accept requests. 1295 IPAddressOrRange *string `json:"signedIp,omitempty"` 1296 // Protocols - The protocol permitted for a request made with the account SAS. Possible values include: 'Httpshttp', 'HTTPS' 1297 Protocols HTTPProtocol `json:"signedProtocol,omitempty"` 1298 // SharedAccessStartTime - The time at which the SAS becomes valid. 1299 SharedAccessStartTime *date.Time `json:"signedStart,omitempty"` 1300 // SharedAccessExpiryTime - The time at which the shared access signature becomes invalid. 1301 SharedAccessExpiryTime *date.Time `json:"signedExpiry,omitempty"` 1302 // Identifier - A unique value up to 64 characters in length that correlates to an access policy specified for the container, queue, or table. 1303 Identifier *string `json:"signedIdentifier,omitempty"` 1304 // PartitionKeyStart - The start of partition key. 1305 PartitionKeyStart *string `json:"startPk,omitempty"` 1306 // PartitionKeyEnd - The end of partition key. 1307 PartitionKeyEnd *string `json:"endPk,omitempty"` 1308 // RowKeyStart - The start of row key. 1309 RowKeyStart *string `json:"startRk,omitempty"` 1310 // RowKeyEnd - The end of row key. 1311 RowKeyEnd *string `json:"endRk,omitempty"` 1312 // KeyToSign - The key to sign the account SAS token with. 1313 KeyToSign *string `json:"keyToSign,omitempty"` 1314 // CacheControl - The response header override for cache control. 1315 CacheControl *string `json:"rscc,omitempty"` 1316 // ContentDisposition - The response header override for content disposition. 1317 ContentDisposition *string `json:"rscd,omitempty"` 1318 // ContentEncoding - The response header override for content encoding. 1319 ContentEncoding *string `json:"rsce,omitempty"` 1320 // ContentLanguage - The response header override for content language. 1321 ContentLanguage *string `json:"rscl,omitempty"` 1322 // ContentType - The response header override for content type. 1323 ContentType *string `json:"rsct,omitempty"` 1324} 1325 1326// ServiceSpecification one property of operation, include metric specifications. 1327type ServiceSpecification struct { 1328 // MetricSpecifications - Metric specifications of operation. 1329 MetricSpecifications *[]MetricSpecification `json:"metricSpecifications,omitempty"` 1330} 1331 1332// Sku the SKU of the storage account. 1333type Sku struct { 1334 // Name - Gets or sets the sku name. Required for account creation; optional for update. Note that in older versions, sku name was called accountType. Possible values include: 'StandardLRS', 'StandardGRS', 'StandardRAGRS', 'StandardZRS', 'PremiumLRS' 1335 Name SkuName `json:"name,omitempty"` 1336 // Tier - READ-ONLY; Gets the sku tier. This is based on the SKU name. Possible values include: 'Standard', 'Premium' 1337 Tier SkuTier `json:"tier,omitempty"` 1338 // ResourceType - READ-ONLY; The type of the resource, usually it is 'storageAccounts'. 1339 ResourceType *string `json:"resourceType,omitempty"` 1340 // Kind - READ-ONLY; Indicates the type of storage account. Possible values include: 'Storage', 'StorageV2', 'BlobStorage' 1341 Kind Kind `json:"kind,omitempty"` 1342 // Locations - READ-ONLY; The set of locations that the SKU is available. This will be supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). 1343 Locations *[]string `json:"locations,omitempty"` 1344 // Capabilities - READ-ONLY; The capability information in the specified sku, including file encryption, network acls, change notification, etc. 1345 Capabilities *[]SKUCapability `json:"capabilities,omitempty"` 1346 // Restrictions - The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. 1347 Restrictions *[]Restriction `json:"restrictions,omitempty"` 1348} 1349 1350// MarshalJSON is the custom marshaler for Sku. 1351func (s Sku) MarshalJSON() ([]byte, error) { 1352 objectMap := make(map[string]interface{}) 1353 if s.Name != "" { 1354 objectMap["name"] = s.Name 1355 } 1356 if s.Restrictions != nil { 1357 objectMap["restrictions"] = s.Restrictions 1358 } 1359 return json.Marshal(objectMap) 1360} 1361 1362// SKUCapability the capability information in the specified sku, including file encryption, network acls, 1363// change notification, etc. 1364type SKUCapability struct { 1365 // Name - READ-ONLY; The name of capability, The capability information in the specified sku, including file encryption, network acls, change notification, etc. 1366 Name *string `json:"name,omitempty"` 1367 // Value - READ-ONLY; A string value to indicate states of given capability. Possibly 'true' or 'false'. 1368 Value *string `json:"value,omitempty"` 1369} 1370 1371// SkuListResult the response from the List Storage SKUs operation. 1372type SkuListResult struct { 1373 autorest.Response `json:"-"` 1374 // Value - READ-ONLY; Get the list result of storage SKUs and their properties. 1375 Value *[]Sku `json:"value,omitempty"` 1376} 1377 1378// TagProperty a tag of the LegalHold of a blob container. 1379type TagProperty struct { 1380 // Tag - READ-ONLY; The tag value. 1381 Tag *string `json:"tag,omitempty"` 1382 // Timestamp - READ-ONLY; Returns the date and time the tag was added. 1383 Timestamp *date.Time `json:"timestamp,omitempty"` 1384 // ObjectIdentifier - READ-ONLY; Returns the Object ID of the user who added the tag. 1385 ObjectIdentifier *string `json:"objectIdentifier,omitempty"` 1386 // TenantID - READ-ONLY; Returns the Tenant ID that issued the token for the user who added the tag. 1387 TenantID *string `json:"tenantId,omitempty"` 1388 // Upn - READ-ONLY; Returns the User Principal Name of the user who added the tag. 1389 Upn *string `json:"upn,omitempty"` 1390} 1391 1392// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource 1393// which has 'tags' and a 'location' 1394type TrackedResource struct { 1395 // Tags - Resource tags. 1396 Tags map[string]*string `json:"tags"` 1397 // Location - The geo-location where the resource lives 1398 Location *string `json:"location,omitempty"` 1399 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 1400 ID *string `json:"id,omitempty"` 1401 // Name - READ-ONLY; The name of the resource 1402 Name *string `json:"name,omitempty"` 1403 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 1404 Type *string `json:"type,omitempty"` 1405} 1406 1407// MarshalJSON is the custom marshaler for TrackedResource. 1408func (tr TrackedResource) MarshalJSON() ([]byte, error) { 1409 objectMap := make(map[string]interface{}) 1410 if tr.Tags != nil { 1411 objectMap["tags"] = tr.Tags 1412 } 1413 if tr.Location != nil { 1414 objectMap["location"] = tr.Location 1415 } 1416 return json.Marshal(objectMap) 1417} 1418 1419// UpdateHistoryProperty an update history of the ImmutabilityPolicy of a blob container. 1420type UpdateHistoryProperty struct { 1421 // Update - READ-ONLY; The ImmutabilityPolicy update type of a blob container, possible values include: put, lock and extend. Possible values include: 'Put', 'Lock', 'Extend' 1422 Update ImmutabilityPolicyUpdateType `json:"update,omitempty"` 1423 // ImmutabilityPeriodSinceCreationInDays - READ-ONLY; The immutability period for the blobs in the container since the policy creation, in days. 1424 ImmutabilityPeriodSinceCreationInDays *int32 `json:"immutabilityPeriodSinceCreationInDays,omitempty"` 1425 // Timestamp - READ-ONLY; Returns the date and time the ImmutabilityPolicy was updated. 1426 Timestamp *date.Time `json:"timestamp,omitempty"` 1427 // ObjectIdentifier - READ-ONLY; Returns the Object ID of the user who updated the ImmutabilityPolicy. 1428 ObjectIdentifier *string `json:"objectIdentifier,omitempty"` 1429 // TenantID - READ-ONLY; Returns the Tenant ID that issued the token for the user who updated the ImmutabilityPolicy. 1430 TenantID *string `json:"tenantId,omitempty"` 1431 // Upn - READ-ONLY; Returns the User Principal Name of the user who updated the ImmutabilityPolicy. 1432 Upn *string `json:"upn,omitempty"` 1433} 1434 1435// Usage describes Storage Resource Usage. 1436type Usage struct { 1437 // Unit - READ-ONLY; Gets the unit of measurement. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountsPerSecond', 'BytesPerSecond' 1438 Unit UsageUnit `json:"unit,omitempty"` 1439 // CurrentValue - READ-ONLY; Gets the current count of the allocated resources in the subscription. 1440 CurrentValue *int32 `json:"currentValue,omitempty"` 1441 // Limit - READ-ONLY; Gets the maximum count of the resources that can be allocated in the subscription. 1442 Limit *int32 `json:"limit,omitempty"` 1443 // Name - READ-ONLY; Gets the name of the type of usage. 1444 Name *UsageName `json:"name,omitempty"` 1445} 1446 1447// UsageListResult the response from the List Usages operation. 1448type UsageListResult struct { 1449 autorest.Response `json:"-"` 1450 // Value - Gets or sets the list of Storage Resource Usages. 1451 Value *[]Usage `json:"value,omitempty"` 1452} 1453 1454// UsageName the usage names that can be used; currently limited to StorageAccount. 1455type UsageName struct { 1456 // Value - READ-ONLY; Gets a string describing the resource name. 1457 Value *string `json:"value,omitempty"` 1458 // LocalizedValue - READ-ONLY; Gets a localized string describing the resource name. 1459 LocalizedValue *string `json:"localizedValue,omitempty"` 1460} 1461 1462// VirtualNetworkRule virtual Network rule. 1463type VirtualNetworkRule struct { 1464 // VirtualNetworkResourceID - Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. 1465 VirtualNetworkResourceID *string `json:"id,omitempty"` 1466 // Action - The action of virtual network rule. Possible values include: 'Allow' 1467 Action Action `json:"action,omitempty"` 1468 // State - Gets the state of virtual network rule. Possible values include: 'StateProvisioning', 'StateDeprovisioning', 'StateSucceeded', 'StateFailed', 'StateNetworkSourceDeleted' 1469 State State `json:"state,omitempty"` 1470} 1471