...

Source file src/github.com/Azure/azure-sdk-for-go/services/azureadexternalidentities/mgmt/2021-04-01/azureadexternalidentities/models.go

Documentation: github.com/Azure/azure-sdk-for-go/services/azureadexternalidentities/mgmt/2021-04-01/azureadexternalidentities

     1  package azureadexternalidentities
     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  	"context"
    11  	"encoding/json"
    12  	"github.com/Azure/go-autorest/autorest"
    13  	"github.com/Azure/go-autorest/autorest/azure"
    14  	"github.com/Azure/go-autorest/autorest/date"
    15  	"net/http"
    16  )
    17  
    18  // The package's fully qualified name.
    19  const fqdn = "github.com/Azure/azure-sdk-for-go/services/azureadexternalidentities/mgmt/2021-04-01/azureadexternalidentities"
    20  
    21  // AvailableOperations available operations of the service
    22  type AvailableOperations struct {
    23  	autorest.Response `json:"-"`
    24  	// Value - Collection of available operation details
    25  	Value *[]OperationDetail `json:"value,omitempty"`
    26  	// NextLink - URL client should use to fetch the next page (per server side paging).
    27  	// It's null for now, added for future use.
    28  	NextLink *string `json:"nextLink,omitempty"`
    29  }
    30  
    31  // B2CResourceSKU SKU properties of the Azure AD B2C tenant. Learn more about Azure AD B2C billing at
    32  // [aka.ms/b2cBilling](https://aka.ms/b2cBilling).
    33  type B2CResourceSKU struct {
    34  	// Name - The name of the SKU for the tenant. Possible values include: 'B2CResourceSKUNameStandard', 'B2CResourceSKUNamePremiumP1', 'B2CResourceSKUNamePremiumP2'
    35  	Name B2CResourceSKUName `json:"name,omitempty"`
    36  	// Tier - The tier of the tenant. Possible values include: 'B2CResourceSKUTierA0'
    37  	Tier B2CResourceSKUTier `json:"tier,omitempty"`
    38  }
    39  
    40  // B2CTenantResource ...
    41  type B2CTenantResource struct {
    42  	autorest.Response `json:"-"`
    43  	// Type - READ-ONLY; The type of the B2C tenant resource. Possible values include: 'TypeValueMicrosoftAzureActiveDirectoryb2cDirectories'
    44  	Type TypeValue       `json:"type,omitempty"`
    45  	Sku  *B2CResourceSKU `json:"sku,omitempty"`
    46  	// B2CTenantResourceProperties - The Azure AD B2C tenant resource properties
    47  	*B2CTenantResourceProperties `json:"properties,omitempty"`
    48  	// ID - READ-ONLY; An identifier that represents the Azure AD B2C tenant resource.
    49  	ID *string `json:"id,omitempty"`
    50  	// Name - READ-ONLY; The name of the Azure AD B2C tenant resource.
    51  	Name *string `json:"name,omitempty"`
    52  	// Location - The location in which the resource is hosted and data resides. Can be one of 'United States', 'Europe', 'Asia Pacific', or 'Australia'. Refer to [this documentation](https://aka.ms/B2CDataResidency) for more information.
    53  	Location *string `json:"location,omitempty"`
    54  	// Tags - Resource Tags
    55  	Tags map[string]*string `json:"tags"`
    56  	// SystemData - READ-ONLY
    57  	SystemData *SystemData `json:"systemData,omitempty"`
    58  }
    59  
    60  // MarshalJSON is the custom marshaler for B2CTenantResource.
    61  func (btr B2CTenantResource) MarshalJSON() ([]byte, error) {
    62  	objectMap := make(map[string]interface{})
    63  	if btr.Sku != nil {
    64  		objectMap["sku"] = btr.Sku
    65  	}
    66  	if btr.B2CTenantResourceProperties != nil {
    67  		objectMap["properties"] = btr.B2CTenantResourceProperties
    68  	}
    69  	if btr.Location != nil {
    70  		objectMap["location"] = btr.Location
    71  	}
    72  	if btr.Tags != nil {
    73  		objectMap["tags"] = btr.Tags
    74  	}
    75  	return json.Marshal(objectMap)
    76  }
    77  
    78  // UnmarshalJSON is the custom unmarshaler for B2CTenantResource struct.
    79  func (btr *B2CTenantResource) UnmarshalJSON(body []byte) error {
    80  	var m map[string]*json.RawMessage
    81  	err := json.Unmarshal(body, &m)
    82  	if err != nil {
    83  		return err
    84  	}
    85  	for k, v := range m {
    86  		switch k {
    87  		case "type":
    88  			if v != nil {
    89  				var typeVar TypeValue
    90  				err = json.Unmarshal(*v, &typeVar)
    91  				if err != nil {
    92  					return err
    93  				}
    94  				btr.Type = typeVar
    95  			}
    96  		case "sku":
    97  			if v != nil {
    98  				var sku B2CResourceSKU
    99  				err = json.Unmarshal(*v, &sku)
   100  				if err != nil {
   101  					return err
   102  				}
   103  				btr.Sku = &sku
   104  			}
   105  		case "properties":
   106  			if v != nil {
   107  				var b2CTenantResourceProperties B2CTenantResourceProperties
   108  				err = json.Unmarshal(*v, &b2CTenantResourceProperties)
   109  				if err != nil {
   110  					return err
   111  				}
   112  				btr.B2CTenantResourceProperties = &b2CTenantResourceProperties
   113  			}
   114  		case "id":
   115  			if v != nil {
   116  				var ID string
   117  				err = json.Unmarshal(*v, &ID)
   118  				if err != nil {
   119  					return err
   120  				}
   121  				btr.ID = &ID
   122  			}
   123  		case "name":
   124  			if v != nil {
   125  				var name string
   126  				err = json.Unmarshal(*v, &name)
   127  				if err != nil {
   128  					return err
   129  				}
   130  				btr.Name = &name
   131  			}
   132  		case "location":
   133  			if v != nil {
   134  				var location string
   135  				err = json.Unmarshal(*v, &location)
   136  				if err != nil {
   137  					return err
   138  				}
   139  				btr.Location = &location
   140  			}
   141  		case "tags":
   142  			if v != nil {
   143  				var tags map[string]*string
   144  				err = json.Unmarshal(*v, &tags)
   145  				if err != nil {
   146  					return err
   147  				}
   148  				btr.Tags = tags
   149  			}
   150  		case "systemData":
   151  			if v != nil {
   152  				var systemData SystemData
   153  				err = json.Unmarshal(*v, &systemData)
   154  				if err != nil {
   155  					return err
   156  				}
   157  				btr.SystemData = &systemData
   158  			}
   159  		}
   160  	}
   161  
   162  	return nil
   163  }
   164  
   165  // B2CTenantResourceList the collection of Azure AD B2C tenant resources
   166  type B2CTenantResourceList struct {
   167  	autorest.Response `json:"-"`
   168  	// Value - READ-ONLY; List of Azure AD B2C tenant resources
   169  	Value *[]B2CTenantResource `json:"value,omitempty"`
   170  }
   171  
   172  // MarshalJSON is the custom marshaler for B2CTenantResourceList.
   173  func (btrl B2CTenantResourceList) MarshalJSON() ([]byte, error) {
   174  	objectMap := make(map[string]interface{})
   175  	return json.Marshal(objectMap)
   176  }
   177  
   178  // B2CTenantResourceProperties properties of the Azure AD B2C tenant Azure resource.
   179  type B2CTenantResourceProperties struct {
   180  	// BillingConfig - The billing configuration for the tenant.
   181  	BillingConfig *B2CTenantResourcePropertiesBillingConfig `json:"billingConfig,omitempty"`
   182  	// TenantID - An identifier of the Azure AD B2C tenant.
   183  	TenantID *string `json:"tenantId,omitempty"`
   184  }
   185  
   186  // B2CTenantResourcePropertiesBillingConfig the billing configuration for the tenant.
   187  type B2CTenantResourcePropertiesBillingConfig struct {
   188  	// BillingType - The type of billing. Will be MAU for all new customers. If 'Auths', it can be updated to 'MAU'. Cannot be changed if value is 'MAU'. Learn more about Azure AD B2C billing at [aka.ms/b2cBilling](https://aka.ms/b2cbilling). Possible values include: 'BillingTypeMAU', 'BillingTypeAuths'
   189  	BillingType BillingType `json:"billingType,omitempty"`
   190  	// EffectiveStartDateUtc - READ-ONLY; The data from which the billing type took effect
   191  	EffectiveStartDateUtc *string `json:"effectiveStartDateUtc,omitempty"`
   192  }
   193  
   194  // MarshalJSON is the custom marshaler for B2CTenantResourcePropertiesBillingConfig.
   195  func (btrpC B2CTenantResourcePropertiesBillingConfig) MarshalJSON() ([]byte, error) {
   196  	objectMap := make(map[string]interface{})
   197  	if btrpC.BillingType != "" {
   198  		objectMap["billingType"] = btrpC.BillingType
   199  	}
   200  	return json.Marshal(objectMap)
   201  }
   202  
   203  // B2CTenantsCreateFuture an abstraction for monitoring and retrieving the results of a long-running
   204  // operation.
   205  type B2CTenantsCreateFuture struct {
   206  	azure.FutureAPI
   207  	// Result returns the result of the asynchronous operation.
   208  	// If the operation has not completed it will return an error.
   209  	Result func(B2CTenantsClient) (B2CTenantResource, error)
   210  }
   211  
   212  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   213  func (future *B2CTenantsCreateFuture) UnmarshalJSON(body []byte) error {
   214  	var azFuture azure.Future
   215  	if err := json.Unmarshal(body, &azFuture); err != nil {
   216  		return err
   217  	}
   218  	future.FutureAPI = &azFuture
   219  	future.Result = future.result
   220  	return nil
   221  }
   222  
   223  // result is the default implementation for B2CTenantsCreateFuture.Result.
   224  func (future *B2CTenantsCreateFuture) result(client B2CTenantsClient) (btr B2CTenantResource, err error) {
   225  	var done bool
   226  	done, err = future.DoneWithContext(context.Background(), client)
   227  	if err != nil {
   228  		err = autorest.NewErrorWithError(err, "azureadexternalidentities.B2CTenantsCreateFuture", "Result", future.Response(), "Polling failure")
   229  		return
   230  	}
   231  	if !done {
   232  		btr.Response.Response = future.Response()
   233  		err = azure.NewAsyncOpIncompleteError("azureadexternalidentities.B2CTenantsCreateFuture")
   234  		return
   235  	}
   236  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   237  	if btr.Response.Response, err = future.GetResult(sender); err == nil && btr.Response.Response.StatusCode != http.StatusNoContent {
   238  		btr, err = client.CreateResponder(btr.Response.Response)
   239  		if err != nil {
   240  			err = autorest.NewErrorWithError(err, "azureadexternalidentities.B2CTenantsCreateFuture", "Result", btr.Response.Response, "Failure responding to request")
   241  		}
   242  	}
   243  	return
   244  }
   245  
   246  // B2CTenantsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
   247  // operation.
   248  type B2CTenantsDeleteFuture struct {
   249  	azure.FutureAPI
   250  	// Result returns the result of the asynchronous operation.
   251  	// If the operation has not completed it will return an error.
   252  	Result func(B2CTenantsClient) (autorest.Response, error)
   253  }
   254  
   255  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   256  func (future *B2CTenantsDeleteFuture) UnmarshalJSON(body []byte) error {
   257  	var azFuture azure.Future
   258  	if err := json.Unmarshal(body, &azFuture); err != nil {
   259  		return err
   260  	}
   261  	future.FutureAPI = &azFuture
   262  	future.Result = future.result
   263  	return nil
   264  }
   265  
   266  // result is the default implementation for B2CTenantsDeleteFuture.Result.
   267  func (future *B2CTenantsDeleteFuture) result(client B2CTenantsClient) (ar autorest.Response, err error) {
   268  	var done bool
   269  	done, err = future.DoneWithContext(context.Background(), client)
   270  	if err != nil {
   271  		err = autorest.NewErrorWithError(err, "azureadexternalidentities.B2CTenantsDeleteFuture", "Result", future.Response(), "Polling failure")
   272  		return
   273  	}
   274  	if !done {
   275  		ar.Response = future.Response()
   276  		err = azure.NewAsyncOpIncompleteError("azureadexternalidentities.B2CTenantsDeleteFuture")
   277  		return
   278  	}
   279  	ar.Response = future.Response()
   280  	return
   281  }
   282  
   283  // B2CTenantUpdateRequest the request body to update the Azure AD B2C tenant resource.
   284  type B2CTenantUpdateRequest struct {
   285  	Sku *B2CResourceSKU `json:"sku,omitempty"`
   286  	// B2CTenantResourceProperties - The Azure AD B2C tenant resource properties.
   287  	*B2CTenantResourceProperties `json:"properties,omitempty"`
   288  	// Tags - Resource Tags
   289  	Tags map[string]*string `json:"tags"`
   290  }
   291  
   292  // MarshalJSON is the custom marshaler for B2CTenantUpdateRequest.
   293  func (btur B2CTenantUpdateRequest) MarshalJSON() ([]byte, error) {
   294  	objectMap := make(map[string]interface{})
   295  	if btur.Sku != nil {
   296  		objectMap["sku"] = btur.Sku
   297  	}
   298  	if btur.B2CTenantResourceProperties != nil {
   299  		objectMap["properties"] = btur.B2CTenantResourceProperties
   300  	}
   301  	if btur.Tags != nil {
   302  		objectMap["tags"] = btur.Tags
   303  	}
   304  	return json.Marshal(objectMap)
   305  }
   306  
   307  // UnmarshalJSON is the custom unmarshaler for B2CTenantUpdateRequest struct.
   308  func (btur *B2CTenantUpdateRequest) UnmarshalJSON(body []byte) error {
   309  	var m map[string]*json.RawMessage
   310  	err := json.Unmarshal(body, &m)
   311  	if err != nil {
   312  		return err
   313  	}
   314  	for k, v := range m {
   315  		switch k {
   316  		case "sku":
   317  			if v != nil {
   318  				var sku B2CResourceSKU
   319  				err = json.Unmarshal(*v, &sku)
   320  				if err != nil {
   321  					return err
   322  				}
   323  				btur.Sku = &sku
   324  			}
   325  		case "properties":
   326  			if v != nil {
   327  				var b2CTenantResourceProperties B2CTenantResourceProperties
   328  				err = json.Unmarshal(*v, &b2CTenantResourceProperties)
   329  				if err != nil {
   330  					return err
   331  				}
   332  				btur.B2CTenantResourceProperties = &b2CTenantResourceProperties
   333  			}
   334  		case "tags":
   335  			if v != nil {
   336  				var tags map[string]*string
   337  				err = json.Unmarshal(*v, &tags)
   338  				if err != nil {
   339  					return err
   340  				}
   341  				btur.Tags = tags
   342  			}
   343  		}
   344  	}
   345  
   346  	return nil
   347  }
   348  
   349  // CheckNameAvailabilityRequestBody the information required to check the availability of the name for the
   350  // tenant.
   351  type CheckNameAvailabilityRequestBody struct {
   352  	// Name - The domain name to check for availability.
   353  	Name        *string `json:"name,omitempty"`
   354  	CountryCode *string `json:"countryCode,omitempty"`
   355  }
   356  
   357  // CloudError an error response for a resource management request.
   358  type CloudError struct {
   359  	Error *ErrorResponse `json:"error,omitempty"`
   360  }
   361  
   362  // CreateTenantProperties these properties are used to create the Azure AD B2C tenant. These properties are
   363  // not part of the Azure resource.
   364  type CreateTenantProperties struct {
   365  	// DisplayName - The display name of the Azure AD B2C tenant.
   366  	DisplayName *string `json:"displayName,omitempty"`
   367  	CountryCode *string `json:"countryCode,omitempty"`
   368  }
   369  
   370  // CreateTenantRequestBody the information needed to create the Azure AD B2C tenant and corresponding Azure
   371  // resource, which is used for billing purposes.
   372  type CreateTenantRequestBody struct {
   373  	// Location - The location in which the resource is hosted and data resides. Can be one of 'United States', 'Europe', 'Asia Pacific', or 'Australia'. Refer to [this documentation](https://aka.ms/B2CDataResidency) for more information.
   374  	Location                           *string `json:"location,omitempty"`
   375  	*CreateTenantRequestBodyProperties `json:"properties,omitempty"`
   376  	Sku                                *B2CResourceSKU `json:"sku,omitempty"`
   377  	// Tags - Resource Tags
   378  	Tags map[string]*string `json:"tags"`
   379  }
   380  
   381  // MarshalJSON is the custom marshaler for CreateTenantRequestBody.
   382  func (ctrb CreateTenantRequestBody) MarshalJSON() ([]byte, error) {
   383  	objectMap := make(map[string]interface{})
   384  	if ctrb.Location != nil {
   385  		objectMap["location"] = ctrb.Location
   386  	}
   387  	if ctrb.CreateTenantRequestBodyProperties != nil {
   388  		objectMap["properties"] = ctrb.CreateTenantRequestBodyProperties
   389  	}
   390  	if ctrb.Sku != nil {
   391  		objectMap["sku"] = ctrb.Sku
   392  	}
   393  	if ctrb.Tags != nil {
   394  		objectMap["tags"] = ctrb.Tags
   395  	}
   396  	return json.Marshal(objectMap)
   397  }
   398  
   399  // UnmarshalJSON is the custom unmarshaler for CreateTenantRequestBody struct.
   400  func (ctrb *CreateTenantRequestBody) UnmarshalJSON(body []byte) error {
   401  	var m map[string]*json.RawMessage
   402  	err := json.Unmarshal(body, &m)
   403  	if err != nil {
   404  		return err
   405  	}
   406  	for k, v := range m {
   407  		switch k {
   408  		case "location":
   409  			if v != nil {
   410  				var location string
   411  				err = json.Unmarshal(*v, &location)
   412  				if err != nil {
   413  					return err
   414  				}
   415  				ctrb.Location = &location
   416  			}
   417  		case "properties":
   418  			if v != nil {
   419  				var createTenantRequestBodyProperties CreateTenantRequestBodyProperties
   420  				err = json.Unmarshal(*v, &createTenantRequestBodyProperties)
   421  				if err != nil {
   422  					return err
   423  				}
   424  				ctrb.CreateTenantRequestBodyProperties = &createTenantRequestBodyProperties
   425  			}
   426  		case "sku":
   427  			if v != nil {
   428  				var sku B2CResourceSKU
   429  				err = json.Unmarshal(*v, &sku)
   430  				if err != nil {
   431  					return err
   432  				}
   433  				ctrb.Sku = &sku
   434  			}
   435  		case "tags":
   436  			if v != nil {
   437  				var tags map[string]*string
   438  				err = json.Unmarshal(*v, &tags)
   439  				if err != nil {
   440  					return err
   441  				}
   442  				ctrb.Tags = tags
   443  			}
   444  		}
   445  	}
   446  
   447  	return nil
   448  }
   449  
   450  // CreateTenantRequestBodyProperties ...
   451  type CreateTenantRequestBodyProperties struct {
   452  	*CreateTenantProperties `json:"createTenantProperties,omitempty"`
   453  }
   454  
   455  // MarshalJSON is the custom marshaler for CreateTenantRequestBodyProperties.
   456  func (ctrb CreateTenantRequestBodyProperties) MarshalJSON() ([]byte, error) {
   457  	objectMap := make(map[string]interface{})
   458  	if ctrb.CreateTenantProperties != nil {
   459  		objectMap["createTenantProperties"] = ctrb.CreateTenantProperties
   460  	}
   461  	return json.Marshal(objectMap)
   462  }
   463  
   464  // UnmarshalJSON is the custom unmarshaler for CreateTenantRequestBodyProperties struct.
   465  func (ctrb *CreateTenantRequestBodyProperties) UnmarshalJSON(body []byte) error {
   466  	var m map[string]*json.RawMessage
   467  	err := json.Unmarshal(body, &m)
   468  	if err != nil {
   469  		return err
   470  	}
   471  	for k, v := range m {
   472  		switch k {
   473  		case "createTenantProperties":
   474  			if v != nil {
   475  				var createTenantProperties CreateTenantProperties
   476  				err = json.Unmarshal(*v, &createTenantProperties)
   477  				if err != nil {
   478  					return err
   479  				}
   480  				ctrb.CreateTenantProperties = &createTenantProperties
   481  			}
   482  		}
   483  	}
   484  
   485  	return nil
   486  }
   487  
   488  // ErrorAdditionalInfo the resource management error additional info.
   489  type ErrorAdditionalInfo struct {
   490  	// Type - READ-ONLY; The additional info type.
   491  	Type *string `json:"type,omitempty"`
   492  	// Info - READ-ONLY; The additional info.
   493  	Info interface{} `json:"info,omitempty"`
   494  }
   495  
   496  // MarshalJSON is the custom marshaler for ErrorAdditionalInfo.
   497  func (eai ErrorAdditionalInfo) MarshalJSON() ([]byte, error) {
   498  	objectMap := make(map[string]interface{})
   499  	return json.Marshal(objectMap)
   500  }
   501  
   502  // ErrorResponse common error response for all Azure Resource Manager APIs to return error details for
   503  // failed operations. (This also follows the OData error response format.)
   504  type ErrorResponse struct {
   505  	// Code - READ-ONLY; The error code.
   506  	Code *string `json:"code,omitempty"`
   507  	// Message - READ-ONLY; The error message.
   508  	Message *string `json:"message,omitempty"`
   509  	// Target - READ-ONLY; The error target.
   510  	Target *string `json:"target,omitempty"`
   511  	// Details - READ-ONLY; The error details.
   512  	Details *[]ErrorResponse `json:"details,omitempty"`
   513  	// AdditionalInfo - READ-ONLY; The error additional info.
   514  	AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"`
   515  }
   516  
   517  // MarshalJSON is the custom marshaler for ErrorResponse.
   518  func (er ErrorResponse) MarshalJSON() ([]byte, error) {
   519  	objectMap := make(map[string]interface{})
   520  	return json.Marshal(objectMap)
   521  }
   522  
   523  // GuestUsagesResource guest Usages Resource
   524  type GuestUsagesResource struct {
   525  	autorest.Response `json:"-"`
   526  	// ID - READ-ONLY; An identifier that represents the Guest Usages resource.
   527  	ID *string `json:"id,omitempty"`
   528  	// Name - READ-ONLY; The name of the Guest Usages resource.
   529  	Name *string `json:"name,omitempty"`
   530  	// Type - READ-ONLY; The type of the Guest Usages resource.
   531  	Type *string `json:"type,omitempty"`
   532  	// Location - Location of the Guest Usages resource.
   533  	Location *string `json:"location,omitempty"`
   534  	// Tags - Key-value pairs of additional resource provisioning properties.
   535  	Tags map[string]*string `json:"tags"`
   536  	// GuestUsagesResourceProperties - The Guest Usages Resource Properties
   537  	*GuestUsagesResourceProperties `json:"properties,omitempty"`
   538  	// SystemData - READ-ONLY
   539  	SystemData *SystemData `json:"systemData,omitempty"`
   540  }
   541  
   542  // MarshalJSON is the custom marshaler for GuestUsagesResource.
   543  func (gur GuestUsagesResource) MarshalJSON() ([]byte, error) {
   544  	objectMap := make(map[string]interface{})
   545  	if gur.Location != nil {
   546  		objectMap["location"] = gur.Location
   547  	}
   548  	if gur.Tags != nil {
   549  		objectMap["tags"] = gur.Tags
   550  	}
   551  	if gur.GuestUsagesResourceProperties != nil {
   552  		objectMap["properties"] = gur.GuestUsagesResourceProperties
   553  	}
   554  	return json.Marshal(objectMap)
   555  }
   556  
   557  // UnmarshalJSON is the custom unmarshaler for GuestUsagesResource struct.
   558  func (gur *GuestUsagesResource) UnmarshalJSON(body []byte) error {
   559  	var m map[string]*json.RawMessage
   560  	err := json.Unmarshal(body, &m)
   561  	if err != nil {
   562  		return err
   563  	}
   564  	for k, v := range m {
   565  		switch k {
   566  		case "id":
   567  			if v != nil {
   568  				var ID string
   569  				err = json.Unmarshal(*v, &ID)
   570  				if err != nil {
   571  					return err
   572  				}
   573  				gur.ID = &ID
   574  			}
   575  		case "name":
   576  			if v != nil {
   577  				var name string
   578  				err = json.Unmarshal(*v, &name)
   579  				if err != nil {
   580  					return err
   581  				}
   582  				gur.Name = &name
   583  			}
   584  		case "type":
   585  			if v != nil {
   586  				var typeVar string
   587  				err = json.Unmarshal(*v, &typeVar)
   588  				if err != nil {
   589  					return err
   590  				}
   591  				gur.Type = &typeVar
   592  			}
   593  		case "location":
   594  			if v != nil {
   595  				var location string
   596  				err = json.Unmarshal(*v, &location)
   597  				if err != nil {
   598  					return err
   599  				}
   600  				gur.Location = &location
   601  			}
   602  		case "tags":
   603  			if v != nil {
   604  				var tags map[string]*string
   605  				err = json.Unmarshal(*v, &tags)
   606  				if err != nil {
   607  					return err
   608  				}
   609  				gur.Tags = tags
   610  			}
   611  		case "properties":
   612  			if v != nil {
   613  				var guestUsagesResourceProperties GuestUsagesResourceProperties
   614  				err = json.Unmarshal(*v, &guestUsagesResourceProperties)
   615  				if err != nil {
   616  					return err
   617  				}
   618  				gur.GuestUsagesResourceProperties = &guestUsagesResourceProperties
   619  			}
   620  		case "systemData":
   621  			if v != nil {
   622  				var systemData SystemData
   623  				err = json.Unmarshal(*v, &systemData)
   624  				if err != nil {
   625  					return err
   626  				}
   627  				gur.SystemData = &systemData
   628  			}
   629  		}
   630  	}
   631  
   632  	return nil
   633  }
   634  
   635  // GuestUsagesResourceList the collection of guest usages resources
   636  type GuestUsagesResourceList struct {
   637  	autorest.Response `json:"-"`
   638  	// Value - READ-ONLY; List of guest usages resources
   639  	Value *[]GuestUsagesResource `json:"value,omitempty"`
   640  }
   641  
   642  // MarshalJSON is the custom marshaler for GuestUsagesResourceList.
   643  func (gurl GuestUsagesResourceList) MarshalJSON() ([]byte, error) {
   644  	objectMap := make(map[string]interface{})
   645  	return json.Marshal(objectMap)
   646  }
   647  
   648  // GuestUsagesResourcePatch guest Usages Resource for Patch
   649  type GuestUsagesResourcePatch struct {
   650  	// Tags - Key-value pairs of additional resource provisioning properties.
   651  	Tags map[string]*string `json:"tags"`
   652  }
   653  
   654  // MarshalJSON is the custom marshaler for GuestUsagesResourcePatch.
   655  func (gurp GuestUsagesResourcePatch) MarshalJSON() ([]byte, error) {
   656  	objectMap := make(map[string]interface{})
   657  	if gurp.Tags != nil {
   658  		objectMap["tags"] = gurp.Tags
   659  	}
   660  	return json.Marshal(objectMap)
   661  }
   662  
   663  // GuestUsagesResourceProperties guest Usages Resource Properties
   664  type GuestUsagesResourceProperties struct {
   665  	// TenantID - An identifier for the tenant for which the resource is being created
   666  	TenantID *string `json:"tenantId,omitempty"`
   667  }
   668  
   669  // NameAvailabilityResponse response of the CheckNameAvailability operation.
   670  type NameAvailabilityResponse struct {
   671  	autorest.Response `json:"-"`
   672  	// Message - Description of the reason if name is not available.
   673  	Message *string `json:"message,omitempty"`
   674  	// NameAvailable - True if the name is available and can be used to create a new tenant. Otherwise false.
   675  	NameAvailable *bool `json:"nameAvailable,omitempty"`
   676  	// Reason - Possible values include: 'NameAvailabilityReasonTypeAlreadyExists', 'NameAvailabilityReasonTypeInvalid'
   677  	Reason NameAvailabilityReasonType `json:"reason,omitempty"`
   678  }
   679  
   680  // OperationDetail operation detail payload
   681  type OperationDetail struct {
   682  	// Name - Name of the operation
   683  	Name *string `json:"name,omitempty"`
   684  	// IsDataAction - Indicates whether the operation is a data action
   685  	IsDataAction *bool `json:"isDataAction,omitempty"`
   686  	// Display - Display of the operation
   687  	Display *OperationDisplay `json:"display,omitempty"`
   688  	// Origin - Origin of the operation
   689  	Origin *string `json:"origin,omitempty"`
   690  }
   691  
   692  // OperationDisplay operation display payload
   693  type OperationDisplay struct {
   694  	// Provider - Resource provider of the operation
   695  	Provider *string `json:"provider,omitempty"`
   696  	// Resource - Resource of the operation
   697  	Resource *string `json:"resource,omitempty"`
   698  	// Operation - Localized friendly name for the operation
   699  	Operation *string `json:"operation,omitempty"`
   700  	// Description - Localized friendly description for the operation
   701  	Description *string `json:"description,omitempty"`
   702  }
   703  
   704  // SystemData metadata pertaining to creation and last modification of the resource.
   705  type SystemData struct {
   706  	// CreatedBy - The identity that created the resource.
   707  	CreatedBy *string `json:"createdBy,omitempty"`
   708  	// CreatedByType - The type of identity that created the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey'
   709  	CreatedByType CreatedByType `json:"createdByType,omitempty"`
   710  	// CreatedAt - The timestamp of resource creation (UTC).
   711  	CreatedAt *date.Time `json:"createdAt,omitempty"`
   712  	// LastModifiedBy - The identity that last modified the resource.
   713  	LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
   714  	// LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey'
   715  	LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"`
   716  	// LastModifiedAt - The timestamp of resource last modification (UTC)
   717  	LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"`
   718  }
   719  

View as plain text