1package apimanagement 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 9import ( 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 "github.com/Azure/go-autorest/autorest/to" 16 "github.com/Azure/go-autorest/tracing" 17 "net/http" 18) 19 20// The package's fully qualified name. 21const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/apimanagement/ctrl/2017-03-01/apimanagement" 22 23// AccessInformationContract tenant access information contract of the API Management service. 24type AccessInformationContract struct { 25 autorest.Response `json:"-"` 26 // ID - Identifier. 27 ID *string `json:"id,omitempty"` 28 // PrimaryKey - Primary access key. 29 PrimaryKey *string `json:"primaryKey,omitempty"` 30 // SecondaryKey - Secondary access key. 31 SecondaryKey *string `json:"secondaryKey,omitempty"` 32 // Enabled - Tenant access information of the API Management service. 33 Enabled *bool `json:"enabled,omitempty"` 34} 35 36// AccessInformationUpdateParameters tenant access information update parameters of the API Management 37// service. 38type AccessInformationUpdateParameters struct { 39 // Enabled - Tenant access information of the API Management service. 40 Enabled *bool `json:"enabled,omitempty"` 41} 42 43// APICollection paged Api list representation. 44type APICollection struct { 45 autorest.Response `json:"-"` 46 Value *[]APIContract `json:"value,omitempty"` 47 // Count - Total number of entities 48 Count *int32 `json:"count,omitempty"` 49 // NextLink - Next page link if any. 50 NextLink *string `json:"nextLink,omitempty"` 51} 52 53// APICollectionIterator provides access to a complete listing of APIContract values. 54type APICollectionIterator struct { 55 i int 56 page APICollectionPage 57} 58 59// NextWithContext advances to the next value. If there was an error making 60// the request the iterator does not advance and the error is returned. 61func (iter *APICollectionIterator) NextWithContext(ctx context.Context) (err error) { 62 if tracing.IsEnabled() { 63 ctx = tracing.StartSpan(ctx, fqdn+"/APICollectionIterator.NextWithContext") 64 defer func() { 65 sc := -1 66 if iter.Response().Response.Response != nil { 67 sc = iter.Response().Response.Response.StatusCode 68 } 69 tracing.EndSpan(ctx, sc, err) 70 }() 71 } 72 iter.i++ 73 if iter.i < len(iter.page.Values()) { 74 return nil 75 } 76 err = iter.page.NextWithContext(ctx) 77 if err != nil { 78 iter.i-- 79 return err 80 } 81 iter.i = 0 82 return nil 83} 84 85// Next advances to the next value. If there was an error making 86// the request the iterator does not advance and the error is returned. 87// Deprecated: Use NextWithContext() instead. 88func (iter *APICollectionIterator) Next() error { 89 return iter.NextWithContext(context.Background()) 90} 91 92// NotDone returns true if the enumeration should be started or is not yet complete. 93func (iter APICollectionIterator) NotDone() bool { 94 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 95} 96 97// Response returns the raw server response from the last page request. 98func (iter APICollectionIterator) Response() APICollection { 99 return iter.page.Response() 100} 101 102// Value returns the current value or a zero-initialized value if the 103// iterator has advanced beyond the end of the collection. 104func (iter APICollectionIterator) Value() APIContract { 105 if !iter.page.NotDone() { 106 return APIContract{} 107 } 108 return iter.page.Values()[iter.i] 109} 110 111// Creates a new instance of the APICollectionIterator type. 112func NewAPICollectionIterator(page APICollectionPage) APICollectionIterator { 113 return APICollectionIterator{page: page} 114} 115 116// IsEmpty returns true if the ListResult contains no values. 117func (ac APICollection) IsEmpty() bool { 118 return ac.Value == nil || len(*ac.Value) == 0 119} 120 121// hasNextLink returns true if the NextLink is not empty. 122func (ac APICollection) hasNextLink() bool { 123 return ac.NextLink != nil && len(*ac.NextLink) != 0 124} 125 126// aPICollectionPreparer prepares a request to retrieve the next set of results. 127// It returns nil if no more results exist. 128func (ac APICollection) aPICollectionPreparer(ctx context.Context) (*http.Request, error) { 129 if !ac.hasNextLink() { 130 return nil, nil 131 } 132 return autorest.Prepare((&http.Request{}).WithContext(ctx), 133 autorest.AsJSON(), 134 autorest.AsGet(), 135 autorest.WithBaseURL(to.String(ac.NextLink))) 136} 137 138// APICollectionPage contains a page of APIContract values. 139type APICollectionPage struct { 140 fn func(context.Context, APICollection) (APICollection, error) 141 ac APICollection 142} 143 144// NextWithContext advances to the next page of values. If there was an error making 145// the request the page does not advance and the error is returned. 146func (page *APICollectionPage) NextWithContext(ctx context.Context) (err error) { 147 if tracing.IsEnabled() { 148 ctx = tracing.StartSpan(ctx, fqdn+"/APICollectionPage.NextWithContext") 149 defer func() { 150 sc := -1 151 if page.Response().Response.Response != nil { 152 sc = page.Response().Response.Response.StatusCode 153 } 154 tracing.EndSpan(ctx, sc, err) 155 }() 156 } 157 for { 158 next, err := page.fn(ctx, page.ac) 159 if err != nil { 160 return err 161 } 162 page.ac = next 163 if !next.hasNextLink() || !next.IsEmpty() { 164 break 165 } 166 } 167 return nil 168} 169 170// Next advances to the next page of values. If there was an error making 171// the request the page does not advance and the error is returned. 172// Deprecated: Use NextWithContext() instead. 173func (page *APICollectionPage) Next() error { 174 return page.NextWithContext(context.Background()) 175} 176 177// NotDone returns true if the page enumeration should be started or is not yet complete. 178func (page APICollectionPage) NotDone() bool { 179 return !page.ac.IsEmpty() 180} 181 182// Response returns the raw server response from the last page request. 183func (page APICollectionPage) Response() APICollection { 184 return page.ac 185} 186 187// Values returns the slice of values for the current page or nil if there are no values. 188func (page APICollectionPage) Values() []APIContract { 189 if page.ac.IsEmpty() { 190 return nil 191 } 192 return *page.ac.Value 193} 194 195// Creates a new instance of the APICollectionPage type. 196func NewAPICollectionPage(cur APICollection, getNextPage func(context.Context, APICollection) (APICollection, error)) APICollectionPage { 197 return APICollectionPage{ 198 fn: getNextPage, 199 ac: cur, 200 } 201} 202 203// APIContract api Contract Details 204type APIContract struct { 205 autorest.Response `json:"-"` 206 // ID - Identifier of the Entity 207 ID *string `json:"id,omitempty"` 208 // Name - API name. 209 Name *string `json:"name,omitempty"` 210 // ServiceURL - Absolute URL of the backend service implementing this API. 211 ServiceURL *string `json:"serviceUrl,omitempty"` 212 // Path - Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this API. 213 Path *string `json:"path,omitempty"` 214 // Protocols - Describes on which protocols the operations in this API can be invoked. 215 Protocols *[]Protocol `json:"protocols,omitempty"` 216 // Description - Description of the API. May include HTML formatting tags. 217 Description *string `json:"description,omitempty"` 218 // AuthenticationSettings - Collection of authentication settings included into this API. 219 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 220 // SubscriptionKeyParameterNames - Protocols over which API is made available. 221 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 222 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 223 APIType APIType `json:"type,omitempty"` 224 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 225 APIRevision *string `json:"apiRevision,omitempty"` 226 // IsCurrent - Indicates if API revision is current api revision. 227 IsCurrent *bool `json:"isCurrent,omitempty"` 228 // IsOnline - Indicates if API revision is accessible via the gateway. 229 IsOnline *bool `json:"isOnline,omitempty"` 230} 231 232// APIContractProperties api Entity Properties 233type APIContractProperties struct { 234 // Name - API name. 235 Name *string `json:"name,omitempty"` 236 // ServiceURL - Absolute URL of the backend service implementing this API. 237 ServiceURL *string `json:"serviceUrl,omitempty"` 238 // Path - Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this API. 239 Path *string `json:"path,omitempty"` 240 // Protocols - Describes on which protocols the operations in this API can be invoked. 241 Protocols *[]Protocol `json:"protocols,omitempty"` 242 // Description - Description of the API. May include HTML formatting tags. 243 Description *string `json:"description,omitempty"` 244 // AuthenticationSettings - Collection of authentication settings included into this API. 245 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 246 // SubscriptionKeyParameterNames - Protocols over which API is made available. 247 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 248 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 249 APIType APIType `json:"type,omitempty"` 250 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 251 APIRevision *string `json:"apiRevision,omitempty"` 252 // IsCurrent - Indicates if API revision is current api revision. 253 IsCurrent *bool `json:"isCurrent,omitempty"` 254 // IsOnline - Indicates if API revision is accessible via the gateway. 255 IsOnline *bool `json:"isOnline,omitempty"` 256} 257 258// APICreateOrUpdateParameter api Create or Update Properties. 259type APICreateOrUpdateParameter struct { 260 // ID - Identifier of the entity 261 ID *string `json:"id,omitempty"` 262 // ContentValue - Content value when Importing an API. 263 ContentValue *string `json:"contentValue,omitempty"` 264 // ContentFormat - Format of the Content in which the API is getting imported. Possible values include: 'WadlXML', 'WadlLinkJSON', 'SwaggerJSON', 'SwaggerLinkJSON', 'Wsdl', 'WsdlLink' 265 ContentFormat ContentFormat `json:"contentFormat,omitempty"` 266 // WsdlSelector - Criteria to limit import of WSDL to a subset of the document. 267 WsdlSelector *APICreateOrUpdateParameterWsdlSelector `json:"wsdlSelector,omitempty"` 268 // Name - API name. 269 Name *string `json:"name,omitempty"` 270 // ServiceURL - Absolute URL of the backend service implementing this API. 271 ServiceURL *string `json:"serviceUrl,omitempty"` 272 // Path - Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this API. 273 Path *string `json:"path,omitempty"` 274 // Protocols - Describes on which protocols the operations in this API can be invoked. 275 Protocols *[]Protocol `json:"protocols,omitempty"` 276 // Description - Description of the API. May include HTML formatting tags. 277 Description *string `json:"description,omitempty"` 278 // AuthenticationSettings - Collection of authentication settings included into this API. 279 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 280 // SubscriptionKeyParameterNames - Protocols over which API is made available. 281 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 282 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 283 APIType APIType `json:"type,omitempty"` 284 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 285 APIRevision *string `json:"apiRevision,omitempty"` 286 // IsCurrent - Indicates if API revision is current api revision. 287 IsCurrent *bool `json:"isCurrent,omitempty"` 288 // IsOnline - Indicates if API revision is accessible via the gateway. 289 IsOnline *bool `json:"isOnline,omitempty"` 290} 291 292// APICreateOrUpdateParameterWsdlSelector criteria to limit import of WSDL to a subset of the document. 293type APICreateOrUpdateParameterWsdlSelector struct { 294 // WsdlServiceName - Name of service to import from WSDL 295 WsdlServiceName *string `json:"wsdlServiceName,omitempty"` 296 // WsdlEndpointName - Name of endpoint(port) to import from WSDL 297 WsdlEndpointName *string `json:"wsdlEndpointName,omitempty"` 298} 299 300// APIEntityBaseContract API base contract details. 301type APIEntityBaseContract struct { 302 // Description - Description of the API. May include HTML formatting tags. 303 Description *string `json:"description,omitempty"` 304 // AuthenticationSettings - Collection of authentication settings included into this API. 305 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 306 // SubscriptionKeyParameterNames - Protocols over which API is made available. 307 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 308 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 309 APIType APIType `json:"type,omitempty"` 310 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 311 APIRevision *string `json:"apiRevision,omitempty"` 312 // IsCurrent - Indicates if API revision is current api revision. 313 IsCurrent *bool `json:"isCurrent,omitempty"` 314 // IsOnline - Indicates if API revision is accessible via the gateway. 315 IsOnline *bool `json:"isOnline,omitempty"` 316} 317 318// APIExportResult API Export result Blob Uri. 319type APIExportResult struct { 320 autorest.Response `json:"-"` 321 // Link - Link to the Storage Blob containing the result of the export operation. The Blob Uri is only valid for 5 minutes. 322 Link *string `json:"link,omitempty"` 323} 324 325// APIUpdateContract API update contract properties. 326type APIUpdateContract struct { 327 // Name - API name. 328 Name *string `json:"name,omitempty"` 329 // ServiceURL - Absolute URL of the backend service implementing this API. 330 ServiceURL *string `json:"serviceUrl,omitempty"` 331 // Path - Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this API. 332 Path *string `json:"path,omitempty"` 333 // Protocols - Describes on which protocols the operations in this API can be invoked. 334 Protocols *[]Protocol `json:"protocols,omitempty"` 335 // Description - Description of the API. May include HTML formatting tags. 336 Description *string `json:"description,omitempty"` 337 // AuthenticationSettings - Collection of authentication settings included into this API. 338 AuthenticationSettings *AuthenticationSettingsContract `json:"authenticationSettings,omitempty"` 339 // SubscriptionKeyParameterNames - Protocols over which API is made available. 340 SubscriptionKeyParameterNames *SubscriptionKeyParameterNamesContract `json:"subscriptionKeyParameterNames,omitempty"` 341 // APIType - Type of API. Possible values include: 'HTTP', 'Soap' 342 APIType APIType `json:"type,omitempty"` 343 // APIRevision - Describes the Revision of the Api. If no value is provided, default revision 1 is created 344 APIRevision *string `json:"apiRevision,omitempty"` 345 // IsCurrent - Indicates if API revision is current api revision. 346 IsCurrent *bool `json:"isCurrent,omitempty"` 347 // IsOnline - Indicates if API revision is accessible via the gateway. 348 IsOnline *bool `json:"isOnline,omitempty"` 349} 350 351// AuthenticationSettingsContract API Authentication Settings. 352type AuthenticationSettingsContract struct { 353 // OAuth2 - OAuth2 Authentication settings 354 OAuth2 *OAuth2AuthenticationSettingsContract `json:"oAuth2,omitempty"` 355} 356 357// AuthorizationServerCollection paged OAuth2 Authorization Servers list representation. 358type AuthorizationServerCollection struct { 359 autorest.Response `json:"-"` 360 // Value - Page values. 361 Value *[]AuthorizationServerContract `json:"value,omitempty"` 362 // Count - Total record count number across all pages. 363 Count *int64 `json:"count,omitempty"` 364 // NextLink - Next page link if any. 365 NextLink *string `json:"nextLink,omitempty"` 366} 367 368// AuthorizationServerCollectionIterator provides access to a complete listing of 369// AuthorizationServerContract values. 370type AuthorizationServerCollectionIterator struct { 371 i int 372 page AuthorizationServerCollectionPage 373} 374 375// NextWithContext advances to the next value. If there was an error making 376// the request the iterator does not advance and the error is returned. 377func (iter *AuthorizationServerCollectionIterator) NextWithContext(ctx context.Context) (err error) { 378 if tracing.IsEnabled() { 379 ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationServerCollectionIterator.NextWithContext") 380 defer func() { 381 sc := -1 382 if iter.Response().Response.Response != nil { 383 sc = iter.Response().Response.Response.StatusCode 384 } 385 tracing.EndSpan(ctx, sc, err) 386 }() 387 } 388 iter.i++ 389 if iter.i < len(iter.page.Values()) { 390 return nil 391 } 392 err = iter.page.NextWithContext(ctx) 393 if err != nil { 394 iter.i-- 395 return err 396 } 397 iter.i = 0 398 return nil 399} 400 401// Next advances to the next value. If there was an error making 402// the request the iterator does not advance and the error is returned. 403// Deprecated: Use NextWithContext() instead. 404func (iter *AuthorizationServerCollectionIterator) Next() error { 405 return iter.NextWithContext(context.Background()) 406} 407 408// NotDone returns true if the enumeration should be started or is not yet complete. 409func (iter AuthorizationServerCollectionIterator) NotDone() bool { 410 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 411} 412 413// Response returns the raw server response from the last page request. 414func (iter AuthorizationServerCollectionIterator) Response() AuthorizationServerCollection { 415 return iter.page.Response() 416} 417 418// Value returns the current value or a zero-initialized value if the 419// iterator has advanced beyond the end of the collection. 420func (iter AuthorizationServerCollectionIterator) Value() AuthorizationServerContract { 421 if !iter.page.NotDone() { 422 return AuthorizationServerContract{} 423 } 424 return iter.page.Values()[iter.i] 425} 426 427// Creates a new instance of the AuthorizationServerCollectionIterator type. 428func NewAuthorizationServerCollectionIterator(page AuthorizationServerCollectionPage) AuthorizationServerCollectionIterator { 429 return AuthorizationServerCollectionIterator{page: page} 430} 431 432// IsEmpty returns true if the ListResult contains no values. 433func (asc AuthorizationServerCollection) IsEmpty() bool { 434 return asc.Value == nil || len(*asc.Value) == 0 435} 436 437// hasNextLink returns true if the NextLink is not empty. 438func (asc AuthorizationServerCollection) hasNextLink() bool { 439 return asc.NextLink != nil && len(*asc.NextLink) != 0 440} 441 442// authorizationServerCollectionPreparer prepares a request to retrieve the next set of results. 443// It returns nil if no more results exist. 444func (asc AuthorizationServerCollection) authorizationServerCollectionPreparer(ctx context.Context) (*http.Request, error) { 445 if !asc.hasNextLink() { 446 return nil, nil 447 } 448 return autorest.Prepare((&http.Request{}).WithContext(ctx), 449 autorest.AsJSON(), 450 autorest.AsGet(), 451 autorest.WithBaseURL(to.String(asc.NextLink))) 452} 453 454// AuthorizationServerCollectionPage contains a page of AuthorizationServerContract values. 455type AuthorizationServerCollectionPage struct { 456 fn func(context.Context, AuthorizationServerCollection) (AuthorizationServerCollection, error) 457 asc AuthorizationServerCollection 458} 459 460// NextWithContext advances to the next page of values. If there was an error making 461// the request the page does not advance and the error is returned. 462func (page *AuthorizationServerCollectionPage) NextWithContext(ctx context.Context) (err error) { 463 if tracing.IsEnabled() { 464 ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationServerCollectionPage.NextWithContext") 465 defer func() { 466 sc := -1 467 if page.Response().Response.Response != nil { 468 sc = page.Response().Response.Response.StatusCode 469 } 470 tracing.EndSpan(ctx, sc, err) 471 }() 472 } 473 for { 474 next, err := page.fn(ctx, page.asc) 475 if err != nil { 476 return err 477 } 478 page.asc = next 479 if !next.hasNextLink() || !next.IsEmpty() { 480 break 481 } 482 } 483 return nil 484} 485 486// Next advances to the next page of values. If there was an error making 487// the request the page does not advance and the error is returned. 488// Deprecated: Use NextWithContext() instead. 489func (page *AuthorizationServerCollectionPage) Next() error { 490 return page.NextWithContext(context.Background()) 491} 492 493// NotDone returns true if the page enumeration should be started or is not yet complete. 494func (page AuthorizationServerCollectionPage) NotDone() bool { 495 return !page.asc.IsEmpty() 496} 497 498// Response returns the raw server response from the last page request. 499func (page AuthorizationServerCollectionPage) Response() AuthorizationServerCollection { 500 return page.asc 501} 502 503// Values returns the slice of values for the current page or nil if there are no values. 504func (page AuthorizationServerCollectionPage) Values() []AuthorizationServerContract { 505 if page.asc.IsEmpty() { 506 return nil 507 } 508 return *page.asc.Value 509} 510 511// Creates a new instance of the AuthorizationServerCollectionPage type. 512func NewAuthorizationServerCollectionPage(cur AuthorizationServerCollection, getNextPage func(context.Context, AuthorizationServerCollection) (AuthorizationServerCollection, error)) AuthorizationServerCollectionPage { 513 return AuthorizationServerCollectionPage{ 514 fn: getNextPage, 515 asc: cur, 516 } 517} 518 519// AuthorizationServerContract external OAuth authorization server settings. 520type AuthorizationServerContract struct { 521 autorest.Response `json:"-"` 522 // ID - Identifier of the Authorization Server entity. 523 ID *string `json:"id,omitempty"` 524 // Name - User-friendly authorization server name. 525 Name *string `json:"name,omitempty"` 526 // ClientRegistrationEndpoint - Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced. 527 ClientRegistrationEndpoint *string `json:"clientRegistrationEndpoint,omitempty"` 528 // AuthorizationEndpoint - OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2. 529 AuthorizationEndpoint *string `json:"authorizationEndpoint,omitempty"` 530 // GrantTypes - Form of an authorization grant, which the client uses to request the access token. 531 GrantTypes *[]GrantType `json:"grantTypes,omitempty"` 532 // ClientID - Client or app id registered with this authorization server. 533 ClientID *string `json:"clientId,omitempty"` 534 // Description - Description of the authorization server. Can contain HTML formatting tags. 535 Description *string `json:"description,omitempty"` 536 // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. 537 AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"` 538 // ClientAuthenticationMethod - Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded format. 539 ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"` 540 // TokenBodyParameters - Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects with name and value string properties, i.e. {"name" : "name value", "value": "a value"}. 541 TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"` 542 // TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced. 543 TokenEndpoint *string `json:"tokenEndpoint,omitempty"` 544 // SupportState - If true, authorization server will include state parameter from the authorization request to its response. Client may use state parameter to raise protocol security. 545 SupportState *bool `json:"supportState,omitempty"` 546 // DefaultScope - Access token scope that is going to be requested by default. Can be overridden at the API level. Should be provided in the form of a string containing space-delimited values. 547 DefaultScope *string `json:"defaultScope,omitempty"` 548 // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. 549 BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"` 550 // ClientSecret - Client or app secret registered with this authorization server. 551 ClientSecret *string `json:"clientSecret,omitempty"` 552 // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. 553 ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` 554 // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. 555 ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"` 556} 557 558// AuthorizationServerContractBaseProperties external OAuth authorization server Update settings contract. 559type AuthorizationServerContractBaseProperties struct { 560 // Description - Description of the authorization server. Can contain HTML formatting tags. 561 Description *string `json:"description,omitempty"` 562 // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. 563 AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"` 564 // ClientAuthenticationMethod - Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded format. 565 ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"` 566 // TokenBodyParameters - Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects with name and value string properties, i.e. {"name" : "name value", "value": "a value"}. 567 TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"` 568 // TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced. 569 TokenEndpoint *string `json:"tokenEndpoint,omitempty"` 570 // SupportState - If true, authorization server will include state parameter from the authorization request to its response. Client may use state parameter to raise protocol security. 571 SupportState *bool `json:"supportState,omitempty"` 572 // DefaultScope - Access token scope that is going to be requested by default. Can be overridden at the API level. Should be provided in the form of a string containing space-delimited values. 573 DefaultScope *string `json:"defaultScope,omitempty"` 574 // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. 575 BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"` 576 // ClientSecret - Client or app secret registered with this authorization server. 577 ClientSecret *string `json:"clientSecret,omitempty"` 578 // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. 579 ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` 580 // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. 581 ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"` 582} 583 584// AuthorizationServerContractProperties external OAuth authorization server settings Properties. 585type AuthorizationServerContractProperties struct { 586 // Name - User-friendly authorization server name. 587 Name *string `json:"name,omitempty"` 588 // ClientRegistrationEndpoint - Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced. 589 ClientRegistrationEndpoint *string `json:"clientRegistrationEndpoint,omitempty"` 590 // AuthorizationEndpoint - OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2. 591 AuthorizationEndpoint *string `json:"authorizationEndpoint,omitempty"` 592 // GrantTypes - Form of an authorization grant, which the client uses to request the access token. 593 GrantTypes *[]GrantType `json:"grantTypes,omitempty"` 594 // ClientID - Client or app id registered with this authorization server. 595 ClientID *string `json:"clientId,omitempty"` 596 // Description - Description of the authorization server. Can contain HTML formatting tags. 597 Description *string `json:"description,omitempty"` 598 // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. 599 AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"` 600 // ClientAuthenticationMethod - Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded format. 601 ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"` 602 // TokenBodyParameters - Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects with name and value string properties, i.e. {"name" : "name value", "value": "a value"}. 603 TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"` 604 // TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced. 605 TokenEndpoint *string `json:"tokenEndpoint,omitempty"` 606 // SupportState - If true, authorization server will include state parameter from the authorization request to its response. Client may use state parameter to raise protocol security. 607 SupportState *bool `json:"supportState,omitempty"` 608 // DefaultScope - Access token scope that is going to be requested by default. Can be overridden at the API level. Should be provided in the form of a string containing space-delimited values. 609 DefaultScope *string `json:"defaultScope,omitempty"` 610 // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. 611 BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"` 612 // ClientSecret - Client or app secret registered with this authorization server. 613 ClientSecret *string `json:"clientSecret,omitempty"` 614 // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. 615 ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` 616 // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. 617 ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"` 618} 619 620// AuthorizationServerUpdateContract external OAuth authorization server Update settings contract. 621type AuthorizationServerUpdateContract struct { 622 // Name - User-friendly authorization server name. 623 Name *string `json:"name,omitempty"` 624 // ClientRegistrationEndpoint - Optional reference to a page where client or app registration for this authorization server is performed. Contains absolute URL to entity being referenced. 625 ClientRegistrationEndpoint *string `json:"clientRegistrationEndpoint,omitempty"` 626 // AuthorizationEndpoint - OAuth authorization endpoint. See http://tools.ietf.org/html/rfc6749#section-3.2. 627 AuthorizationEndpoint *string `json:"authorizationEndpoint,omitempty"` 628 // GrantTypes - Form of an authorization grant, which the client uses to request the access token. 629 GrantTypes *[]GrantType `json:"grantTypes,omitempty"` 630 // ClientID - Client or app id registered with this authorization server. 631 ClientID *string `json:"clientId,omitempty"` 632 // Description - Description of the authorization server. Can contain HTML formatting tags. 633 Description *string `json:"description,omitempty"` 634 // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. 635 AuthorizationMethods *[]AuthorizationMethod `json:"authorizationMethods,omitempty"` 636 // ClientAuthenticationMethod - Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded format. 637 ClientAuthenticationMethod *[]ClientAuthenticationMethod `json:"clientAuthenticationMethod,omitempty"` 638 // TokenBodyParameters - Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects with name and value string properties, i.e. {"name" : "name value", "value": "a value"}. 639 TokenBodyParameters *[]TokenBodyParameterContract `json:"tokenBodyParameters,omitempty"` 640 // TokenEndpoint - OAuth token endpoint. Contains absolute URI to entity being referenced. 641 TokenEndpoint *string `json:"tokenEndpoint,omitempty"` 642 // SupportState - If true, authorization server will include state parameter from the authorization request to its response. Client may use state parameter to raise protocol security. 643 SupportState *bool `json:"supportState,omitempty"` 644 // DefaultScope - Access token scope that is going to be requested by default. Can be overridden at the API level. Should be provided in the form of a string containing space-delimited values. 645 DefaultScope *string `json:"defaultScope,omitempty"` 646 // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. 647 BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"` 648 // ClientSecret - Client or app secret registered with this authorization server. 649 ClientSecret *string `json:"clientSecret,omitempty"` 650 // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. 651 ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` 652 // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. 653 ResourceOwnerPassword *string `json:"resourceOwnerPassword,omitempty"` 654} 655 656// BackendAuthorizationHeaderCredentials authorization header information. 657type BackendAuthorizationHeaderCredentials struct { 658 // Scheme - Authentication Scheme name. 659 Scheme *string `json:"scheme,omitempty"` 660 // Parameter - Authentication Parameter value. 661 Parameter *string `json:"parameter,omitempty"` 662} 663 664// BackendBaseParameters backend entity base Parameter set. 665type BackendBaseParameters struct { 666 // Title - Backend Title. 667 Title *string `json:"title,omitempty"` 668 // Description - Backend Description. 669 Description *string `json:"description,omitempty"` 670 // ResourceID - Management Uri of the Resource in External System. This url can be the Arm Resource Id of Logic Apps, Function Apps or Api Apps. 671 ResourceID *string `json:"resourceId,omitempty"` 672 // Properties - Backend Properties contract 673 Properties *BackendProperties `json:"properties,omitempty"` 674 // Credentials - Backend Credentials Contract Properties 675 Credentials *BackendCredentialsContract `json:"credentials,omitempty"` 676 // Proxy - Backend Proxy Contract Properties 677 Proxy *BackendProxyContract `json:"proxy,omitempty"` 678 // TLS - Backend TLS Properties 679 TLS *BackendTLSProperties `json:"tls,omitempty"` 680} 681 682// BackendCollection paged Backend list representation. 683type BackendCollection struct { 684 autorest.Response `json:"-"` 685 // Value - Backend values. 686 Value *[]BackendContract `json:"value,omitempty"` 687 // Count - Total number of entities 688 Count *int32 `json:"count,omitempty"` 689 // NextLink - Next page link if any. 690 NextLink *string `json:"nextLink,omitempty"` 691} 692 693// BackendCollectionIterator provides access to a complete listing of BackendContract values. 694type BackendCollectionIterator struct { 695 i int 696 page BackendCollectionPage 697} 698 699// NextWithContext advances to the next value. If there was an error making 700// the request the iterator does not advance and the error is returned. 701func (iter *BackendCollectionIterator) NextWithContext(ctx context.Context) (err error) { 702 if tracing.IsEnabled() { 703 ctx = tracing.StartSpan(ctx, fqdn+"/BackendCollectionIterator.NextWithContext") 704 defer func() { 705 sc := -1 706 if iter.Response().Response.Response != nil { 707 sc = iter.Response().Response.Response.StatusCode 708 } 709 tracing.EndSpan(ctx, sc, err) 710 }() 711 } 712 iter.i++ 713 if iter.i < len(iter.page.Values()) { 714 return nil 715 } 716 err = iter.page.NextWithContext(ctx) 717 if err != nil { 718 iter.i-- 719 return err 720 } 721 iter.i = 0 722 return nil 723} 724 725// Next advances to the next value. If there was an error making 726// the request the iterator does not advance and the error is returned. 727// Deprecated: Use NextWithContext() instead. 728func (iter *BackendCollectionIterator) Next() error { 729 return iter.NextWithContext(context.Background()) 730} 731 732// NotDone returns true if the enumeration should be started or is not yet complete. 733func (iter BackendCollectionIterator) NotDone() bool { 734 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 735} 736 737// Response returns the raw server response from the last page request. 738func (iter BackendCollectionIterator) Response() BackendCollection { 739 return iter.page.Response() 740} 741 742// Value returns the current value or a zero-initialized value if the 743// iterator has advanced beyond the end of the collection. 744func (iter BackendCollectionIterator) Value() BackendContract { 745 if !iter.page.NotDone() { 746 return BackendContract{} 747 } 748 return iter.page.Values()[iter.i] 749} 750 751// Creates a new instance of the BackendCollectionIterator type. 752func NewBackendCollectionIterator(page BackendCollectionPage) BackendCollectionIterator { 753 return BackendCollectionIterator{page: page} 754} 755 756// IsEmpty returns true if the ListResult contains no values. 757func (bc BackendCollection) IsEmpty() bool { 758 return bc.Value == nil || len(*bc.Value) == 0 759} 760 761// hasNextLink returns true if the NextLink is not empty. 762func (bc BackendCollection) hasNextLink() bool { 763 return bc.NextLink != nil && len(*bc.NextLink) != 0 764} 765 766// backendCollectionPreparer prepares a request to retrieve the next set of results. 767// It returns nil if no more results exist. 768func (bc BackendCollection) backendCollectionPreparer(ctx context.Context) (*http.Request, error) { 769 if !bc.hasNextLink() { 770 return nil, nil 771 } 772 return autorest.Prepare((&http.Request{}).WithContext(ctx), 773 autorest.AsJSON(), 774 autorest.AsGet(), 775 autorest.WithBaseURL(to.String(bc.NextLink))) 776} 777 778// BackendCollectionPage contains a page of BackendContract values. 779type BackendCollectionPage struct { 780 fn func(context.Context, BackendCollection) (BackendCollection, error) 781 bc BackendCollection 782} 783 784// NextWithContext advances to the next page of values. If there was an error making 785// the request the page does not advance and the error is returned. 786func (page *BackendCollectionPage) NextWithContext(ctx context.Context) (err error) { 787 if tracing.IsEnabled() { 788 ctx = tracing.StartSpan(ctx, fqdn+"/BackendCollectionPage.NextWithContext") 789 defer func() { 790 sc := -1 791 if page.Response().Response.Response != nil { 792 sc = page.Response().Response.Response.StatusCode 793 } 794 tracing.EndSpan(ctx, sc, err) 795 }() 796 } 797 for { 798 next, err := page.fn(ctx, page.bc) 799 if err != nil { 800 return err 801 } 802 page.bc = next 803 if !next.hasNextLink() || !next.IsEmpty() { 804 break 805 } 806 } 807 return nil 808} 809 810// Next advances to the next page of values. If there was an error making 811// the request the page does not advance and the error is returned. 812// Deprecated: Use NextWithContext() instead. 813func (page *BackendCollectionPage) Next() error { 814 return page.NextWithContext(context.Background()) 815} 816 817// NotDone returns true if the page enumeration should be started or is not yet complete. 818func (page BackendCollectionPage) NotDone() bool { 819 return !page.bc.IsEmpty() 820} 821 822// Response returns the raw server response from the last page request. 823func (page BackendCollectionPage) Response() BackendCollection { 824 return page.bc 825} 826 827// Values returns the slice of values for the current page or nil if there are no values. 828func (page BackendCollectionPage) Values() []BackendContract { 829 if page.bc.IsEmpty() { 830 return nil 831 } 832 return *page.bc.Value 833} 834 835// Creates a new instance of the BackendCollectionPage type. 836func NewBackendCollectionPage(cur BackendCollection, getNextPage func(context.Context, BackendCollection) (BackendCollection, error)) BackendCollectionPage { 837 return BackendCollectionPage{ 838 fn: getNextPage, 839 bc: cur, 840 } 841} 842 843// BackendContract backend details. 844type BackendContract struct { 845 autorest.Response `json:"-"` 846 // ID - Identifier of the Backend entity. 847 ID *string `json:"id,omitempty"` 848 // URL - Runtime Url of the Backend. 849 URL *string `json:"url,omitempty"` 850 // Protocol - Backend communication protocol. Possible values include: 'BackendProtocolHTTP', 'BackendProtocolSoap' 851 Protocol BackendProtocol `json:"protocol,omitempty"` 852 // Title - Backend Title. 853 Title *string `json:"title,omitempty"` 854 // Description - Backend Description. 855 Description *string `json:"description,omitempty"` 856 // ResourceID - Management Uri of the Resource in External System. This url can be the Arm Resource Id of Logic Apps, Function Apps or Api Apps. 857 ResourceID *string `json:"resourceId,omitempty"` 858 // Properties - Backend Properties contract 859 Properties *BackendProperties `json:"properties,omitempty"` 860 // Credentials - Backend Credentials Contract Properties 861 Credentials *BackendCredentialsContract `json:"credentials,omitempty"` 862 // Proxy - Backend Proxy Contract Properties 863 Proxy *BackendProxyContract `json:"proxy,omitempty"` 864 // TLS - Backend TLS Properties 865 TLS *BackendTLSProperties `json:"tls,omitempty"` 866} 867 868// BackendContractProperties parameters supplied to the Create Backend operation. 869type BackendContractProperties struct { 870 // URL - Runtime Url of the Backend. 871 URL *string `json:"url,omitempty"` 872 // Protocol - Backend communication protocol. Possible values include: 'BackendProtocolHTTP', 'BackendProtocolSoap' 873 Protocol BackendProtocol `json:"protocol,omitempty"` 874 // Title - Backend Title. 875 Title *string `json:"title,omitempty"` 876 // Description - Backend Description. 877 Description *string `json:"description,omitempty"` 878 // ResourceID - Management Uri of the Resource in External System. This url can be the Arm Resource Id of Logic Apps, Function Apps or Api Apps. 879 ResourceID *string `json:"resourceId,omitempty"` 880 // Properties - Backend Properties contract 881 Properties *BackendProperties `json:"properties,omitempty"` 882 // Credentials - Backend Credentials Contract Properties 883 Credentials *BackendCredentialsContract `json:"credentials,omitempty"` 884 // Proxy - Backend Proxy Contract Properties 885 Proxy *BackendProxyContract `json:"proxy,omitempty"` 886 // TLS - Backend TLS Properties 887 TLS *BackendTLSProperties `json:"tls,omitempty"` 888} 889 890// BackendCredentialsContract details of the Credentials used to connect to Backend. 891type BackendCredentialsContract struct { 892 // Certificate - List of Client Certificate Thumbprint. 893 Certificate *[]string `json:"certificate,omitempty"` 894 // Query - Query Parameter description. 895 Query map[string][]string `json:"query"` 896 // Header - Header Parameter description. 897 Header map[string][]string `json:"header"` 898 // Authorization - Authorization header authentication 899 Authorization *BackendAuthorizationHeaderCredentials `json:"authorization,omitempty"` 900} 901 902// MarshalJSON is the custom marshaler for BackendCredentialsContract. 903func (bcc BackendCredentialsContract) MarshalJSON() ([]byte, error) { 904 objectMap := make(map[string]interface{}) 905 if bcc.Certificate != nil { 906 objectMap["certificate"] = bcc.Certificate 907 } 908 if bcc.Query != nil { 909 objectMap["query"] = bcc.Query 910 } 911 if bcc.Header != nil { 912 objectMap["header"] = bcc.Header 913 } 914 if bcc.Authorization != nil { 915 objectMap["authorization"] = bcc.Authorization 916 } 917 return json.Marshal(objectMap) 918} 919 920// BackendProperties properties specific to the Backend Type. 921type BackendProperties struct { 922 // ServiceFabricCluster - Backend Service Fabric Cluster Properties 923 ServiceFabricCluster *BackendServiceFabricClusterProperties `json:"serviceFabricCluster,omitempty"` 924} 925 926// BackendProxyContract details of the Backend WebProxy Server to use in the Request to Backend. 927type BackendProxyContract struct { 928 // URL - WebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri instance, including all fragments and query strings. 929 URL *string `json:"url,omitempty"` 930 // Username - Username to connect to the WebProxy server 931 Username *string `json:"username,omitempty"` 932 // Password - Password to connect to the WebProxy Server 933 Password *string `json:"password,omitempty"` 934} 935 936// BackendServiceFabricClusterProperties properties of the Service Fabric Type Backend. 937type BackendServiceFabricClusterProperties struct { 938 // ClientCertificateThumbprint - The client certificate thumbprint for the management endpoint. 939 ClientCertificateThumbprint *string `json:"clientCertificateThumbprint,omitempty"` 940 // MaxPartitionResolutionRetries - Maximum number of retries while attempting resolve the partition. 941 MaxPartitionResolutionRetries *int32 `json:"maxPartitionResolutionRetries,omitempty"` 942 // PartitionResolutionRequestTimeout - Maximum time allowed to update partition resolution data. Duration needs to be specified using the format PT[n]H[n]M[n]S as per ISO8601 943 PartitionResolutionRequestTimeout *string `json:"partitionResolutionRequestTimeout,omitempty"` 944 // ManagementEndpoints - The cluster management endpoint. 945 ManagementEndpoints *[]string `json:"managementEndpoints,omitempty"` 946 // ServerCertificateThumbprints - Thumbprints of certificates cluster management service uses for tls communication 947 ServerCertificateThumbprints *[]string `json:"serverCertificateThumbprints,omitempty"` 948 // ServerX509Names - Server X509 Certificate Names Collection 949 ServerX509Names *[]X509CertificateName `json:"serverX509Names,omitempty"` 950} 951 952// BackendTLSProperties properties controlling TLS Certificate Validation. 953type BackendTLSProperties struct { 954 // ValidateCertificateChain - Flag indicating whether SSL certificate chain validation should be done when using self-signed certificates for this backend host. 955 ValidateCertificateChain *bool `json:"validateCertificateChain,omitempty"` 956 // ValidateCertificateName - Flag indicating whether SSL certificate name validation should be done when using self-signed certificates for this backend host. 957 ValidateCertificateName *bool `json:"validateCertificateName,omitempty"` 958} 959 960// BackendUpdateParameters parameters supplied to the Update Backend operation. 961type BackendUpdateParameters struct { 962 // URL - Runtime Url of the Backend. 963 URL *string `json:"url,omitempty"` 964 // Protocol - Backend communication protocol. Possible values include: 'BackendProtocolHTTP', 'BackendProtocolSoap' 965 Protocol BackendProtocol `json:"protocol,omitempty"` 966 // Title - Backend Title. 967 Title *string `json:"title,omitempty"` 968 // Description - Backend Description. 969 Description *string `json:"description,omitempty"` 970 // ResourceID - Management Uri of the Resource in External System. This url can be the Arm Resource Id of Logic Apps, Function Apps or Api Apps. 971 ResourceID *string `json:"resourceId,omitempty"` 972 // Properties - Backend Properties contract 973 Properties *BackendProperties `json:"properties,omitempty"` 974 // Credentials - Backend Credentials Contract Properties 975 Credentials *BackendCredentialsContract `json:"credentials,omitempty"` 976 // Proxy - Backend Proxy Contract Properties 977 Proxy *BackendProxyContract `json:"proxy,omitempty"` 978 // TLS - Backend TLS Properties 979 TLS *BackendTLSProperties `json:"tls,omitempty"` 980} 981 982// CertificateCollection paged Certificates list representation. 983type CertificateCollection struct { 984 autorest.Response `json:"-"` 985 // Value - Page values. 986 Value *[]CertificateContract `json:"value,omitempty"` 987 // Count - Total number of entities 988 Count *int32 `json:"count,omitempty"` 989 // NextLink - Next page link if any. 990 NextLink *string `json:"nextLink,omitempty"` 991} 992 993// CertificateCollectionIterator provides access to a complete listing of CertificateContract values. 994type CertificateCollectionIterator struct { 995 i int 996 page CertificateCollectionPage 997} 998 999// NextWithContext advances to the next value. If there was an error making 1000// the request the iterator does not advance and the error is returned. 1001func (iter *CertificateCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1002 if tracing.IsEnabled() { 1003 ctx = tracing.StartSpan(ctx, fqdn+"/CertificateCollectionIterator.NextWithContext") 1004 defer func() { 1005 sc := -1 1006 if iter.Response().Response.Response != nil { 1007 sc = iter.Response().Response.Response.StatusCode 1008 } 1009 tracing.EndSpan(ctx, sc, err) 1010 }() 1011 } 1012 iter.i++ 1013 if iter.i < len(iter.page.Values()) { 1014 return nil 1015 } 1016 err = iter.page.NextWithContext(ctx) 1017 if err != nil { 1018 iter.i-- 1019 return err 1020 } 1021 iter.i = 0 1022 return nil 1023} 1024 1025// Next advances to the next value. If there was an error making 1026// the request the iterator does not advance and the error is returned. 1027// Deprecated: Use NextWithContext() instead. 1028func (iter *CertificateCollectionIterator) Next() error { 1029 return iter.NextWithContext(context.Background()) 1030} 1031 1032// NotDone returns true if the enumeration should be started or is not yet complete. 1033func (iter CertificateCollectionIterator) NotDone() bool { 1034 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1035} 1036 1037// Response returns the raw server response from the last page request. 1038func (iter CertificateCollectionIterator) Response() CertificateCollection { 1039 return iter.page.Response() 1040} 1041 1042// Value returns the current value or a zero-initialized value if the 1043// iterator has advanced beyond the end of the collection. 1044func (iter CertificateCollectionIterator) Value() CertificateContract { 1045 if !iter.page.NotDone() { 1046 return CertificateContract{} 1047 } 1048 return iter.page.Values()[iter.i] 1049} 1050 1051// Creates a new instance of the CertificateCollectionIterator type. 1052func NewCertificateCollectionIterator(page CertificateCollectionPage) CertificateCollectionIterator { 1053 return CertificateCollectionIterator{page: page} 1054} 1055 1056// IsEmpty returns true if the ListResult contains no values. 1057func (cc CertificateCollection) IsEmpty() bool { 1058 return cc.Value == nil || len(*cc.Value) == 0 1059} 1060 1061// hasNextLink returns true if the NextLink is not empty. 1062func (cc CertificateCollection) hasNextLink() bool { 1063 return cc.NextLink != nil && len(*cc.NextLink) != 0 1064} 1065 1066// certificateCollectionPreparer prepares a request to retrieve the next set of results. 1067// It returns nil if no more results exist. 1068func (cc CertificateCollection) certificateCollectionPreparer(ctx context.Context) (*http.Request, error) { 1069 if !cc.hasNextLink() { 1070 return nil, nil 1071 } 1072 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1073 autorest.AsJSON(), 1074 autorest.AsGet(), 1075 autorest.WithBaseURL(to.String(cc.NextLink))) 1076} 1077 1078// CertificateCollectionPage contains a page of CertificateContract values. 1079type CertificateCollectionPage struct { 1080 fn func(context.Context, CertificateCollection) (CertificateCollection, error) 1081 cc CertificateCollection 1082} 1083 1084// NextWithContext advances to the next page of values. If there was an error making 1085// the request the page does not advance and the error is returned. 1086func (page *CertificateCollectionPage) NextWithContext(ctx context.Context) (err error) { 1087 if tracing.IsEnabled() { 1088 ctx = tracing.StartSpan(ctx, fqdn+"/CertificateCollectionPage.NextWithContext") 1089 defer func() { 1090 sc := -1 1091 if page.Response().Response.Response != nil { 1092 sc = page.Response().Response.Response.StatusCode 1093 } 1094 tracing.EndSpan(ctx, sc, err) 1095 }() 1096 } 1097 for { 1098 next, err := page.fn(ctx, page.cc) 1099 if err != nil { 1100 return err 1101 } 1102 page.cc = next 1103 if !next.hasNextLink() || !next.IsEmpty() { 1104 break 1105 } 1106 } 1107 return nil 1108} 1109 1110// Next advances to the next page of values. If there was an error making 1111// the request the page does not advance and the error is returned. 1112// Deprecated: Use NextWithContext() instead. 1113func (page *CertificateCollectionPage) Next() error { 1114 return page.NextWithContext(context.Background()) 1115} 1116 1117// NotDone returns true if the page enumeration should be started or is not yet complete. 1118func (page CertificateCollectionPage) NotDone() bool { 1119 return !page.cc.IsEmpty() 1120} 1121 1122// Response returns the raw server response from the last page request. 1123func (page CertificateCollectionPage) Response() CertificateCollection { 1124 return page.cc 1125} 1126 1127// Values returns the slice of values for the current page or nil if there are no values. 1128func (page CertificateCollectionPage) Values() []CertificateContract { 1129 if page.cc.IsEmpty() { 1130 return nil 1131 } 1132 return *page.cc.Value 1133} 1134 1135// Creates a new instance of the CertificateCollectionPage type. 1136func NewCertificateCollectionPage(cur CertificateCollection, getNextPage func(context.Context, CertificateCollection) (CertificateCollection, error)) CertificateCollectionPage { 1137 return CertificateCollectionPage{ 1138 fn: getNextPage, 1139 cc: cur, 1140 } 1141} 1142 1143// CertificateContract certificate details. 1144type CertificateContract struct { 1145 autorest.Response `json:"-"` 1146 // ID - Identifier of the Certificate entity. 1147 ID *string `json:"id,omitempty"` 1148 // Subject - Subject attribute of the certificate. 1149 Subject *string `json:"subject,omitempty"` 1150 // Thumbprint - Thumbprint of the certificate. 1151 Thumbprint *string `json:"thumbprint,omitempty"` 1152 // ExpirationDate - Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 1153 ExpirationDate *date.Time `json:"expirationDate,omitempty"` 1154} 1155 1156// CertificateContractProperties properties of the Certificate contract. 1157type CertificateContractProperties struct { 1158 // Subject - Subject attribute of the certificate. 1159 Subject *string `json:"subject,omitempty"` 1160 // Thumbprint - Thumbprint of the certificate. 1161 Thumbprint *string `json:"thumbprint,omitempty"` 1162 // ExpirationDate - Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 1163 ExpirationDate *date.Time `json:"expirationDate,omitempty"` 1164} 1165 1166// CertificateCreateOrUpdateParameters parameters supplied to the CreateOrUpdate certificate operation. 1167type CertificateCreateOrUpdateParameters struct { 1168 // Data - Base 64 encoded certificate using the application/x-pkcs12 representation. 1169 Data *string `json:"data,omitempty"` 1170 // Password - Password for the Certificate 1171 Password *string `json:"password,omitempty"` 1172} 1173 1174// DeployConfigurationParameters parameters supplied to the Deploy Configuration operation. 1175type DeployConfigurationParameters struct { 1176 // Branch - The name of the Git branch from which the configuration is to be deployed to the configuration database. 1177 Branch *string `json:"branch,omitempty"` 1178 // Force - The value enforcing deleting subscriptions to products that are deleted in this update. 1179 Force *bool `json:"force,omitempty"` 1180} 1181 1182// EmailTemplateCollection paged email template list representation. 1183type EmailTemplateCollection struct { 1184 autorest.Response `json:"-"` 1185 // Value - Page values. 1186 Value *[]EmailTemplateContract `json:"value,omitempty"` 1187 // Count - Total number of entities 1188 Count *int32 `json:"count,omitempty"` 1189 // NextLink - Next page link if any. 1190 NextLink *string `json:"nextLink,omitempty"` 1191} 1192 1193// EmailTemplateCollectionIterator provides access to a complete listing of EmailTemplateContract values. 1194type EmailTemplateCollectionIterator struct { 1195 i int 1196 page EmailTemplateCollectionPage 1197} 1198 1199// NextWithContext advances to the next value. If there was an error making 1200// the request the iterator does not advance and the error is returned. 1201func (iter *EmailTemplateCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1202 if tracing.IsEnabled() { 1203 ctx = tracing.StartSpan(ctx, fqdn+"/EmailTemplateCollectionIterator.NextWithContext") 1204 defer func() { 1205 sc := -1 1206 if iter.Response().Response.Response != nil { 1207 sc = iter.Response().Response.Response.StatusCode 1208 } 1209 tracing.EndSpan(ctx, sc, err) 1210 }() 1211 } 1212 iter.i++ 1213 if iter.i < len(iter.page.Values()) { 1214 return nil 1215 } 1216 err = iter.page.NextWithContext(ctx) 1217 if err != nil { 1218 iter.i-- 1219 return err 1220 } 1221 iter.i = 0 1222 return nil 1223} 1224 1225// Next advances to the next value. If there was an error making 1226// the request the iterator does not advance and the error is returned. 1227// Deprecated: Use NextWithContext() instead. 1228func (iter *EmailTemplateCollectionIterator) Next() error { 1229 return iter.NextWithContext(context.Background()) 1230} 1231 1232// NotDone returns true if the enumeration should be started or is not yet complete. 1233func (iter EmailTemplateCollectionIterator) NotDone() bool { 1234 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1235} 1236 1237// Response returns the raw server response from the last page request. 1238func (iter EmailTemplateCollectionIterator) Response() EmailTemplateCollection { 1239 return iter.page.Response() 1240} 1241 1242// Value returns the current value or a zero-initialized value if the 1243// iterator has advanced beyond the end of the collection. 1244func (iter EmailTemplateCollectionIterator) Value() EmailTemplateContract { 1245 if !iter.page.NotDone() { 1246 return EmailTemplateContract{} 1247 } 1248 return iter.page.Values()[iter.i] 1249} 1250 1251// Creates a new instance of the EmailTemplateCollectionIterator type. 1252func NewEmailTemplateCollectionIterator(page EmailTemplateCollectionPage) EmailTemplateCollectionIterator { 1253 return EmailTemplateCollectionIterator{page: page} 1254} 1255 1256// IsEmpty returns true if the ListResult contains no values. 1257func (etc EmailTemplateCollection) IsEmpty() bool { 1258 return etc.Value == nil || len(*etc.Value) == 0 1259} 1260 1261// hasNextLink returns true if the NextLink is not empty. 1262func (etc EmailTemplateCollection) hasNextLink() bool { 1263 return etc.NextLink != nil && len(*etc.NextLink) != 0 1264} 1265 1266// emailTemplateCollectionPreparer prepares a request to retrieve the next set of results. 1267// It returns nil if no more results exist. 1268func (etc EmailTemplateCollection) emailTemplateCollectionPreparer(ctx context.Context) (*http.Request, error) { 1269 if !etc.hasNextLink() { 1270 return nil, nil 1271 } 1272 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1273 autorest.AsJSON(), 1274 autorest.AsGet(), 1275 autorest.WithBaseURL(to.String(etc.NextLink))) 1276} 1277 1278// EmailTemplateCollectionPage contains a page of EmailTemplateContract values. 1279type EmailTemplateCollectionPage struct { 1280 fn func(context.Context, EmailTemplateCollection) (EmailTemplateCollection, error) 1281 etc EmailTemplateCollection 1282} 1283 1284// NextWithContext advances to the next page of values. If there was an error making 1285// the request the page does not advance and the error is returned. 1286func (page *EmailTemplateCollectionPage) NextWithContext(ctx context.Context) (err error) { 1287 if tracing.IsEnabled() { 1288 ctx = tracing.StartSpan(ctx, fqdn+"/EmailTemplateCollectionPage.NextWithContext") 1289 defer func() { 1290 sc := -1 1291 if page.Response().Response.Response != nil { 1292 sc = page.Response().Response.Response.StatusCode 1293 } 1294 tracing.EndSpan(ctx, sc, err) 1295 }() 1296 } 1297 for { 1298 next, err := page.fn(ctx, page.etc) 1299 if err != nil { 1300 return err 1301 } 1302 page.etc = next 1303 if !next.hasNextLink() || !next.IsEmpty() { 1304 break 1305 } 1306 } 1307 return nil 1308} 1309 1310// Next advances to the next page of values. If there was an error making 1311// the request the page does not advance and the error is returned. 1312// Deprecated: Use NextWithContext() instead. 1313func (page *EmailTemplateCollectionPage) Next() error { 1314 return page.NextWithContext(context.Background()) 1315} 1316 1317// NotDone returns true if the page enumeration should be started or is not yet complete. 1318func (page EmailTemplateCollectionPage) NotDone() bool { 1319 return !page.etc.IsEmpty() 1320} 1321 1322// Response returns the raw server response from the last page request. 1323func (page EmailTemplateCollectionPage) Response() EmailTemplateCollection { 1324 return page.etc 1325} 1326 1327// Values returns the slice of values for the current page or nil if there are no values. 1328func (page EmailTemplateCollectionPage) Values() []EmailTemplateContract { 1329 if page.etc.IsEmpty() { 1330 return nil 1331 } 1332 return *page.etc.Value 1333} 1334 1335// Creates a new instance of the EmailTemplateCollectionPage type. 1336func NewEmailTemplateCollectionPage(cur EmailTemplateCollection, getNextPage func(context.Context, EmailTemplateCollection) (EmailTemplateCollection, error)) EmailTemplateCollectionPage { 1337 return EmailTemplateCollectionPage{ 1338 fn: getNextPage, 1339 etc: cur, 1340 } 1341} 1342 1343// EmailTemplateContract email Template details. 1344type EmailTemplateContract struct { 1345 autorest.Response `json:"-"` 1346 // ID - Identifier of the Template Contract. 1347 ID *string `json:"id,omitempty"` 1348 // Subject - Subject of the Template. 1349 Subject *string `json:"subject,omitempty"` 1350 // Body - Email Template Body. This should be a valid XDocument 1351 Body *string `json:"body,omitempty"` 1352 // Title - Title of the Template. 1353 Title *string `json:"title,omitempty"` 1354 // Description - Description of the Email Template. 1355 Description *string `json:"description,omitempty"` 1356 // IsDefault - READ-ONLY; Whether the template is the default template provided by Api Management or has been edited. 1357 IsDefault *bool `json:"isDefault,omitempty"` 1358 // Parameters - Email Template Parameter values. 1359 Parameters *[]EmailTemplateParametersContractProperties `json:"parameters,omitempty"` 1360} 1361 1362// MarshalJSON is the custom marshaler for EmailTemplateContract. 1363func (etc EmailTemplateContract) MarshalJSON() ([]byte, error) { 1364 objectMap := make(map[string]interface{}) 1365 if etc.ID != nil { 1366 objectMap["id"] = etc.ID 1367 } 1368 if etc.Subject != nil { 1369 objectMap["subject"] = etc.Subject 1370 } 1371 if etc.Body != nil { 1372 objectMap["body"] = etc.Body 1373 } 1374 if etc.Title != nil { 1375 objectMap["title"] = etc.Title 1376 } 1377 if etc.Description != nil { 1378 objectMap["description"] = etc.Description 1379 } 1380 if etc.Parameters != nil { 1381 objectMap["parameters"] = etc.Parameters 1382 } 1383 return json.Marshal(objectMap) 1384} 1385 1386// EmailTemplateContractProperties email Template Contract properties. 1387type EmailTemplateContractProperties struct { 1388 // Subject - Subject of the Template. 1389 Subject *string `json:"subject,omitempty"` 1390 // Body - Email Template Body. This should be a valid XDocument 1391 Body *string `json:"body,omitempty"` 1392 // Title - Title of the Template. 1393 Title *string `json:"title,omitempty"` 1394 // Description - Description of the Email Template. 1395 Description *string `json:"description,omitempty"` 1396 // IsDefault - READ-ONLY; Whether the template is the default template provided by Api Management or has been edited. 1397 IsDefault *bool `json:"isDefault,omitempty"` 1398 // Parameters - Email Template Parameter values. 1399 Parameters *[]EmailTemplateParametersContractProperties `json:"parameters,omitempty"` 1400} 1401 1402// MarshalJSON is the custom marshaler for EmailTemplateContractProperties. 1403func (etcp EmailTemplateContractProperties) MarshalJSON() ([]byte, error) { 1404 objectMap := make(map[string]interface{}) 1405 if etcp.Subject != nil { 1406 objectMap["subject"] = etcp.Subject 1407 } 1408 if etcp.Body != nil { 1409 objectMap["body"] = etcp.Body 1410 } 1411 if etcp.Title != nil { 1412 objectMap["title"] = etcp.Title 1413 } 1414 if etcp.Description != nil { 1415 objectMap["description"] = etcp.Description 1416 } 1417 if etcp.Parameters != nil { 1418 objectMap["parameters"] = etcp.Parameters 1419 } 1420 return json.Marshal(objectMap) 1421} 1422 1423// EmailTemplateParametersContractProperties email Template Parameter contract. 1424type EmailTemplateParametersContractProperties struct { 1425 // Name - Template parameter name. 1426 Name *string `json:"name,omitempty"` 1427 // Title - Template parameter title. 1428 Title *string `json:"title,omitempty"` 1429 // Description - Template parameter description. 1430 Description *string `json:"description,omitempty"` 1431} 1432 1433// EmailTemplateUpdateParameters email Template Update Contract properties. 1434type EmailTemplateUpdateParameters struct { 1435 // Subject - Subject of the Template. 1436 Subject *string `json:"subject,omitempty"` 1437 // Title - Title of the Template. 1438 Title *string `json:"title,omitempty"` 1439 // Description - Description of the Email Template. 1440 Description *string `json:"description,omitempty"` 1441 // Body - Email Template Body. This should be a valid XDocument 1442 Body *string `json:"body,omitempty"` 1443 // Parameters - Email Template Parameter values. 1444 Parameters *[]EmailTemplateParametersContractProperties `json:"parameters,omitempty"` 1445} 1446 1447// ErrorFieldContract error Field contract. 1448type ErrorFieldContract struct { 1449 // Code - Property level error code. 1450 Code *string `json:"code,omitempty"` 1451 // Message - Human-readable representation of property-level error. 1452 Message *string `json:"message,omitempty"` 1453 // Target - Property name. 1454 Target *string `json:"target,omitempty"` 1455} 1456 1457// ErrorResponse error Body contract. 1458type ErrorResponse struct { 1459 // Code - Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. 1460 Code *string `json:"code,omitempty"` 1461 // Message - Human-readable representation of the error. 1462 Message *string `json:"message,omitempty"` 1463 // Details - The list of invalid fields send in request, in case of validation error. 1464 Details *[]ErrorFieldContract `json:"details,omitempty"` 1465} 1466 1467// GenerateSsoURLResult generate SSO Url operations response details. 1468type GenerateSsoURLResult struct { 1469 autorest.Response `json:"-"` 1470 // Value - Redirect Url containing the SSO URL value. 1471 Value *string `json:"value,omitempty"` 1472} 1473 1474// GroupCollection paged Group list representation. 1475type GroupCollection struct { 1476 autorest.Response `json:"-"` 1477 // Value - Page values. 1478 Value *[]GroupContract `json:"value,omitempty"` 1479 // Count - Total number of entities 1480 Count *int32 `json:"count,omitempty"` 1481 // NextLink - Next page link if any. 1482 NextLink *string `json:"nextLink,omitempty"` 1483} 1484 1485// GroupCollectionIterator provides access to a complete listing of GroupContract values. 1486type GroupCollectionIterator struct { 1487 i int 1488 page GroupCollectionPage 1489} 1490 1491// NextWithContext advances to the next value. If there was an error making 1492// the request the iterator does not advance and the error is returned. 1493func (iter *GroupCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1494 if tracing.IsEnabled() { 1495 ctx = tracing.StartSpan(ctx, fqdn+"/GroupCollectionIterator.NextWithContext") 1496 defer func() { 1497 sc := -1 1498 if iter.Response().Response.Response != nil { 1499 sc = iter.Response().Response.Response.StatusCode 1500 } 1501 tracing.EndSpan(ctx, sc, err) 1502 }() 1503 } 1504 iter.i++ 1505 if iter.i < len(iter.page.Values()) { 1506 return nil 1507 } 1508 err = iter.page.NextWithContext(ctx) 1509 if err != nil { 1510 iter.i-- 1511 return err 1512 } 1513 iter.i = 0 1514 return nil 1515} 1516 1517// Next advances to the next value. If there was an error making 1518// the request the iterator does not advance and the error is returned. 1519// Deprecated: Use NextWithContext() instead. 1520func (iter *GroupCollectionIterator) Next() error { 1521 return iter.NextWithContext(context.Background()) 1522} 1523 1524// NotDone returns true if the enumeration should be started or is not yet complete. 1525func (iter GroupCollectionIterator) NotDone() bool { 1526 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1527} 1528 1529// Response returns the raw server response from the last page request. 1530func (iter GroupCollectionIterator) Response() GroupCollection { 1531 return iter.page.Response() 1532} 1533 1534// Value returns the current value or a zero-initialized value if the 1535// iterator has advanced beyond the end of the collection. 1536func (iter GroupCollectionIterator) Value() GroupContract { 1537 if !iter.page.NotDone() { 1538 return GroupContract{} 1539 } 1540 return iter.page.Values()[iter.i] 1541} 1542 1543// Creates a new instance of the GroupCollectionIterator type. 1544func NewGroupCollectionIterator(page GroupCollectionPage) GroupCollectionIterator { 1545 return GroupCollectionIterator{page: page} 1546} 1547 1548// IsEmpty returns true if the ListResult contains no values. 1549func (gc GroupCollection) IsEmpty() bool { 1550 return gc.Value == nil || len(*gc.Value) == 0 1551} 1552 1553// hasNextLink returns true if the NextLink is not empty. 1554func (gc GroupCollection) hasNextLink() bool { 1555 return gc.NextLink != nil && len(*gc.NextLink) != 0 1556} 1557 1558// groupCollectionPreparer prepares a request to retrieve the next set of results. 1559// It returns nil if no more results exist. 1560func (gc GroupCollection) groupCollectionPreparer(ctx context.Context) (*http.Request, error) { 1561 if !gc.hasNextLink() { 1562 return nil, nil 1563 } 1564 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1565 autorest.AsJSON(), 1566 autorest.AsGet(), 1567 autorest.WithBaseURL(to.String(gc.NextLink))) 1568} 1569 1570// GroupCollectionPage contains a page of GroupContract values. 1571type GroupCollectionPage struct { 1572 fn func(context.Context, GroupCollection) (GroupCollection, error) 1573 gc GroupCollection 1574} 1575 1576// NextWithContext advances to the next page of values. If there was an error making 1577// the request the page does not advance and the error is returned. 1578func (page *GroupCollectionPage) NextWithContext(ctx context.Context) (err error) { 1579 if tracing.IsEnabled() { 1580 ctx = tracing.StartSpan(ctx, fqdn+"/GroupCollectionPage.NextWithContext") 1581 defer func() { 1582 sc := -1 1583 if page.Response().Response.Response != nil { 1584 sc = page.Response().Response.Response.StatusCode 1585 } 1586 tracing.EndSpan(ctx, sc, err) 1587 }() 1588 } 1589 for { 1590 next, err := page.fn(ctx, page.gc) 1591 if err != nil { 1592 return err 1593 } 1594 page.gc = next 1595 if !next.hasNextLink() || !next.IsEmpty() { 1596 break 1597 } 1598 } 1599 return nil 1600} 1601 1602// Next advances to the next page of values. If there was an error making 1603// the request the page does not advance and the error is returned. 1604// Deprecated: Use NextWithContext() instead. 1605func (page *GroupCollectionPage) Next() error { 1606 return page.NextWithContext(context.Background()) 1607} 1608 1609// NotDone returns true if the page enumeration should be started or is not yet complete. 1610func (page GroupCollectionPage) NotDone() bool { 1611 return !page.gc.IsEmpty() 1612} 1613 1614// Response returns the raw server response from the last page request. 1615func (page GroupCollectionPage) Response() GroupCollection { 1616 return page.gc 1617} 1618 1619// Values returns the slice of values for the current page or nil if there are no values. 1620func (page GroupCollectionPage) Values() []GroupContract { 1621 if page.gc.IsEmpty() { 1622 return nil 1623 } 1624 return *page.gc.Value 1625} 1626 1627// Creates a new instance of the GroupCollectionPage type. 1628func NewGroupCollectionPage(cur GroupCollection, getNextPage func(context.Context, GroupCollection) (GroupCollection, error)) GroupCollectionPage { 1629 return GroupCollectionPage{ 1630 fn: getNextPage, 1631 gc: cur, 1632 } 1633} 1634 1635// GroupContract contract details. 1636type GroupContract struct { 1637 autorest.Response `json:"-"` 1638 // ID - Identifier of the Group entity. 1639 ID *string `json:"id,omitempty"` 1640 // Name - Group name. 1641 Name *string `json:"name,omitempty"` 1642 // Description - Group description. Can contain HTML formatting tags. 1643 Description *string `json:"description,omitempty"` 1644 // BuiltIn - READ-ONLY; true if the group is one of the three system groups (Administrators, Developers, or Guests); otherwise false. 1645 BuiltIn *bool `json:"builtIn,omitempty"` 1646 // Type - Group type. Possible values include: 'Custom', 'System', 'External' 1647 Type GroupType `json:"type,omitempty"` 1648 // ExternalID - For external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active Directory aad://<tenant>.onmicrosoft.com/groups/<group object id>; otherwise the value is null. 1649 ExternalID *string `json:"externalId,omitempty"` 1650} 1651 1652// MarshalJSON is the custom marshaler for GroupContract. 1653func (gc GroupContract) MarshalJSON() ([]byte, error) { 1654 objectMap := make(map[string]interface{}) 1655 if gc.ID != nil { 1656 objectMap["id"] = gc.ID 1657 } 1658 if gc.Name != nil { 1659 objectMap["name"] = gc.Name 1660 } 1661 if gc.Description != nil { 1662 objectMap["description"] = gc.Description 1663 } 1664 if gc.Type != "" { 1665 objectMap["type"] = gc.Type 1666 } 1667 if gc.ExternalID != nil { 1668 objectMap["externalId"] = gc.ExternalID 1669 } 1670 return json.Marshal(objectMap) 1671} 1672 1673// GroupContractProperties developer group. 1674type GroupContractProperties struct { 1675 // Name - Group name. 1676 Name *string `json:"name,omitempty"` 1677 // Description - Group description. Can contain HTML formatting tags. 1678 Description *string `json:"description,omitempty"` 1679 // BuiltIn - READ-ONLY; true if the group is one of the three system groups (Administrators, Developers, or Guests); otherwise false. 1680 BuiltIn *bool `json:"builtIn,omitempty"` 1681 // Type - Group type. Possible values include: 'Custom', 'System', 'External' 1682 Type GroupType `json:"type,omitempty"` 1683 // ExternalID - For external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active Directory aad://<tenant>.onmicrosoft.com/groups/<group object id>; otherwise the value is null. 1684 ExternalID *string `json:"externalId,omitempty"` 1685} 1686 1687// MarshalJSON is the custom marshaler for GroupContractProperties. 1688func (gcp GroupContractProperties) MarshalJSON() ([]byte, error) { 1689 objectMap := make(map[string]interface{}) 1690 if gcp.Name != nil { 1691 objectMap["name"] = gcp.Name 1692 } 1693 if gcp.Description != nil { 1694 objectMap["description"] = gcp.Description 1695 } 1696 if gcp.Type != "" { 1697 objectMap["type"] = gcp.Type 1698 } 1699 if gcp.ExternalID != nil { 1700 objectMap["externalId"] = gcp.ExternalID 1701 } 1702 return json.Marshal(objectMap) 1703} 1704 1705// GroupCreateParameters parameters supplied to the Create Group operation. 1706type GroupCreateParameters struct { 1707 // Name - Group name. 1708 Name *string `json:"name,omitempty"` 1709 // Description - Group description. 1710 Description *string `json:"description,omitempty"` 1711 // Type - Group type. Possible values include: 'Custom', 'System', 'External' 1712 Type GroupType `json:"type,omitempty"` 1713 // ExternalID - Identifier of the external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active Directory aad://<tenant>.onmicrosoft.com/groups/<group object id>; otherwise the value is null. 1714 ExternalID *string `json:"externalId,omitempty"` 1715} 1716 1717// GroupUpdateParameters parameters supplied to the Update Group operation. 1718type GroupUpdateParameters struct { 1719 // Name - Group name. 1720 Name *string `json:"name,omitempty"` 1721 // Description - Group description. 1722 Description *string `json:"description,omitempty"` 1723 // Type - Group type. Possible values include: 'Custom', 'System', 'External' 1724 Type GroupType `json:"type,omitempty"` 1725 // ExternalID - Identifier of the external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active Directory aad://<tenant>.onmicrosoft.com/groups/<group object id>; otherwise the value is null. 1726 ExternalID *string `json:"externalId,omitempty"` 1727} 1728 1729// IdentityProviderBaseParameters identity Provider Base Parameter Properties. 1730type IdentityProviderBaseParameters struct { 1731 // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' 1732 Type IdentityProviderType `json:"type,omitempty"` 1733 // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. 1734 AllowedTenants *[]string `json:"allowedTenants,omitempty"` 1735 // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. 1736 SignupPolicyName *string `json:"signupPolicyName,omitempty"` 1737 // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. 1738 SigninPolicyName *string `json:"signinPolicyName,omitempty"` 1739 // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. 1740 ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` 1741 // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. 1742 PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` 1743} 1744 1745// IdentityProviderContract identity Provider details. 1746type IdentityProviderContract struct { 1747 autorest.Response `json:"-"` 1748 // ID - Identifier of the identity provider. 1749 ID *string `json:"id,omitempty"` 1750 // ClientID - Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google login, App ID for Microsoft. 1751 ClientID *string `json:"clientId,omitempty"` 1752 // ClientSecret - Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is App Secret for Facebook login, API Key for Google login, Public Key for Microsoft. 1753 ClientSecret *string `json:"clientSecret,omitempty"` 1754 // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' 1755 Type IdentityProviderType `json:"type,omitempty"` 1756 // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. 1757 AllowedTenants *[]string `json:"allowedTenants,omitempty"` 1758 // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. 1759 SignupPolicyName *string `json:"signupPolicyName,omitempty"` 1760 // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. 1761 SigninPolicyName *string `json:"signinPolicyName,omitempty"` 1762 // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. 1763 ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` 1764 // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. 1765 PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` 1766} 1767 1768// IdentityProviderContractProperties the external Identity Providers like Facebook, Google, Microsoft, 1769// Twitter or Azure Active Directory which can be used to enable access to the API Management service 1770// developer portal for all users. 1771type IdentityProviderContractProperties struct { 1772 // ClientID - Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google login, App ID for Microsoft. 1773 ClientID *string `json:"clientId,omitempty"` 1774 // ClientSecret - Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is App Secret for Facebook login, API Key for Google login, Public Key for Microsoft. 1775 ClientSecret *string `json:"clientSecret,omitempty"` 1776 // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' 1777 Type IdentityProviderType `json:"type,omitempty"` 1778 // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. 1779 AllowedTenants *[]string `json:"allowedTenants,omitempty"` 1780 // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. 1781 SignupPolicyName *string `json:"signupPolicyName,omitempty"` 1782 // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. 1783 SigninPolicyName *string `json:"signinPolicyName,omitempty"` 1784 // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. 1785 ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` 1786 // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. 1787 PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` 1788} 1789 1790// IdentityProviderList list of all the Identity Providers configured on the service instance. 1791type IdentityProviderList struct { 1792 autorest.Response `json:"-"` 1793 // Value - Identity Provider configuration values. 1794 Value *[]IdentityProviderContract `json:"value,omitempty"` 1795 // Count - Total number of identity providers 1796 Count *int32 `json:"count,omitempty"` 1797} 1798 1799// IdentityProviderUpdateParameters parameters supplied to the Update Identity Provider operation. 1800type IdentityProviderUpdateParameters struct { 1801 // ClientID - Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google login, App ID for Microsoft. 1802 ClientID *string `json:"clientId,omitempty"` 1803 // ClientSecret - Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is App Secret for Facebook login, API Key for Google login, Public Key for Microsoft. 1804 ClientSecret *string `json:"clientSecret,omitempty"` 1805 // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' 1806 Type IdentityProviderType `json:"type,omitempty"` 1807 // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. 1808 AllowedTenants *[]string `json:"allowedTenants,omitempty"` 1809 // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. 1810 SignupPolicyName *string `json:"signupPolicyName,omitempty"` 1811 // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. 1812 SigninPolicyName *string `json:"signinPolicyName,omitempty"` 1813 // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. 1814 ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` 1815 // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. 1816 PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` 1817} 1818 1819// LoggerCollection paged Logger list representation. 1820type LoggerCollection struct { 1821 autorest.Response `json:"-"` 1822 // Value - Logger values. 1823 Value *[]LoggerContract `json:"value,omitempty"` 1824 // Count - Total record count number across all pages. 1825 Count *int64 `json:"count,omitempty"` 1826 // NextLink - Next page link if any. 1827 NextLink *string `json:"nextLink,omitempty"` 1828} 1829 1830// LoggerCollectionIterator provides access to a complete listing of LoggerContract values. 1831type LoggerCollectionIterator struct { 1832 i int 1833 page LoggerCollectionPage 1834} 1835 1836// NextWithContext advances to the next value. If there was an error making 1837// the request the iterator does not advance and the error is returned. 1838func (iter *LoggerCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1839 if tracing.IsEnabled() { 1840 ctx = tracing.StartSpan(ctx, fqdn+"/LoggerCollectionIterator.NextWithContext") 1841 defer func() { 1842 sc := -1 1843 if iter.Response().Response.Response != nil { 1844 sc = iter.Response().Response.Response.StatusCode 1845 } 1846 tracing.EndSpan(ctx, sc, err) 1847 }() 1848 } 1849 iter.i++ 1850 if iter.i < len(iter.page.Values()) { 1851 return nil 1852 } 1853 err = iter.page.NextWithContext(ctx) 1854 if err != nil { 1855 iter.i-- 1856 return err 1857 } 1858 iter.i = 0 1859 return nil 1860} 1861 1862// Next advances to the next value. If there was an error making 1863// the request the iterator does not advance and the error is returned. 1864// Deprecated: Use NextWithContext() instead. 1865func (iter *LoggerCollectionIterator) Next() error { 1866 return iter.NextWithContext(context.Background()) 1867} 1868 1869// NotDone returns true if the enumeration should be started or is not yet complete. 1870func (iter LoggerCollectionIterator) NotDone() bool { 1871 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1872} 1873 1874// Response returns the raw server response from the last page request. 1875func (iter LoggerCollectionIterator) Response() LoggerCollection { 1876 return iter.page.Response() 1877} 1878 1879// Value returns the current value or a zero-initialized value if the 1880// iterator has advanced beyond the end of the collection. 1881func (iter LoggerCollectionIterator) Value() LoggerContract { 1882 if !iter.page.NotDone() { 1883 return LoggerContract{} 1884 } 1885 return iter.page.Values()[iter.i] 1886} 1887 1888// Creates a new instance of the LoggerCollectionIterator type. 1889func NewLoggerCollectionIterator(page LoggerCollectionPage) LoggerCollectionIterator { 1890 return LoggerCollectionIterator{page: page} 1891} 1892 1893// IsEmpty returns true if the ListResult contains no values. 1894func (lc LoggerCollection) IsEmpty() bool { 1895 return lc.Value == nil || len(*lc.Value) == 0 1896} 1897 1898// hasNextLink returns true if the NextLink is not empty. 1899func (lc LoggerCollection) hasNextLink() bool { 1900 return lc.NextLink != nil && len(*lc.NextLink) != 0 1901} 1902 1903// loggerCollectionPreparer prepares a request to retrieve the next set of results. 1904// It returns nil if no more results exist. 1905func (lc LoggerCollection) loggerCollectionPreparer(ctx context.Context) (*http.Request, error) { 1906 if !lc.hasNextLink() { 1907 return nil, nil 1908 } 1909 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1910 autorest.AsJSON(), 1911 autorest.AsGet(), 1912 autorest.WithBaseURL(to.String(lc.NextLink))) 1913} 1914 1915// LoggerCollectionPage contains a page of LoggerContract values. 1916type LoggerCollectionPage struct { 1917 fn func(context.Context, LoggerCollection) (LoggerCollection, error) 1918 lc LoggerCollection 1919} 1920 1921// NextWithContext advances to the next page of values. If there was an error making 1922// the request the page does not advance and the error is returned. 1923func (page *LoggerCollectionPage) NextWithContext(ctx context.Context) (err error) { 1924 if tracing.IsEnabled() { 1925 ctx = tracing.StartSpan(ctx, fqdn+"/LoggerCollectionPage.NextWithContext") 1926 defer func() { 1927 sc := -1 1928 if page.Response().Response.Response != nil { 1929 sc = page.Response().Response.Response.StatusCode 1930 } 1931 tracing.EndSpan(ctx, sc, err) 1932 }() 1933 } 1934 for { 1935 next, err := page.fn(ctx, page.lc) 1936 if err != nil { 1937 return err 1938 } 1939 page.lc = next 1940 if !next.hasNextLink() || !next.IsEmpty() { 1941 break 1942 } 1943 } 1944 return nil 1945} 1946 1947// Next advances to the next page of values. If there was an error making 1948// the request the page does not advance and the error is returned. 1949// Deprecated: Use NextWithContext() instead. 1950func (page *LoggerCollectionPage) Next() error { 1951 return page.NextWithContext(context.Background()) 1952} 1953 1954// NotDone returns true if the page enumeration should be started or is not yet complete. 1955func (page LoggerCollectionPage) NotDone() bool { 1956 return !page.lc.IsEmpty() 1957} 1958 1959// Response returns the raw server response from the last page request. 1960func (page LoggerCollectionPage) Response() LoggerCollection { 1961 return page.lc 1962} 1963 1964// Values returns the slice of values for the current page or nil if there are no values. 1965func (page LoggerCollectionPage) Values() []LoggerContract { 1966 if page.lc.IsEmpty() { 1967 return nil 1968 } 1969 return *page.lc.Value 1970} 1971 1972// Creates a new instance of the LoggerCollectionPage type. 1973func NewLoggerCollectionPage(cur LoggerCollection, getNextPage func(context.Context, LoggerCollection) (LoggerCollection, error)) LoggerCollectionPage { 1974 return LoggerCollectionPage{ 1975 fn: getNextPage, 1976 lc: cur, 1977 } 1978} 1979 1980// LoggerContract logger details. 1981type LoggerContract struct { 1982 autorest.Response `json:"-"` 1983 // ID - Identifier of the Logger Entity. 1984 ID *string `json:"id,omitempty"` 1985 // LoggerType - Logger type. 1986 LoggerType *string `json:"loggerType,omitempty"` 1987 // Description - Logger description. 1988 Description *string `json:"description,omitempty"` 1989 // Credentials - The name and SendRule connection string of the event hub. 1990 Credentials map[string]*string `json:"credentials"` 1991 // IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true. 1992 IsBuffered *bool `json:"isBuffered,omitempty"` 1993} 1994 1995// MarshalJSON is the custom marshaler for LoggerContract. 1996func (lc LoggerContract) MarshalJSON() ([]byte, error) { 1997 objectMap := make(map[string]interface{}) 1998 if lc.ID != nil { 1999 objectMap["id"] = lc.ID 2000 } 2001 if lc.LoggerType != nil { 2002 objectMap["loggerType"] = lc.LoggerType 2003 } 2004 if lc.Description != nil { 2005 objectMap["description"] = lc.Description 2006 } 2007 if lc.Credentials != nil { 2008 objectMap["credentials"] = lc.Credentials 2009 } 2010 if lc.IsBuffered != nil { 2011 objectMap["isBuffered"] = lc.IsBuffered 2012 } 2013 return json.Marshal(objectMap) 2014} 2015 2016// LoggerContractProperties the Logger entity in API Management represents an event sink that you can use 2017// to log API Management events. Currently the Logger entity supports logging API Management events to 2018// Azure Event Hubs. 2019type LoggerContractProperties struct { 2020 // LoggerType - Logger type. 2021 LoggerType *string `json:"loggerType,omitempty"` 2022 // Description - Logger description. 2023 Description *string `json:"description,omitempty"` 2024 // Credentials - The name and SendRule connection string of the event hub. 2025 Credentials map[string]*string `json:"credentials"` 2026 // IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true. 2027 IsBuffered *bool `json:"isBuffered,omitempty"` 2028} 2029 2030// MarshalJSON is the custom marshaler for LoggerContractProperties. 2031func (lcp LoggerContractProperties) MarshalJSON() ([]byte, error) { 2032 objectMap := make(map[string]interface{}) 2033 if lcp.LoggerType != nil { 2034 objectMap["loggerType"] = lcp.LoggerType 2035 } 2036 if lcp.Description != nil { 2037 objectMap["description"] = lcp.Description 2038 } 2039 if lcp.Credentials != nil { 2040 objectMap["credentials"] = lcp.Credentials 2041 } 2042 if lcp.IsBuffered != nil { 2043 objectMap["isBuffered"] = lcp.IsBuffered 2044 } 2045 return json.Marshal(objectMap) 2046} 2047 2048// LoggerUpdateContract parameters supplied to the Update Logger operation. 2049type LoggerUpdateContract struct { 2050 // LoggerType - Logger type. Possible values include: 'AzureEventHub' 2051 LoggerType LoggerType `json:"loggerType,omitempty"` 2052 // Description - Logger description. 2053 Description *string `json:"description,omitempty"` 2054 // Credentials - Logger credentials. 2055 Credentials map[string]*string `json:"credentials"` 2056 // IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true. 2057 IsBuffered *bool `json:"isBuffered,omitempty"` 2058} 2059 2060// MarshalJSON is the custom marshaler for LoggerUpdateContract. 2061func (luc LoggerUpdateContract) MarshalJSON() ([]byte, error) { 2062 objectMap := make(map[string]interface{}) 2063 if luc.LoggerType != "" { 2064 objectMap["loggerType"] = luc.LoggerType 2065 } 2066 if luc.Description != nil { 2067 objectMap["description"] = luc.Description 2068 } 2069 if luc.Credentials != nil { 2070 objectMap["credentials"] = luc.Credentials 2071 } 2072 if luc.IsBuffered != nil { 2073 objectMap["isBuffered"] = luc.IsBuffered 2074 } 2075 return json.Marshal(objectMap) 2076} 2077 2078// OAuth2AuthenticationSettingsContract API OAuth2 Authentication settings details. 2079type OAuth2AuthenticationSettingsContract struct { 2080 // AuthorizationServerID - OAuth authorization server identifier. 2081 AuthorizationServerID *string `json:"authorizationServerId,omitempty"` 2082 // Scope - operations scope. 2083 Scope *string `json:"scope,omitempty"` 2084} 2085 2086// OpenIDConnectProviderCollection paged OpenIdProviders list representation. 2087type OpenIDConnectProviderCollection struct { 2088 autorest.Response `json:"-"` 2089 // Value - Page values. 2090 Value *[]OpenidConnectProviderContract `json:"value,omitempty"` 2091 // Count - Total number of entities 2092 Count *int32 `json:"count,omitempty"` 2093 // NextLink - Next page link if any. 2094 NextLink *string `json:"nextLink,omitempty"` 2095} 2096 2097// OpenIDConnectProviderCollectionIterator provides access to a complete listing of 2098// OpenidConnectProviderContract values. 2099type OpenIDConnectProviderCollectionIterator struct { 2100 i int 2101 page OpenIDConnectProviderCollectionPage 2102} 2103 2104// NextWithContext advances to the next value. If there was an error making 2105// the request the iterator does not advance and the error is returned. 2106func (iter *OpenIDConnectProviderCollectionIterator) NextWithContext(ctx context.Context) (err error) { 2107 if tracing.IsEnabled() { 2108 ctx = tracing.StartSpan(ctx, fqdn+"/OpenIDConnectProviderCollectionIterator.NextWithContext") 2109 defer func() { 2110 sc := -1 2111 if iter.Response().Response.Response != nil { 2112 sc = iter.Response().Response.Response.StatusCode 2113 } 2114 tracing.EndSpan(ctx, sc, err) 2115 }() 2116 } 2117 iter.i++ 2118 if iter.i < len(iter.page.Values()) { 2119 return nil 2120 } 2121 err = iter.page.NextWithContext(ctx) 2122 if err != nil { 2123 iter.i-- 2124 return err 2125 } 2126 iter.i = 0 2127 return nil 2128} 2129 2130// Next advances to the next value. If there was an error making 2131// the request the iterator does not advance and the error is returned. 2132// Deprecated: Use NextWithContext() instead. 2133func (iter *OpenIDConnectProviderCollectionIterator) Next() error { 2134 return iter.NextWithContext(context.Background()) 2135} 2136 2137// NotDone returns true if the enumeration should be started or is not yet complete. 2138func (iter OpenIDConnectProviderCollectionIterator) NotDone() bool { 2139 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2140} 2141 2142// Response returns the raw server response from the last page request. 2143func (iter OpenIDConnectProviderCollectionIterator) Response() OpenIDConnectProviderCollection { 2144 return iter.page.Response() 2145} 2146 2147// Value returns the current value or a zero-initialized value if the 2148// iterator has advanced beyond the end of the collection. 2149func (iter OpenIDConnectProviderCollectionIterator) Value() OpenidConnectProviderContract { 2150 if !iter.page.NotDone() { 2151 return OpenidConnectProviderContract{} 2152 } 2153 return iter.page.Values()[iter.i] 2154} 2155 2156// Creates a new instance of the OpenIDConnectProviderCollectionIterator type. 2157func NewOpenIDConnectProviderCollectionIterator(page OpenIDConnectProviderCollectionPage) OpenIDConnectProviderCollectionIterator { 2158 return OpenIDConnectProviderCollectionIterator{page: page} 2159} 2160 2161// IsEmpty returns true if the ListResult contains no values. 2162func (oicpc OpenIDConnectProviderCollection) IsEmpty() bool { 2163 return oicpc.Value == nil || len(*oicpc.Value) == 0 2164} 2165 2166// hasNextLink returns true if the NextLink is not empty. 2167func (oicpc OpenIDConnectProviderCollection) hasNextLink() bool { 2168 return oicpc.NextLink != nil && len(*oicpc.NextLink) != 0 2169} 2170 2171// openIDConnectProviderCollectionPreparer prepares a request to retrieve the next set of results. 2172// It returns nil if no more results exist. 2173func (oicpc OpenIDConnectProviderCollection) openIDConnectProviderCollectionPreparer(ctx context.Context) (*http.Request, error) { 2174 if !oicpc.hasNextLink() { 2175 return nil, nil 2176 } 2177 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2178 autorest.AsJSON(), 2179 autorest.AsGet(), 2180 autorest.WithBaseURL(to.String(oicpc.NextLink))) 2181} 2182 2183// OpenIDConnectProviderCollectionPage contains a page of OpenidConnectProviderContract values. 2184type OpenIDConnectProviderCollectionPage struct { 2185 fn func(context.Context, OpenIDConnectProviderCollection) (OpenIDConnectProviderCollection, error) 2186 oicpc OpenIDConnectProviderCollection 2187} 2188 2189// NextWithContext advances to the next page of values. If there was an error making 2190// the request the page does not advance and the error is returned. 2191func (page *OpenIDConnectProviderCollectionPage) NextWithContext(ctx context.Context) (err error) { 2192 if tracing.IsEnabled() { 2193 ctx = tracing.StartSpan(ctx, fqdn+"/OpenIDConnectProviderCollectionPage.NextWithContext") 2194 defer func() { 2195 sc := -1 2196 if page.Response().Response.Response != nil { 2197 sc = page.Response().Response.Response.StatusCode 2198 } 2199 tracing.EndSpan(ctx, sc, err) 2200 }() 2201 } 2202 for { 2203 next, err := page.fn(ctx, page.oicpc) 2204 if err != nil { 2205 return err 2206 } 2207 page.oicpc = next 2208 if !next.hasNextLink() || !next.IsEmpty() { 2209 break 2210 } 2211 } 2212 return nil 2213} 2214 2215// Next advances to the next page of values. If there was an error making 2216// the request the page does not advance and the error is returned. 2217// Deprecated: Use NextWithContext() instead. 2218func (page *OpenIDConnectProviderCollectionPage) Next() error { 2219 return page.NextWithContext(context.Background()) 2220} 2221 2222// NotDone returns true if the page enumeration should be started or is not yet complete. 2223func (page OpenIDConnectProviderCollectionPage) NotDone() bool { 2224 return !page.oicpc.IsEmpty() 2225} 2226 2227// Response returns the raw server response from the last page request. 2228func (page OpenIDConnectProviderCollectionPage) Response() OpenIDConnectProviderCollection { 2229 return page.oicpc 2230} 2231 2232// Values returns the slice of values for the current page or nil if there are no values. 2233func (page OpenIDConnectProviderCollectionPage) Values() []OpenidConnectProviderContract { 2234 if page.oicpc.IsEmpty() { 2235 return nil 2236 } 2237 return *page.oicpc.Value 2238} 2239 2240// Creates a new instance of the OpenIDConnectProviderCollectionPage type. 2241func NewOpenIDConnectProviderCollectionPage(cur OpenIDConnectProviderCollection, getNextPage func(context.Context, OpenIDConnectProviderCollection) (OpenIDConnectProviderCollection, error)) OpenIDConnectProviderCollectionPage { 2242 return OpenIDConnectProviderCollectionPage{ 2243 fn: getNextPage, 2244 oicpc: cur, 2245 } 2246} 2247 2248// OpenidConnectProviderContract openId Connect Provider details. 2249type OpenidConnectProviderContract struct { 2250 autorest.Response `json:"-"` 2251 // ID - Identifier of the OpenId Connect Provider. 2252 ID *string `json:"id,omitempty"` 2253 // Name - User-friendly OpenID Connect Provider name. 2254 Name *string `json:"name,omitempty"` 2255 // Description - User-friendly description of OpenID Connect Provider. 2256 Description *string `json:"description,omitempty"` 2257 // MetadataEndpoint - Metadata endpoint URI. 2258 MetadataEndpoint *string `json:"metadataEndpoint,omitempty"` 2259 // ClientID - Client ID of developer console which is the client application. 2260 ClientID *string `json:"clientId,omitempty"` 2261 // ClientSecret - Client Secret of developer console which is the client application. 2262 ClientSecret *string `json:"clientSecret,omitempty"` 2263} 2264 2265// OpenidConnectProviderContractProperties openID Connect Providers Contract. 2266type OpenidConnectProviderContractProperties struct { 2267 // Name - User-friendly OpenID Connect Provider name. 2268 Name *string `json:"name,omitempty"` 2269 // Description - User-friendly description of OpenID Connect Provider. 2270 Description *string `json:"description,omitempty"` 2271 // MetadataEndpoint - Metadata endpoint URI. 2272 MetadataEndpoint *string `json:"metadataEndpoint,omitempty"` 2273 // ClientID - Client ID of developer console which is the client application. 2274 ClientID *string `json:"clientId,omitempty"` 2275 // ClientSecret - Client Secret of developer console which is the client application. 2276 ClientSecret *string `json:"clientSecret,omitempty"` 2277} 2278 2279// OpenidConnectProviderUpdateContract parameters supplied to the Update OpenID Connect Provider operation. 2280type OpenidConnectProviderUpdateContract struct { 2281 // Name - User-friendly OpenID Connect Provider name. 2282 Name *string `json:"name,omitempty"` 2283 // Description - User-friendly description of OpenID Connect Provider. 2284 Description *string `json:"description,omitempty"` 2285 // MetadataEndpoint - Metadata endpoint URI. 2286 MetadataEndpoint *string `json:"metadataEndpoint,omitempty"` 2287 // ClientID - Client ID of developer console which is the client application. 2288 ClientID *string `json:"clientId,omitempty"` 2289 // ClientSecret - Client Secret of developer console which is the client application. 2290 ClientSecret *string `json:"clientSecret,omitempty"` 2291} 2292 2293// OperationCollection paged Operation list representation. 2294type OperationCollection struct { 2295 autorest.Response `json:"-"` 2296 // Value - Page values. 2297 Value *[]OperationContract `json:"value,omitempty"` 2298 // Count - Total number of entities 2299 Count *int32 `json:"count,omitempty"` 2300 // NextLink - Next page link if any. 2301 NextLink *string `json:"nextLink,omitempty"` 2302} 2303 2304// OperationCollectionIterator provides access to a complete listing of OperationContract values. 2305type OperationCollectionIterator struct { 2306 i int 2307 page OperationCollectionPage 2308} 2309 2310// NextWithContext advances to the next value. If there was an error making 2311// the request the iterator does not advance and the error is returned. 2312func (iter *OperationCollectionIterator) NextWithContext(ctx context.Context) (err error) { 2313 if tracing.IsEnabled() { 2314 ctx = tracing.StartSpan(ctx, fqdn+"/OperationCollectionIterator.NextWithContext") 2315 defer func() { 2316 sc := -1 2317 if iter.Response().Response.Response != nil { 2318 sc = iter.Response().Response.Response.StatusCode 2319 } 2320 tracing.EndSpan(ctx, sc, err) 2321 }() 2322 } 2323 iter.i++ 2324 if iter.i < len(iter.page.Values()) { 2325 return nil 2326 } 2327 err = iter.page.NextWithContext(ctx) 2328 if err != nil { 2329 iter.i-- 2330 return err 2331 } 2332 iter.i = 0 2333 return nil 2334} 2335 2336// Next advances to the next value. If there was an error making 2337// the request the iterator does not advance and the error is returned. 2338// Deprecated: Use NextWithContext() instead. 2339func (iter *OperationCollectionIterator) Next() error { 2340 return iter.NextWithContext(context.Background()) 2341} 2342 2343// NotDone returns true if the enumeration should be started or is not yet complete. 2344func (iter OperationCollectionIterator) NotDone() bool { 2345 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2346} 2347 2348// Response returns the raw server response from the last page request. 2349func (iter OperationCollectionIterator) Response() OperationCollection { 2350 return iter.page.Response() 2351} 2352 2353// Value returns the current value or a zero-initialized value if the 2354// iterator has advanced beyond the end of the collection. 2355func (iter OperationCollectionIterator) Value() OperationContract { 2356 if !iter.page.NotDone() { 2357 return OperationContract{} 2358 } 2359 return iter.page.Values()[iter.i] 2360} 2361 2362// Creates a new instance of the OperationCollectionIterator type. 2363func NewOperationCollectionIterator(page OperationCollectionPage) OperationCollectionIterator { 2364 return OperationCollectionIterator{page: page} 2365} 2366 2367// IsEmpty returns true if the ListResult contains no values. 2368func (oc OperationCollection) IsEmpty() bool { 2369 return oc.Value == nil || len(*oc.Value) == 0 2370} 2371 2372// hasNextLink returns true if the NextLink is not empty. 2373func (oc OperationCollection) hasNextLink() bool { 2374 return oc.NextLink != nil && len(*oc.NextLink) != 0 2375} 2376 2377// operationCollectionPreparer prepares a request to retrieve the next set of results. 2378// It returns nil if no more results exist. 2379func (oc OperationCollection) operationCollectionPreparer(ctx context.Context) (*http.Request, error) { 2380 if !oc.hasNextLink() { 2381 return nil, nil 2382 } 2383 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2384 autorest.AsJSON(), 2385 autorest.AsGet(), 2386 autorest.WithBaseURL(to.String(oc.NextLink))) 2387} 2388 2389// OperationCollectionPage contains a page of OperationContract values. 2390type OperationCollectionPage struct { 2391 fn func(context.Context, OperationCollection) (OperationCollection, error) 2392 oc OperationCollection 2393} 2394 2395// NextWithContext advances to the next page of values. If there was an error making 2396// the request the page does not advance and the error is returned. 2397func (page *OperationCollectionPage) NextWithContext(ctx context.Context) (err error) { 2398 if tracing.IsEnabled() { 2399 ctx = tracing.StartSpan(ctx, fqdn+"/OperationCollectionPage.NextWithContext") 2400 defer func() { 2401 sc := -1 2402 if page.Response().Response.Response != nil { 2403 sc = page.Response().Response.Response.StatusCode 2404 } 2405 tracing.EndSpan(ctx, sc, err) 2406 }() 2407 } 2408 for { 2409 next, err := page.fn(ctx, page.oc) 2410 if err != nil { 2411 return err 2412 } 2413 page.oc = next 2414 if !next.hasNextLink() || !next.IsEmpty() { 2415 break 2416 } 2417 } 2418 return nil 2419} 2420 2421// Next advances to the next page of values. If there was an error making 2422// the request the page does not advance and the error is returned. 2423// Deprecated: Use NextWithContext() instead. 2424func (page *OperationCollectionPage) Next() error { 2425 return page.NextWithContext(context.Background()) 2426} 2427 2428// NotDone returns true if the page enumeration should be started or is not yet complete. 2429func (page OperationCollectionPage) NotDone() bool { 2430 return !page.oc.IsEmpty() 2431} 2432 2433// Response returns the raw server response from the last page request. 2434func (page OperationCollectionPage) Response() OperationCollection { 2435 return page.oc 2436} 2437 2438// Values returns the slice of values for the current page or nil if there are no values. 2439func (page OperationCollectionPage) Values() []OperationContract { 2440 if page.oc.IsEmpty() { 2441 return nil 2442 } 2443 return *page.oc.Value 2444} 2445 2446// Creates a new instance of the OperationCollectionPage type. 2447func NewOperationCollectionPage(cur OperationCollection, getNextPage func(context.Context, OperationCollection) (OperationCollection, error)) OperationCollectionPage { 2448 return OperationCollectionPage{ 2449 fn: getNextPage, 2450 oc: cur, 2451 } 2452} 2453 2454// OperationContract api Operation details. 2455type OperationContract struct { 2456 autorest.Response `json:"-"` 2457 // ID - Identifier of the Operation. 2458 ID *string `json:"id,omitempty"` 2459 // Name - Operation Name. 2460 Name *string `json:"name,omitempty"` 2461 // Method - A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. 2462 Method *string `json:"method,omitempty"` 2463 // URLTemplate - Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} 2464 URLTemplate *string `json:"urlTemplate,omitempty"` 2465 // TemplateParameters - Collection of URL template parameters. 2466 TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"` 2467 // Description - Description of the operation. May include HTML formatting tags. 2468 Description *string `json:"description,omitempty"` 2469 // Request - An entity containing request details. 2470 Request *RequestContract `json:"request,omitempty"` 2471 // Responses - Array of Operation responses. 2472 Responses *[]ResponseContract `json:"responses,omitempty"` 2473 // Policies - Operation Policies 2474 Policies *string `json:"policies,omitempty"` 2475} 2476 2477// OperationContractProperties operation Contract Properties 2478type OperationContractProperties struct { 2479 // Name - Operation Name. 2480 Name *string `json:"name,omitempty"` 2481 // Method - A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. 2482 Method *string `json:"method,omitempty"` 2483 // URLTemplate - Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} 2484 URLTemplate *string `json:"urlTemplate,omitempty"` 2485 // TemplateParameters - Collection of URL template parameters. 2486 TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"` 2487 // Description - Description of the operation. May include HTML formatting tags. 2488 Description *string `json:"description,omitempty"` 2489 // Request - An entity containing request details. 2490 Request *RequestContract `json:"request,omitempty"` 2491 // Responses - Array of Operation responses. 2492 Responses *[]ResponseContract `json:"responses,omitempty"` 2493 // Policies - Operation Policies 2494 Policies *string `json:"policies,omitempty"` 2495} 2496 2497// OperationEntityBaseContract api Operation Entity Base Contract details. 2498type OperationEntityBaseContract struct { 2499 // TemplateParameters - Collection of URL template parameters. 2500 TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"` 2501 // Description - Description of the operation. May include HTML formatting tags. 2502 Description *string `json:"description,omitempty"` 2503 // Request - An entity containing request details. 2504 Request *RequestContract `json:"request,omitempty"` 2505 // Responses - Array of Operation responses. 2506 Responses *[]ResponseContract `json:"responses,omitempty"` 2507 // Policies - Operation Policies 2508 Policies *string `json:"policies,omitempty"` 2509} 2510 2511// OperationResultContract operation Result. 2512type OperationResultContract struct { 2513 autorest.Response `json:"-"` 2514 // ID - Operation result identifier. 2515 ID *string `json:"id,omitempty"` 2516 // Status - Status of an async operation. Possible values include: 'Started', 'InProgress', 'Succeeded', 'Failed' 2517 Status AsyncOperationStatus `json:"status,omitempty"` 2518 // Started - Start time of an async operation. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 2519 Started *date.Time `json:"started,omitempty"` 2520 // Updated - Last update time of an async operation. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 2521 Updated *date.Time `json:"updated,omitempty"` 2522 // ResultInfo - Optional result info. 2523 ResultInfo *string `json:"resultInfo,omitempty"` 2524 // Error - Error Body Contract 2525 Error *ErrorResponse `json:"error,omitempty"` 2526 // ActionLog - READ-ONLY; This property if only provided as part of the TenantConfiguration_Validate operation. It contains the log the entities which will be updated/created/deleted as part of the TenantConfiguration_Deploy operation. 2527 ActionLog *[]OperationResultLogItemContract `json:"actionLog,omitempty"` 2528} 2529 2530// MarshalJSON is the custom marshaler for OperationResultContract. 2531func (orc OperationResultContract) MarshalJSON() ([]byte, error) { 2532 objectMap := make(map[string]interface{}) 2533 if orc.ID != nil { 2534 objectMap["id"] = orc.ID 2535 } 2536 if orc.Status != "" { 2537 objectMap["status"] = orc.Status 2538 } 2539 if orc.Started != nil { 2540 objectMap["started"] = orc.Started 2541 } 2542 if orc.Updated != nil { 2543 objectMap["updated"] = orc.Updated 2544 } 2545 if orc.ResultInfo != nil { 2546 objectMap["resultInfo"] = orc.ResultInfo 2547 } 2548 if orc.Error != nil { 2549 objectMap["error"] = orc.Error 2550 } 2551 return json.Marshal(objectMap) 2552} 2553 2554// OperationResultLogItemContract log of the entity being created, updated or deleted. 2555type OperationResultLogItemContract struct { 2556 // ObjectType - The type of entity contract. 2557 ObjectType *string `json:"objectType,omitempty"` 2558 // Action - Action like create/update/delete. 2559 Action *string `json:"action,omitempty"` 2560 // ObjectKey - Identifier of the entity being created/updated/deleted. 2561 ObjectKey *string `json:"objectKey,omitempty"` 2562} 2563 2564// OperationUpdateContract operation Update Contract Properties. 2565type OperationUpdateContract struct { 2566 // Name - Operation Name. 2567 Name *string `json:"name,omitempty"` 2568 // Method - A Valid HTTP Operation Method. Typical Http Methods like GET, PUT, POST but not limited by only them. 2569 Method *string `json:"method,omitempty"` 2570 // URLTemplate - Relative URL template identifying the target resource for this operation. May include parameters. Example: /customers/{cid}/orders/{oid}/?date={date} 2571 URLTemplate *string `json:"urlTemplate,omitempty"` 2572 // TemplateParameters - Collection of URL template parameters. 2573 TemplateParameters *[]ParameterContract `json:"templateParameters,omitempty"` 2574 // Description - Description of the operation. May include HTML formatting tags. 2575 Description *string `json:"description,omitempty"` 2576 // Request - An entity containing request details. 2577 Request *RequestContract `json:"request,omitempty"` 2578 // Responses - Array of Operation responses. 2579 Responses *[]ResponseContract `json:"responses,omitempty"` 2580 // Policies - Operation Policies 2581 Policies *string `json:"policies,omitempty"` 2582} 2583 2584// ParameterContract operation parameters details. 2585type ParameterContract struct { 2586 // Name - Parameter name. 2587 Name *string `json:"name,omitempty"` 2588 // Description - Parameter description. 2589 Description *string `json:"description,omitempty"` 2590 // Type - Parameter type. 2591 Type *string `json:"type,omitempty"` 2592 // DefaultValue - Default parameter value. 2593 DefaultValue *string `json:"defaultValue,omitempty"` 2594 // Required - whether parameter is required or not. 2595 Required *bool `json:"required,omitempty"` 2596 // Values - Parameter values. 2597 Values *[]string `json:"values,omitempty"` 2598} 2599 2600// PolicyCollection the response of the list policy operation. 2601type PolicyCollection struct { 2602 autorest.Response `json:"-"` 2603 // Value - Policy Contract value. 2604 Value *[]PolicyContract `json:"value,omitempty"` 2605 // Count - Total number of records 2606 Count *int32 `json:"count,omitempty"` 2607 // NextLink - Next page link if any. 2608 NextLink *string `json:"nextLink,omitempty"` 2609} 2610 2611// PolicyContract policy contract Properties. 2612type PolicyContract struct { 2613 autorest.Response `json:"-"` 2614 // ID - Policy identifier. 2615 ID *string `json:"id,omitempty"` 2616 // PolicyContent - Json escaped Xml Encoded contents of the Policy. 2617 PolicyContent *string `json:"policyContent,omitempty"` 2618} 2619 2620// PolicySnippetContract policy snippet. 2621type PolicySnippetContract struct { 2622 // Name - READ-ONLY; Snippet name. 2623 Name *string `json:"name,omitempty"` 2624 // Content - READ-ONLY; Snippet content. 2625 Content *string `json:"content,omitempty"` 2626 // ToolTip - READ-ONLY; Snippet toolTip. 2627 ToolTip *string `json:"toolTip,omitempty"` 2628 // Scope - READ-ONLY; Binary OR value of the Snippet scope. 2629 Scope *int32 `json:"scope,omitempty"` 2630} 2631 2632// MarshalJSON is the custom marshaler for PolicySnippetContract. 2633func (psc PolicySnippetContract) MarshalJSON() ([]byte, error) { 2634 objectMap := make(map[string]interface{}) 2635 return json.Marshal(objectMap) 2636} 2637 2638// PolicySnippetsCollection the response of the list policy snippets operation. 2639type PolicySnippetsCollection struct { 2640 autorest.Response `json:"-"` 2641 // Value - Policy snippet value. 2642 Value *[]PolicySnippetContract `json:"value,omitempty"` 2643} 2644 2645// PortalDelegationSettings delegation settings for a developer portal. 2646type PortalDelegationSettings struct { 2647 autorest.Response `json:"-"` 2648 // URL - A delegation Url. 2649 URL *string `json:"url,omitempty"` 2650 // ValidationKey - A base64-encoded validation key to validate, that a request is coming from Azure API Management. 2651 ValidationKey *string `json:"validationKey,omitempty"` 2652 // Subscriptions - Subscriptions delegation settings. 2653 Subscriptions *SubscriptionsDelegationSettingsProperties `json:"subscriptions,omitempty"` 2654 // UserRegistration - User registration delegation settings. 2655 UserRegistration *RegistrationDelegationSettingsProperties `json:"userRegistration,omitempty"` 2656} 2657 2658// PortalSigninSettings sign-In settings for the Developer Portal. 2659type PortalSigninSettings struct { 2660 autorest.Response `json:"-"` 2661 // Enabled - Redirect Anonymous users to the Sign-In page. 2662 Enabled *bool `json:"enabled,omitempty"` 2663} 2664 2665// PortalSignupSettings sign-up settings contract properties. 2666type PortalSignupSettings struct { 2667 autorest.Response `json:"-"` 2668 // Enabled - Allow users to sign up on a developer portal. 2669 Enabled *bool `json:"enabled,omitempty"` 2670 // TermsOfService - Terms of service contract properties. 2671 TermsOfService *TermsOfServiceProperties `json:"termsOfService,omitempty"` 2672} 2673 2674// ProductCollection paged Products list representation. 2675type ProductCollection struct { 2676 autorest.Response `json:"-"` 2677 // Value - Page values. 2678 Value *[]ProductContract `json:"value,omitempty"` 2679 // Count - Total number of entities 2680 Count *int32 `json:"count,omitempty"` 2681 // NextLink - Next page link if any. 2682 NextLink *string `json:"nextLink,omitempty"` 2683} 2684 2685// ProductCollectionIterator provides access to a complete listing of ProductContract values. 2686type ProductCollectionIterator struct { 2687 i int 2688 page ProductCollectionPage 2689} 2690 2691// NextWithContext advances to the next value. If there was an error making 2692// the request the iterator does not advance and the error is returned. 2693func (iter *ProductCollectionIterator) NextWithContext(ctx context.Context) (err error) { 2694 if tracing.IsEnabled() { 2695 ctx = tracing.StartSpan(ctx, fqdn+"/ProductCollectionIterator.NextWithContext") 2696 defer func() { 2697 sc := -1 2698 if iter.Response().Response.Response != nil { 2699 sc = iter.Response().Response.Response.StatusCode 2700 } 2701 tracing.EndSpan(ctx, sc, err) 2702 }() 2703 } 2704 iter.i++ 2705 if iter.i < len(iter.page.Values()) { 2706 return nil 2707 } 2708 err = iter.page.NextWithContext(ctx) 2709 if err != nil { 2710 iter.i-- 2711 return err 2712 } 2713 iter.i = 0 2714 return nil 2715} 2716 2717// Next advances to the next value. If there was an error making 2718// the request the iterator does not advance and the error is returned. 2719// Deprecated: Use NextWithContext() instead. 2720func (iter *ProductCollectionIterator) Next() error { 2721 return iter.NextWithContext(context.Background()) 2722} 2723 2724// NotDone returns true if the enumeration should be started or is not yet complete. 2725func (iter ProductCollectionIterator) NotDone() bool { 2726 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2727} 2728 2729// Response returns the raw server response from the last page request. 2730func (iter ProductCollectionIterator) Response() ProductCollection { 2731 return iter.page.Response() 2732} 2733 2734// Value returns the current value or a zero-initialized value if the 2735// iterator has advanced beyond the end of the collection. 2736func (iter ProductCollectionIterator) Value() ProductContract { 2737 if !iter.page.NotDone() { 2738 return ProductContract{} 2739 } 2740 return iter.page.Values()[iter.i] 2741} 2742 2743// Creates a new instance of the ProductCollectionIterator type. 2744func NewProductCollectionIterator(page ProductCollectionPage) ProductCollectionIterator { 2745 return ProductCollectionIterator{page: page} 2746} 2747 2748// IsEmpty returns true if the ListResult contains no values. 2749func (pc ProductCollection) IsEmpty() bool { 2750 return pc.Value == nil || len(*pc.Value) == 0 2751} 2752 2753// hasNextLink returns true if the NextLink is not empty. 2754func (pc ProductCollection) hasNextLink() bool { 2755 return pc.NextLink != nil && len(*pc.NextLink) != 0 2756} 2757 2758// productCollectionPreparer prepares a request to retrieve the next set of results. 2759// It returns nil if no more results exist. 2760func (pc ProductCollection) productCollectionPreparer(ctx context.Context) (*http.Request, error) { 2761 if !pc.hasNextLink() { 2762 return nil, nil 2763 } 2764 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2765 autorest.AsJSON(), 2766 autorest.AsGet(), 2767 autorest.WithBaseURL(to.String(pc.NextLink))) 2768} 2769 2770// ProductCollectionPage contains a page of ProductContract values. 2771type ProductCollectionPage struct { 2772 fn func(context.Context, ProductCollection) (ProductCollection, error) 2773 pc ProductCollection 2774} 2775 2776// NextWithContext advances to the next page of values. If there was an error making 2777// the request the page does not advance and the error is returned. 2778func (page *ProductCollectionPage) NextWithContext(ctx context.Context) (err error) { 2779 if tracing.IsEnabled() { 2780 ctx = tracing.StartSpan(ctx, fqdn+"/ProductCollectionPage.NextWithContext") 2781 defer func() { 2782 sc := -1 2783 if page.Response().Response.Response != nil { 2784 sc = page.Response().Response.Response.StatusCode 2785 } 2786 tracing.EndSpan(ctx, sc, err) 2787 }() 2788 } 2789 for { 2790 next, err := page.fn(ctx, page.pc) 2791 if err != nil { 2792 return err 2793 } 2794 page.pc = next 2795 if !next.hasNextLink() || !next.IsEmpty() { 2796 break 2797 } 2798 } 2799 return nil 2800} 2801 2802// Next advances to the next page of values. If there was an error making 2803// the request the page does not advance and the error is returned. 2804// Deprecated: Use NextWithContext() instead. 2805func (page *ProductCollectionPage) Next() error { 2806 return page.NextWithContext(context.Background()) 2807} 2808 2809// NotDone returns true if the page enumeration should be started or is not yet complete. 2810func (page ProductCollectionPage) NotDone() bool { 2811 return !page.pc.IsEmpty() 2812} 2813 2814// Response returns the raw server response from the last page request. 2815func (page ProductCollectionPage) Response() ProductCollection { 2816 return page.pc 2817} 2818 2819// Values returns the slice of values for the current page or nil if there are no values. 2820func (page ProductCollectionPage) Values() []ProductContract { 2821 if page.pc.IsEmpty() { 2822 return nil 2823 } 2824 return *page.pc.Value 2825} 2826 2827// Creates a new instance of the ProductCollectionPage type. 2828func NewProductCollectionPage(cur ProductCollection, getNextPage func(context.Context, ProductCollection) (ProductCollection, error)) ProductCollectionPage { 2829 return ProductCollectionPage{ 2830 fn: getNextPage, 2831 pc: cur, 2832 } 2833} 2834 2835// ProductContract product details. 2836type ProductContract struct { 2837 autorest.Response `json:"-"` 2838 // ID - Identifier of the Product entity. 2839 ID *string `json:"id,omitempty"` 2840 // Name - Product name. 2841 Name *string `json:"name,omitempty"` 2842 // Description - Product description. May include HTML formatting tags. 2843 Description *string `json:"description,omitempty"` 2844 // Terms - Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms before they can complete the subscription process. 2845 Terms *string `json:"terms,omitempty"` 2846 // SubscriptionRequired - Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription key. If property is omitted when creating a new product it's value is assumed to be true. 2847 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 2848 // ApprovalRequired - whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of true. 2849 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 2850 // SubscriptionsLimit - Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of true. 2851 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 2852 // State - whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: 'NotPublished', 'Published' 2853 State ProductState `json:"state,omitempty"` 2854} 2855 2856// ProductContractProperties product profile. 2857type ProductContractProperties struct { 2858 // Name - Product name. 2859 Name *string `json:"name,omitempty"` 2860 // Description - Product description. May include HTML formatting tags. 2861 Description *string `json:"description,omitempty"` 2862 // Terms - Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms before they can complete the subscription process. 2863 Terms *string `json:"terms,omitempty"` 2864 // SubscriptionRequired - Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription key. If property is omitted when creating a new product it's value is assumed to be true. 2865 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 2866 // ApprovalRequired - whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of true. 2867 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 2868 // SubscriptionsLimit - Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of true. 2869 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 2870 // State - whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: 'NotPublished', 'Published' 2871 State ProductState `json:"state,omitempty"` 2872} 2873 2874// ProductEntityBaseParameters product Entity Base Parameters 2875type ProductEntityBaseParameters struct { 2876 // Description - Product description. May include HTML formatting tags. 2877 Description *string `json:"description,omitempty"` 2878 // Terms - Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms before they can complete the subscription process. 2879 Terms *string `json:"terms,omitempty"` 2880 // SubscriptionRequired - Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription key. If property is omitted when creating a new product it's value is assumed to be true. 2881 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 2882 // ApprovalRequired - whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of true. 2883 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 2884 // SubscriptionsLimit - Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of true. 2885 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 2886 // State - whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: 'NotPublished', 'Published' 2887 State ProductState `json:"state,omitempty"` 2888} 2889 2890// ProductUpdateParameters parameters supplied to the Update Product operation. 2891type ProductUpdateParameters struct { 2892 // Name - Product name. 2893 Name *string `json:"name,omitempty"` 2894 // Description - Product description. May include HTML formatting tags. 2895 Description *string `json:"description,omitempty"` 2896 // Terms - Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms before they can complete the subscription process. 2897 Terms *string `json:"terms,omitempty"` 2898 // SubscriptionRequired - Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription key. If property is omitted when creating a new product it's value is assumed to be true. 2899 SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` 2900 // ApprovalRequired - whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of true. 2901 ApprovalRequired *bool `json:"approvalRequired,omitempty"` 2902 // SubscriptionsLimit - Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of true. 2903 SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` 2904 // State - whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: 'NotPublished', 'Published' 2905 State ProductState `json:"state,omitempty"` 2906} 2907 2908// PropertyCollection paged Property list representation. 2909type PropertyCollection struct { 2910 autorest.Response `json:"-"` 2911 // Value - Page values. 2912 Value *[]PropertyContract `json:"value,omitempty"` 2913 // Count - Total number of entities 2914 Count *int32 `json:"count,omitempty"` 2915 // NextLink - Next page link if any. 2916 NextLink *string `json:"nextLink,omitempty"` 2917} 2918 2919// PropertyCollectionIterator provides access to a complete listing of PropertyContract values. 2920type PropertyCollectionIterator struct { 2921 i int 2922 page PropertyCollectionPage 2923} 2924 2925// NextWithContext advances to the next value. If there was an error making 2926// the request the iterator does not advance and the error is returned. 2927func (iter *PropertyCollectionIterator) NextWithContext(ctx context.Context) (err error) { 2928 if tracing.IsEnabled() { 2929 ctx = tracing.StartSpan(ctx, fqdn+"/PropertyCollectionIterator.NextWithContext") 2930 defer func() { 2931 sc := -1 2932 if iter.Response().Response.Response != nil { 2933 sc = iter.Response().Response.Response.StatusCode 2934 } 2935 tracing.EndSpan(ctx, sc, err) 2936 }() 2937 } 2938 iter.i++ 2939 if iter.i < len(iter.page.Values()) { 2940 return nil 2941 } 2942 err = iter.page.NextWithContext(ctx) 2943 if err != nil { 2944 iter.i-- 2945 return err 2946 } 2947 iter.i = 0 2948 return nil 2949} 2950 2951// Next advances to the next value. If there was an error making 2952// the request the iterator does not advance and the error is returned. 2953// Deprecated: Use NextWithContext() instead. 2954func (iter *PropertyCollectionIterator) Next() error { 2955 return iter.NextWithContext(context.Background()) 2956} 2957 2958// NotDone returns true if the enumeration should be started or is not yet complete. 2959func (iter PropertyCollectionIterator) NotDone() bool { 2960 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2961} 2962 2963// Response returns the raw server response from the last page request. 2964func (iter PropertyCollectionIterator) Response() PropertyCollection { 2965 return iter.page.Response() 2966} 2967 2968// Value returns the current value or a zero-initialized value if the 2969// iterator has advanced beyond the end of the collection. 2970func (iter PropertyCollectionIterator) Value() PropertyContract { 2971 if !iter.page.NotDone() { 2972 return PropertyContract{} 2973 } 2974 return iter.page.Values()[iter.i] 2975} 2976 2977// Creates a new instance of the PropertyCollectionIterator type. 2978func NewPropertyCollectionIterator(page PropertyCollectionPage) PropertyCollectionIterator { 2979 return PropertyCollectionIterator{page: page} 2980} 2981 2982// IsEmpty returns true if the ListResult contains no values. 2983func (pc PropertyCollection) IsEmpty() bool { 2984 return pc.Value == nil || len(*pc.Value) == 0 2985} 2986 2987// hasNextLink returns true if the NextLink is not empty. 2988func (pc PropertyCollection) hasNextLink() bool { 2989 return pc.NextLink != nil && len(*pc.NextLink) != 0 2990} 2991 2992// propertyCollectionPreparer prepares a request to retrieve the next set of results. 2993// It returns nil if no more results exist. 2994func (pc PropertyCollection) propertyCollectionPreparer(ctx context.Context) (*http.Request, error) { 2995 if !pc.hasNextLink() { 2996 return nil, nil 2997 } 2998 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2999 autorest.AsJSON(), 3000 autorest.AsGet(), 3001 autorest.WithBaseURL(to.String(pc.NextLink))) 3002} 3003 3004// PropertyCollectionPage contains a page of PropertyContract values. 3005type PropertyCollectionPage struct { 3006 fn func(context.Context, PropertyCollection) (PropertyCollection, error) 3007 pc PropertyCollection 3008} 3009 3010// NextWithContext advances to the next page of values. If there was an error making 3011// the request the page does not advance and the error is returned. 3012func (page *PropertyCollectionPage) NextWithContext(ctx context.Context) (err error) { 3013 if tracing.IsEnabled() { 3014 ctx = tracing.StartSpan(ctx, fqdn+"/PropertyCollectionPage.NextWithContext") 3015 defer func() { 3016 sc := -1 3017 if page.Response().Response.Response != nil { 3018 sc = page.Response().Response.Response.StatusCode 3019 } 3020 tracing.EndSpan(ctx, sc, err) 3021 }() 3022 } 3023 for { 3024 next, err := page.fn(ctx, page.pc) 3025 if err != nil { 3026 return err 3027 } 3028 page.pc = next 3029 if !next.hasNextLink() || !next.IsEmpty() { 3030 break 3031 } 3032 } 3033 return nil 3034} 3035 3036// Next advances to the next page of values. If there was an error making 3037// the request the page does not advance and the error is returned. 3038// Deprecated: Use NextWithContext() instead. 3039func (page *PropertyCollectionPage) Next() error { 3040 return page.NextWithContext(context.Background()) 3041} 3042 3043// NotDone returns true if the page enumeration should be started or is not yet complete. 3044func (page PropertyCollectionPage) NotDone() bool { 3045 return !page.pc.IsEmpty() 3046} 3047 3048// Response returns the raw server response from the last page request. 3049func (page PropertyCollectionPage) Response() PropertyCollection { 3050 return page.pc 3051} 3052 3053// Values returns the slice of values for the current page or nil if there are no values. 3054func (page PropertyCollectionPage) Values() []PropertyContract { 3055 if page.pc.IsEmpty() { 3056 return nil 3057 } 3058 return *page.pc.Value 3059} 3060 3061// Creates a new instance of the PropertyCollectionPage type. 3062func NewPropertyCollectionPage(cur PropertyCollection, getNextPage func(context.Context, PropertyCollection) (PropertyCollection, error)) PropertyCollectionPage { 3063 return PropertyCollectionPage{ 3064 fn: getNextPage, 3065 pc: cur, 3066 } 3067} 3068 3069// PropertyContract property details. 3070type PropertyContract struct { 3071 autorest.Response `json:"-"` 3072 // ID - Identifier of the Property. 3073 ID *string `json:"id,omitempty"` 3074 // Name - Unique name of Property. It may contain only letters, digits, period, dash, and underscore characters. 3075 Name *string `json:"name,omitempty"` 3076 // Value - Value of the property. Can contain policy expressions. It may not be empty or consist only of whitespace. 3077 Value *string `json:"value,omitempty"` 3078 // Tags - Optional tags that when provided can be used to filter the property list. 3079 Tags *[]string `json:"tags,omitempty"` 3080 // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. 3081 Secret *bool `json:"secret,omitempty"` 3082} 3083 3084// PropertyContractProperties property Contract properties. 3085type PropertyContractProperties struct { 3086 // Name - Unique name of Property. It may contain only letters, digits, period, dash, and underscore characters. 3087 Name *string `json:"name,omitempty"` 3088 // Value - Value of the property. Can contain policy expressions. It may not be empty or consist only of whitespace. 3089 Value *string `json:"value,omitempty"` 3090 // Tags - Optional tags that when provided can be used to filter the property list. 3091 Tags *[]string `json:"tags,omitempty"` 3092 // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. 3093 Secret *bool `json:"secret,omitempty"` 3094} 3095 3096// PropertyEntityBaseParameters property Entity Base Parameters set. 3097type PropertyEntityBaseParameters struct { 3098 // Tags - Optional tags that when provided can be used to filter the property list. 3099 Tags *[]string `json:"tags,omitempty"` 3100 // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. 3101 Secret *bool `json:"secret,omitempty"` 3102} 3103 3104// PropertyUpdateParameters property Contract properties. 3105type PropertyUpdateParameters struct { 3106 // Name - Unique name of Property. It may contain only letters, digits, period, dash, and underscore characters. 3107 Name *string `json:"name,omitempty"` 3108 // Value - Value of the property. Can contain policy expressions. It may not be empty or consist only of whitespace. 3109 Value *string `json:"value,omitempty"` 3110 // Tags - Optional tags that when provided can be used to filter the property list. 3111 Tags *[]string `json:"tags,omitempty"` 3112 // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. 3113 Secret *bool `json:"secret,omitempty"` 3114} 3115 3116// QuotaCounterCollection paged Quota Counter list representation. 3117type QuotaCounterCollection struct { 3118 autorest.Response `json:"-"` 3119 // Value - Quota counter values. 3120 Value *[]QuotaCounterContract `json:"value,omitempty"` 3121 // Count - Total record count number across all pages. 3122 Count *int64 `json:"count,omitempty"` 3123 // NextLink - Next page link if any. 3124 NextLink *string `json:"nextLink,omitempty"` 3125} 3126 3127// QuotaCounterContract quota counter details. 3128type QuotaCounterContract struct { 3129 autorest.Response `json:"-"` 3130 // CounterKey - The Key value of the Counter. Must not be empty. 3131 CounterKey *string `json:"counterKey,omitempty"` 3132 // PeriodKey - Identifier of the Period for which the counter was collected. Must not be empty. 3133 PeriodKey *string `json:"periodKey,omitempty"` 3134 // PeriodStartTime - The date of the start of Counter Period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 3135 PeriodStartTime *date.Time `json:"periodStartTime,omitempty"` 3136 // PeriodEndTime - The date of the end of Counter Period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 3137 PeriodEndTime *date.Time `json:"periodEndTime,omitempty"` 3138 // Value - Quota Value Properties 3139 Value *QuotaCounterValueContractProperties `json:"Value,omitempty"` 3140} 3141 3142// QuotaCounterValueContract quota counter value details. 3143type QuotaCounterValueContract struct { 3144 // QuotaCounterValueContractProperties - Quota counter Value Properties. 3145 *QuotaCounterValueContractProperties `json:"value,omitempty"` 3146} 3147 3148// MarshalJSON is the custom marshaler for QuotaCounterValueContract. 3149func (qcvc QuotaCounterValueContract) MarshalJSON() ([]byte, error) { 3150 objectMap := make(map[string]interface{}) 3151 if qcvc.QuotaCounterValueContractProperties != nil { 3152 objectMap["value"] = qcvc.QuotaCounterValueContractProperties 3153 } 3154 return json.Marshal(objectMap) 3155} 3156 3157// UnmarshalJSON is the custom unmarshaler for QuotaCounterValueContract struct. 3158func (qcvc *QuotaCounterValueContract) UnmarshalJSON(body []byte) error { 3159 var m map[string]*json.RawMessage 3160 err := json.Unmarshal(body, &m) 3161 if err != nil { 3162 return err 3163 } 3164 for k, v := range m { 3165 switch k { 3166 case "value": 3167 if v != nil { 3168 var quotaCounterValueContractProperties QuotaCounterValueContractProperties 3169 err = json.Unmarshal(*v, "aCounterValueContractProperties) 3170 if err != nil { 3171 return err 3172 } 3173 qcvc.QuotaCounterValueContractProperties = "aCounterValueContractProperties 3174 } 3175 } 3176 } 3177 3178 return nil 3179} 3180 3181// QuotaCounterValueContractProperties quota counter value details. 3182type QuotaCounterValueContractProperties struct { 3183 // CallsCount - Number of times Counter was called. 3184 CallsCount *int32 `json:"callsCount,omitempty"` 3185 // KbTransferred - Data Transferred in KiloBytes. 3186 KbTransferred *float64 `json:"kbTransferred,omitempty"` 3187} 3188 3189// RegionContract region profile. 3190type RegionContract struct { 3191 // Name - READ-ONLY; Region name. 3192 Name *string `json:"name,omitempty"` 3193 // IsMasterRegion - whether Region is the master region. 3194 IsMasterRegion *bool `json:"isMasterRegion,omitempty"` 3195 // IsDeleted - whether Region is deleted. 3196 IsDeleted *bool `json:"isDeleted,omitempty"` 3197} 3198 3199// MarshalJSON is the custom marshaler for RegionContract. 3200func (rc RegionContract) MarshalJSON() ([]byte, error) { 3201 objectMap := make(map[string]interface{}) 3202 if rc.IsMasterRegion != nil { 3203 objectMap["isMasterRegion"] = rc.IsMasterRegion 3204 } 3205 if rc.IsDeleted != nil { 3206 objectMap["isDeleted"] = rc.IsDeleted 3207 } 3208 return json.Marshal(objectMap) 3209} 3210 3211// RegionListResult lists Regions operation response details. 3212type RegionListResult struct { 3213 autorest.Response `json:"-"` 3214 // Value - Lists of Regions. 3215 Value *[]RegionContract `json:"value,omitempty"` 3216 // Count - Total record count number across all pages. 3217 Count *int64 `json:"count,omitempty"` 3218 // NextLink - Next page link if any. 3219 NextLink *string `json:"nextLink,omitempty"` 3220} 3221 3222// RegistrationDelegationSettingsProperties user registration delegation settings properties. 3223type RegistrationDelegationSettingsProperties struct { 3224 // Enabled - Enable or disable delegation for user registration. 3225 Enabled *bool `json:"enabled,omitempty"` 3226} 3227 3228// ReportCollection paged Report records list representation. 3229type ReportCollection struct { 3230 autorest.Response `json:"-"` 3231 // Value - Page values. 3232 Value *[]ReportRecordContract `json:"value,omitempty"` 3233 // Count - Total record count number across all pages. 3234 Count *int64 `json:"count,omitempty"` 3235 // NextLink - Next page link if any. 3236 NextLink *string `json:"nextLink,omitempty"` 3237} 3238 3239// ReportCollectionIterator provides access to a complete listing of ReportRecordContract values. 3240type ReportCollectionIterator struct { 3241 i int 3242 page ReportCollectionPage 3243} 3244 3245// NextWithContext advances to the next value. If there was an error making 3246// the request the iterator does not advance and the error is returned. 3247func (iter *ReportCollectionIterator) NextWithContext(ctx context.Context) (err error) { 3248 if tracing.IsEnabled() { 3249 ctx = tracing.StartSpan(ctx, fqdn+"/ReportCollectionIterator.NextWithContext") 3250 defer func() { 3251 sc := -1 3252 if iter.Response().Response.Response != nil { 3253 sc = iter.Response().Response.Response.StatusCode 3254 } 3255 tracing.EndSpan(ctx, sc, err) 3256 }() 3257 } 3258 iter.i++ 3259 if iter.i < len(iter.page.Values()) { 3260 return nil 3261 } 3262 err = iter.page.NextWithContext(ctx) 3263 if err != nil { 3264 iter.i-- 3265 return err 3266 } 3267 iter.i = 0 3268 return nil 3269} 3270 3271// Next advances to the next value. If there was an error making 3272// the request the iterator does not advance and the error is returned. 3273// Deprecated: Use NextWithContext() instead. 3274func (iter *ReportCollectionIterator) Next() error { 3275 return iter.NextWithContext(context.Background()) 3276} 3277 3278// NotDone returns true if the enumeration should be started or is not yet complete. 3279func (iter ReportCollectionIterator) NotDone() bool { 3280 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3281} 3282 3283// Response returns the raw server response from the last page request. 3284func (iter ReportCollectionIterator) Response() ReportCollection { 3285 return iter.page.Response() 3286} 3287 3288// Value returns the current value or a zero-initialized value if the 3289// iterator has advanced beyond the end of the collection. 3290func (iter ReportCollectionIterator) Value() ReportRecordContract { 3291 if !iter.page.NotDone() { 3292 return ReportRecordContract{} 3293 } 3294 return iter.page.Values()[iter.i] 3295} 3296 3297// Creates a new instance of the ReportCollectionIterator type. 3298func NewReportCollectionIterator(page ReportCollectionPage) ReportCollectionIterator { 3299 return ReportCollectionIterator{page: page} 3300} 3301 3302// IsEmpty returns true if the ListResult contains no values. 3303func (rc ReportCollection) IsEmpty() bool { 3304 return rc.Value == nil || len(*rc.Value) == 0 3305} 3306 3307// hasNextLink returns true if the NextLink is not empty. 3308func (rc ReportCollection) hasNextLink() bool { 3309 return rc.NextLink != nil && len(*rc.NextLink) != 0 3310} 3311 3312// reportCollectionPreparer prepares a request to retrieve the next set of results. 3313// It returns nil if no more results exist. 3314func (rc ReportCollection) reportCollectionPreparer(ctx context.Context) (*http.Request, error) { 3315 if !rc.hasNextLink() { 3316 return nil, nil 3317 } 3318 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3319 autorest.AsJSON(), 3320 autorest.AsGet(), 3321 autorest.WithBaseURL(to.String(rc.NextLink))) 3322} 3323 3324// ReportCollectionPage contains a page of ReportRecordContract values. 3325type ReportCollectionPage struct { 3326 fn func(context.Context, ReportCollection) (ReportCollection, error) 3327 rc ReportCollection 3328} 3329 3330// NextWithContext advances to the next page of values. If there was an error making 3331// the request the page does not advance and the error is returned. 3332func (page *ReportCollectionPage) NextWithContext(ctx context.Context) (err error) { 3333 if tracing.IsEnabled() { 3334 ctx = tracing.StartSpan(ctx, fqdn+"/ReportCollectionPage.NextWithContext") 3335 defer func() { 3336 sc := -1 3337 if page.Response().Response.Response != nil { 3338 sc = page.Response().Response.Response.StatusCode 3339 } 3340 tracing.EndSpan(ctx, sc, err) 3341 }() 3342 } 3343 for { 3344 next, err := page.fn(ctx, page.rc) 3345 if err != nil { 3346 return err 3347 } 3348 page.rc = next 3349 if !next.hasNextLink() || !next.IsEmpty() { 3350 break 3351 } 3352 } 3353 return nil 3354} 3355 3356// Next advances to the next page of values. If there was an error making 3357// the request the page does not advance and the error is returned. 3358// Deprecated: Use NextWithContext() instead. 3359func (page *ReportCollectionPage) Next() error { 3360 return page.NextWithContext(context.Background()) 3361} 3362 3363// NotDone returns true if the page enumeration should be started or is not yet complete. 3364func (page ReportCollectionPage) NotDone() bool { 3365 return !page.rc.IsEmpty() 3366} 3367 3368// Response returns the raw server response from the last page request. 3369func (page ReportCollectionPage) Response() ReportCollection { 3370 return page.rc 3371} 3372 3373// Values returns the slice of values for the current page or nil if there are no values. 3374func (page ReportCollectionPage) Values() []ReportRecordContract { 3375 if page.rc.IsEmpty() { 3376 return nil 3377 } 3378 return *page.rc.Value 3379} 3380 3381// Creates a new instance of the ReportCollectionPage type. 3382func NewReportCollectionPage(cur ReportCollection, getNextPage func(context.Context, ReportCollection) (ReportCollection, error)) ReportCollectionPage { 3383 return ReportCollectionPage{ 3384 fn: getNextPage, 3385 rc: cur, 3386 } 3387} 3388 3389// ReportRecordContract report data. 3390type ReportRecordContract struct { 3391 // Name - Name depending on report endpoint specifies product, API, operation or developer name. 3392 Name *string `json:"name,omitempty"` 3393 // Timestamp - Start of aggregation period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 3394 Timestamp *date.Time `json:"timestamp,omitempty"` 3395 // Interval - Length of aggregation period. Interval must be multiple of 15 minutes and may not be zero. The value should be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations). 3396 Interval *string `json:"interval,omitempty"` 3397 // Country - Country to which this record data is related. 3398 Country *string `json:"country,omitempty"` 3399 // Region - Country region to which this record data is related. 3400 Region *string `json:"region,omitempty"` 3401 // Zip - Zip code to which this record data is related. 3402 Zip *string `json:"zip,omitempty"` 3403 // UserID - READ-ONLY; User identifier path. /users/{userId} 3404 UserID *string `json:"userId,omitempty"` 3405 // ProductID - READ-ONLY; Product identifier path. /products/{productId} 3406 ProductID *string `json:"productId,omitempty"` 3407 // APIID - API identifier path. /apis/{apiId} 3408 APIID *string `json:"apiId,omitempty"` 3409 // OperationID - Operation identifier path. /apis/{apiId}/operations/{operationId} 3410 OperationID *string `json:"operationId,omitempty"` 3411 // APIRegion - API region identifier. 3412 APIRegion *string `json:"apiRegion,omitempty"` 3413 // SubscriptionID - Subscription identifier path. /subscriptions/{subscriptionId} 3414 SubscriptionID *string `json:"subscriptionId,omitempty"` 3415 // CallCountSuccess - Number of successful calls. This includes calls returning HttpStatusCode <= 301 and HttpStatusCode.NotModified and HttpStatusCode.TemporaryRedirect 3416 CallCountSuccess *int32 `json:"callCountSuccess,omitempty"` 3417 // CallCountBlocked - Number of calls blocked due to invalid credentials. This includes calls returning HttpStatusCode.Unauthorized and HttpStatusCode.Forbidden and HttpStatusCode.TooManyRequests 3418 CallCountBlocked *int32 `json:"callCountBlocked,omitempty"` 3419 // CallCountFailed - Number of calls failed due to proxy or backend errors. This includes calls returning HttpStatusCode.BadRequest(400) and any Code between HttpStatusCode.InternalServerError (500) and 600 3420 CallCountFailed *int32 `json:"callCountFailed,omitempty"` 3421 // CallCountOther - Number of other calls. 3422 CallCountOther *int32 `json:"callCountOther,omitempty"` 3423 // CallCountTotal - Total number of calls. 3424 CallCountTotal *int32 `json:"callCountTotal,omitempty"` 3425 // Bandwidth - Bandwidth consumed. 3426 Bandwidth *int64 `json:"bandwidth,omitempty"` 3427 // CacheHitCount - Number of times when content was served from cache policy. 3428 CacheHitCount *int32 `json:"cacheHitCount,omitempty"` 3429 // CacheMissCount - Number of times content was fetched from backend. 3430 CacheMissCount *int32 `json:"cacheMissCount,omitempty"` 3431 // APITimeAvg - Average time it took to process request. 3432 APITimeAvg *float64 `json:"apiTimeAvg,omitempty"` 3433 // APITimeMin - Minimum time it took to process request. 3434 APITimeMin *float64 `json:"apiTimeMin,omitempty"` 3435 // APITimeMax - Maximum time it took to process request. 3436 APITimeMax *float64 `json:"apiTimeMax,omitempty"` 3437 // ServiceTimeAvg - Average time it took to process request on backend. 3438 ServiceTimeAvg *float64 `json:"serviceTimeAvg,omitempty"` 3439 // ServiceTimeMin - Minimum time it took to process request on backend. 3440 ServiceTimeMin *float64 `json:"serviceTimeMin,omitempty"` 3441 // ServiceTimeMax - Maximum time it took to process request on backend. 3442 ServiceTimeMax *float64 `json:"serviceTimeMax,omitempty"` 3443} 3444 3445// MarshalJSON is the custom marshaler for ReportRecordContract. 3446func (rrc ReportRecordContract) MarshalJSON() ([]byte, error) { 3447 objectMap := make(map[string]interface{}) 3448 if rrc.Name != nil { 3449 objectMap["name"] = rrc.Name 3450 } 3451 if rrc.Timestamp != nil { 3452 objectMap["timestamp"] = rrc.Timestamp 3453 } 3454 if rrc.Interval != nil { 3455 objectMap["interval"] = rrc.Interval 3456 } 3457 if rrc.Country != nil { 3458 objectMap["country"] = rrc.Country 3459 } 3460 if rrc.Region != nil { 3461 objectMap["region"] = rrc.Region 3462 } 3463 if rrc.Zip != nil { 3464 objectMap["zip"] = rrc.Zip 3465 } 3466 if rrc.APIID != nil { 3467 objectMap["apiId"] = rrc.APIID 3468 } 3469 if rrc.OperationID != nil { 3470 objectMap["operationId"] = rrc.OperationID 3471 } 3472 if rrc.APIRegion != nil { 3473 objectMap["apiRegion"] = rrc.APIRegion 3474 } 3475 if rrc.SubscriptionID != nil { 3476 objectMap["subscriptionId"] = rrc.SubscriptionID 3477 } 3478 if rrc.CallCountSuccess != nil { 3479 objectMap["callCountSuccess"] = rrc.CallCountSuccess 3480 } 3481 if rrc.CallCountBlocked != nil { 3482 objectMap["callCountBlocked"] = rrc.CallCountBlocked 3483 } 3484 if rrc.CallCountFailed != nil { 3485 objectMap["callCountFailed"] = rrc.CallCountFailed 3486 } 3487 if rrc.CallCountOther != nil { 3488 objectMap["callCountOther"] = rrc.CallCountOther 3489 } 3490 if rrc.CallCountTotal != nil { 3491 objectMap["callCountTotal"] = rrc.CallCountTotal 3492 } 3493 if rrc.Bandwidth != nil { 3494 objectMap["bandwidth"] = rrc.Bandwidth 3495 } 3496 if rrc.CacheHitCount != nil { 3497 objectMap["cacheHitCount"] = rrc.CacheHitCount 3498 } 3499 if rrc.CacheMissCount != nil { 3500 objectMap["cacheMissCount"] = rrc.CacheMissCount 3501 } 3502 if rrc.APITimeAvg != nil { 3503 objectMap["apiTimeAvg"] = rrc.APITimeAvg 3504 } 3505 if rrc.APITimeMin != nil { 3506 objectMap["apiTimeMin"] = rrc.APITimeMin 3507 } 3508 if rrc.APITimeMax != nil { 3509 objectMap["apiTimeMax"] = rrc.APITimeMax 3510 } 3511 if rrc.ServiceTimeAvg != nil { 3512 objectMap["serviceTimeAvg"] = rrc.ServiceTimeAvg 3513 } 3514 if rrc.ServiceTimeMin != nil { 3515 objectMap["serviceTimeMin"] = rrc.ServiceTimeMin 3516 } 3517 if rrc.ServiceTimeMax != nil { 3518 objectMap["serviceTimeMax"] = rrc.ServiceTimeMax 3519 } 3520 return json.Marshal(objectMap) 3521} 3522 3523// RepresentationContract operation request/response representation details. 3524type RepresentationContract struct { 3525 // ContentType - Specifies a registered or custom content type for this representation, e.g. application/xml. 3526 ContentType *string `json:"contentType,omitempty"` 3527 // Sample - An example of the representation. 3528 Sample *string `json:"sample,omitempty"` 3529 // SchemaID - Schema identifier. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'. 3530 SchemaID *string `json:"schemaId,omitempty"` 3531 // TypeName - Type name defined by the schema. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'. 3532 TypeName *string `json:"typeName,omitempty"` 3533 // FormParameters - Collection of form parameters. Required if 'contentType' value is either 'application/x-www-form-urlencoded' or 'multipart/form-data'.. 3534 FormParameters *[]ParameterContract `json:"formParameters,omitempty"` 3535} 3536 3537// RequestContract operation request details. 3538type RequestContract struct { 3539 // Description - Operation request description. 3540 Description *string `json:"description,omitempty"` 3541 // QueryParameters - Collection of operation request query parameters. 3542 QueryParameters *[]ParameterContract `json:"queryParameters,omitempty"` 3543 // Headers - Collection of operation request headers. 3544 Headers *[]ParameterContract `json:"headers,omitempty"` 3545 // Representations - Collection of operation request representations. 3546 Representations *[]RepresentationContract `json:"representations,omitempty"` 3547} 3548 3549// RequestReportCollection paged Report records list representation. 3550type RequestReportCollection struct { 3551 autorest.Response `json:"-"` 3552 // Value - Page values. 3553 Value *[]RequestReportRecordContract `json:"value,omitempty"` 3554 // Count - Total record count number across all pages. 3555 Count *int64 `json:"count,omitempty"` 3556} 3557 3558// RequestReportRecordContract request Report data. 3559type RequestReportRecordContract struct { 3560 // APIID - API identifier path. /apis/{apiId} 3561 APIID *string `json:"apiId,omitempty"` 3562 // OperationID - Operation identifier path. /apis/{apiId}/operations/{operationId} 3563 OperationID *string `json:"operationId,omitempty"` 3564 // ProductID - READ-ONLY; Product identifier path. /products/{productId} 3565 ProductID *string `json:"productId,omitempty"` 3566 // UserID - READ-ONLY; User identifier path. /users/{userId} 3567 UserID *string `json:"userId,omitempty"` 3568 // Method - The HTTP method associated with this request.. 3569 Method *string `json:"method,omitempty"` 3570 // URL - The full URL associated with this request. 3571 URL *string `json:"url,omitempty"` 3572 // IPAddress - The client IP address associated with this request. 3573 IPAddress *string `json:"ipAddress,omitempty"` 3574 // BackendResponseCode - The HTTP status code received by the gateway as a result of forwarding this request to the backend. 3575 BackendResponseCode *string `json:"backendResponseCode,omitempty"` 3576 // ResponseCode - The HTTP status code returned by the gateway. 3577 ResponseCode *int32 `json:"responseCode,omitempty"` 3578 // ResponseSize - The size of the response returned by the gateway. 3579 ResponseSize *int32 `json:"responseSize,omitempty"` 3580 // Timestamp - The date and time when this request was received by the gateway in ISO 8601 format. 3581 Timestamp *date.Time `json:"timestamp,omitempty"` 3582 // Cache - Specifies if response cache was involved in generating the response. If the value is none, the cache was not used. If the value is hit, cached response was returned. If the value is miss, the cache was used but lookup resulted in a miss and request was fulfilled by the backend. 3583 Cache *string `json:"cache,omitempty"` 3584 // APITime - The total time it took to process this request. 3585 APITime *float64 `json:"apiTime,omitempty"` 3586 // ServiceTime - he time it took to forward this request to the backend and get the response back. 3587 ServiceTime *float64 `json:"serviceTime,omitempty"` 3588 // APIRegion - Azure region where the gateway that processed this request is located. 3589 APIRegion *string `json:"apiRegion,omitempty"` 3590 // SubscriptionID - Subscription identifier path. /subscriptions/{subscriptionId} 3591 SubscriptionID *string `json:"subscriptionId,omitempty"` 3592 // RequestID - Request Identifier. 3593 RequestID *string `json:"requestId,omitempty"` 3594 // RequestSize - The size of this request.. 3595 RequestSize *int32 `json:"requestSize,omitempty"` 3596} 3597 3598// MarshalJSON is the custom marshaler for RequestReportRecordContract. 3599func (rrrc RequestReportRecordContract) MarshalJSON() ([]byte, error) { 3600 objectMap := make(map[string]interface{}) 3601 if rrrc.APIID != nil { 3602 objectMap["apiId"] = rrrc.APIID 3603 } 3604 if rrrc.OperationID != nil { 3605 objectMap["operationId"] = rrrc.OperationID 3606 } 3607 if rrrc.Method != nil { 3608 objectMap["method"] = rrrc.Method 3609 } 3610 if rrrc.URL != nil { 3611 objectMap["url"] = rrrc.URL 3612 } 3613 if rrrc.IPAddress != nil { 3614 objectMap["ipAddress"] = rrrc.IPAddress 3615 } 3616 if rrrc.BackendResponseCode != nil { 3617 objectMap["backendResponseCode"] = rrrc.BackendResponseCode 3618 } 3619 if rrrc.ResponseCode != nil { 3620 objectMap["responseCode"] = rrrc.ResponseCode 3621 } 3622 if rrrc.ResponseSize != nil { 3623 objectMap["responseSize"] = rrrc.ResponseSize 3624 } 3625 if rrrc.Timestamp != nil { 3626 objectMap["timestamp"] = rrrc.Timestamp 3627 } 3628 if rrrc.Cache != nil { 3629 objectMap["cache"] = rrrc.Cache 3630 } 3631 if rrrc.APITime != nil { 3632 objectMap["apiTime"] = rrrc.APITime 3633 } 3634 if rrrc.ServiceTime != nil { 3635 objectMap["serviceTime"] = rrrc.ServiceTime 3636 } 3637 if rrrc.APIRegion != nil { 3638 objectMap["apiRegion"] = rrrc.APIRegion 3639 } 3640 if rrrc.SubscriptionID != nil { 3641 objectMap["subscriptionId"] = rrrc.SubscriptionID 3642 } 3643 if rrrc.RequestID != nil { 3644 objectMap["requestId"] = rrrc.RequestID 3645 } 3646 if rrrc.RequestSize != nil { 3647 objectMap["requestSize"] = rrrc.RequestSize 3648 } 3649 return json.Marshal(objectMap) 3650} 3651 3652// ResponseContract operation response details. 3653type ResponseContract struct { 3654 // StatusCode - Operation response HTTP status code. 3655 StatusCode *int32 `json:"statusCode,omitempty"` 3656 // Description - Operation response description. 3657 Description *string `json:"description,omitempty"` 3658 // Representations - Collection of operation response representations. 3659 Representations *[]RepresentationContract `json:"representations,omitempty"` 3660 // Headers - Collection of operation response headers. 3661 Headers *[]ParameterContract `json:"headers,omitempty"` 3662} 3663 3664// SaveConfigurationParameter parameters supplied to the Save Tenant Configuration operation. 3665type SaveConfigurationParameter struct { 3666 // Branch - The name of the Git branch in which to commit the current configuration snapshot. 3667 Branch *string `json:"branch,omitempty"` 3668 // Force - The value if true, the current configuration database is committed to the Git repository, even if the Git repository has newer changes that would be overwritten. 3669 Force *bool `json:"force,omitempty"` 3670} 3671 3672// SchemaCollection the response of the list schema operation. 3673type SchemaCollection struct { 3674 autorest.Response `json:"-"` 3675 // Value - Api Schema Contract value. 3676 Value *[]SchemaContract `json:"value,omitempty"` 3677 // Count - Total number of entities 3678 Count *int32 `json:"count,omitempty"` 3679 // NextLink - Next page link if any. 3680 NextLink *string `json:"nextLink,omitempty"` 3681} 3682 3683// SchemaCollectionIterator provides access to a complete listing of SchemaContract values. 3684type SchemaCollectionIterator struct { 3685 i int 3686 page SchemaCollectionPage 3687} 3688 3689// NextWithContext advances to the next value. If there was an error making 3690// the request the iterator does not advance and the error is returned. 3691func (iter *SchemaCollectionIterator) NextWithContext(ctx context.Context) (err error) { 3692 if tracing.IsEnabled() { 3693 ctx = tracing.StartSpan(ctx, fqdn+"/SchemaCollectionIterator.NextWithContext") 3694 defer func() { 3695 sc := -1 3696 if iter.Response().Response.Response != nil { 3697 sc = iter.Response().Response.Response.StatusCode 3698 } 3699 tracing.EndSpan(ctx, sc, err) 3700 }() 3701 } 3702 iter.i++ 3703 if iter.i < len(iter.page.Values()) { 3704 return nil 3705 } 3706 err = iter.page.NextWithContext(ctx) 3707 if err != nil { 3708 iter.i-- 3709 return err 3710 } 3711 iter.i = 0 3712 return nil 3713} 3714 3715// Next advances to the next value. If there was an error making 3716// the request the iterator does not advance and the error is returned. 3717// Deprecated: Use NextWithContext() instead. 3718func (iter *SchemaCollectionIterator) Next() error { 3719 return iter.NextWithContext(context.Background()) 3720} 3721 3722// NotDone returns true if the enumeration should be started or is not yet complete. 3723func (iter SchemaCollectionIterator) NotDone() bool { 3724 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3725} 3726 3727// Response returns the raw server response from the last page request. 3728func (iter SchemaCollectionIterator) Response() SchemaCollection { 3729 return iter.page.Response() 3730} 3731 3732// Value returns the current value or a zero-initialized value if the 3733// iterator has advanced beyond the end of the collection. 3734func (iter SchemaCollectionIterator) Value() SchemaContract { 3735 if !iter.page.NotDone() { 3736 return SchemaContract{} 3737 } 3738 return iter.page.Values()[iter.i] 3739} 3740 3741// Creates a new instance of the SchemaCollectionIterator type. 3742func NewSchemaCollectionIterator(page SchemaCollectionPage) SchemaCollectionIterator { 3743 return SchemaCollectionIterator{page: page} 3744} 3745 3746// IsEmpty returns true if the ListResult contains no values. 3747func (sc SchemaCollection) IsEmpty() bool { 3748 return sc.Value == nil || len(*sc.Value) == 0 3749} 3750 3751// hasNextLink returns true if the NextLink is not empty. 3752func (sc SchemaCollection) hasNextLink() bool { 3753 return sc.NextLink != nil && len(*sc.NextLink) != 0 3754} 3755 3756// schemaCollectionPreparer prepares a request to retrieve the next set of results. 3757// It returns nil if no more results exist. 3758func (sc SchemaCollection) schemaCollectionPreparer(ctx context.Context) (*http.Request, error) { 3759 if !sc.hasNextLink() { 3760 return nil, nil 3761 } 3762 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3763 autorest.AsJSON(), 3764 autorest.AsGet(), 3765 autorest.WithBaseURL(to.String(sc.NextLink))) 3766} 3767 3768// SchemaCollectionPage contains a page of SchemaContract values. 3769type SchemaCollectionPage struct { 3770 fn func(context.Context, SchemaCollection) (SchemaCollection, error) 3771 sc SchemaCollection 3772} 3773 3774// NextWithContext advances to the next page of values. If there was an error making 3775// the request the page does not advance and the error is returned. 3776func (page *SchemaCollectionPage) NextWithContext(ctx context.Context) (err error) { 3777 if tracing.IsEnabled() { 3778 ctx = tracing.StartSpan(ctx, fqdn+"/SchemaCollectionPage.NextWithContext") 3779 defer func() { 3780 sc := -1 3781 if page.Response().Response.Response != nil { 3782 sc = page.Response().Response.Response.StatusCode 3783 } 3784 tracing.EndSpan(ctx, sc, err) 3785 }() 3786 } 3787 for { 3788 next, err := page.fn(ctx, page.sc) 3789 if err != nil { 3790 return err 3791 } 3792 page.sc = next 3793 if !next.hasNextLink() || !next.IsEmpty() { 3794 break 3795 } 3796 } 3797 return nil 3798} 3799 3800// Next advances to the next page of values. If there was an error making 3801// the request the page does not advance and the error is returned. 3802// Deprecated: Use NextWithContext() instead. 3803func (page *SchemaCollectionPage) Next() error { 3804 return page.NextWithContext(context.Background()) 3805} 3806 3807// NotDone returns true if the page enumeration should be started or is not yet complete. 3808func (page SchemaCollectionPage) NotDone() bool { 3809 return !page.sc.IsEmpty() 3810} 3811 3812// Response returns the raw server response from the last page request. 3813func (page SchemaCollectionPage) Response() SchemaCollection { 3814 return page.sc 3815} 3816 3817// Values returns the slice of values for the current page or nil if there are no values. 3818func (page SchemaCollectionPage) Values() []SchemaContract { 3819 if page.sc.IsEmpty() { 3820 return nil 3821 } 3822 return *page.sc.Value 3823} 3824 3825// Creates a new instance of the SchemaCollectionPage type. 3826func NewSchemaCollectionPage(cur SchemaCollection, getNextPage func(context.Context, SchemaCollection) (SchemaCollection, error)) SchemaCollectionPage { 3827 return SchemaCollectionPage{ 3828 fn: getNextPage, 3829 sc: cur, 3830 } 3831} 3832 3833// SchemaContract schema Contract details. 3834type SchemaContract struct { 3835 autorest.Response `json:"-"` 3836 // ID - Identifier of the Schema. 3837 ID *string `json:"id,omitempty"` 3838 // ContentType - Must be a valid a media type used in a Content-Type header as defined in the RFC 2616. Media type of the schema document (e.g. application/json, application/xml). 3839 ContentType *string `json:"contentType,omitempty"` 3840 // SchemaDocumentProperties - Properties of the Schema Document. 3841 *SchemaDocumentProperties `json:"document,omitempty"` 3842} 3843 3844// MarshalJSON is the custom marshaler for SchemaContract. 3845func (sc SchemaContract) MarshalJSON() ([]byte, error) { 3846 objectMap := make(map[string]interface{}) 3847 if sc.ID != nil { 3848 objectMap["id"] = sc.ID 3849 } 3850 if sc.ContentType != nil { 3851 objectMap["contentType"] = sc.ContentType 3852 } 3853 if sc.SchemaDocumentProperties != nil { 3854 objectMap["document"] = sc.SchemaDocumentProperties 3855 } 3856 return json.Marshal(objectMap) 3857} 3858 3859// UnmarshalJSON is the custom unmarshaler for SchemaContract struct. 3860func (sc *SchemaContract) UnmarshalJSON(body []byte) error { 3861 var m map[string]*json.RawMessage 3862 err := json.Unmarshal(body, &m) 3863 if err != nil { 3864 return err 3865 } 3866 for k, v := range m { 3867 switch k { 3868 case "id": 3869 if v != nil { 3870 var ID string 3871 err = json.Unmarshal(*v, &ID) 3872 if err != nil { 3873 return err 3874 } 3875 sc.ID = &ID 3876 } 3877 case "contentType": 3878 if v != nil { 3879 var contentType string 3880 err = json.Unmarshal(*v, &contentType) 3881 if err != nil { 3882 return err 3883 } 3884 sc.ContentType = &contentType 3885 } 3886 case "document": 3887 if v != nil { 3888 var schemaDocumentProperties SchemaDocumentProperties 3889 err = json.Unmarshal(*v, &schemaDocumentProperties) 3890 if err != nil { 3891 return err 3892 } 3893 sc.SchemaDocumentProperties = &schemaDocumentProperties 3894 } 3895 } 3896 } 3897 3898 return nil 3899} 3900 3901// SchemaContractProperties schema contract Properties. 3902type SchemaContractProperties struct { 3903 // ContentType - Must be a valid a media type used in a Content-Type header as defined in the RFC 2616. Media type of the schema document (e.g. application/json, application/xml). 3904 ContentType *string `json:"contentType,omitempty"` 3905 // SchemaDocumentProperties - Properties of the Schema Document. 3906 *SchemaDocumentProperties `json:"document,omitempty"` 3907} 3908 3909// MarshalJSON is the custom marshaler for SchemaContractProperties. 3910func (scp SchemaContractProperties) MarshalJSON() ([]byte, error) { 3911 objectMap := make(map[string]interface{}) 3912 if scp.ContentType != nil { 3913 objectMap["contentType"] = scp.ContentType 3914 } 3915 if scp.SchemaDocumentProperties != nil { 3916 objectMap["document"] = scp.SchemaDocumentProperties 3917 } 3918 return json.Marshal(objectMap) 3919} 3920 3921// UnmarshalJSON is the custom unmarshaler for SchemaContractProperties struct. 3922func (scp *SchemaContractProperties) UnmarshalJSON(body []byte) error { 3923 var m map[string]*json.RawMessage 3924 err := json.Unmarshal(body, &m) 3925 if err != nil { 3926 return err 3927 } 3928 for k, v := range m { 3929 switch k { 3930 case "contentType": 3931 if v != nil { 3932 var contentType string 3933 err = json.Unmarshal(*v, &contentType) 3934 if err != nil { 3935 return err 3936 } 3937 scp.ContentType = &contentType 3938 } 3939 case "document": 3940 if v != nil { 3941 var schemaDocumentProperties SchemaDocumentProperties 3942 err = json.Unmarshal(*v, &schemaDocumentProperties) 3943 if err != nil { 3944 return err 3945 } 3946 scp.SchemaDocumentProperties = &schemaDocumentProperties 3947 } 3948 } 3949 } 3950 3951 return nil 3952} 3953 3954// SchemaDocumentProperties schema Document Properties. 3955type SchemaDocumentProperties struct { 3956 // Value - Json escaped string defining the document representing the Schema. 3957 Value *string `json:"value,omitempty"` 3958} 3959 3960// SubscriptionCollection paged Subscriptions list representation. 3961type SubscriptionCollection struct { 3962 autorest.Response `json:"-"` 3963 // Value - Page values. 3964 Value *[]SubscriptionContract `json:"value,omitempty"` 3965 // Count - Total number of entities 3966 Count *int32 `json:"count,omitempty"` 3967 // NextLink - Next page link if any. 3968 NextLink *string `json:"nextLink,omitempty"` 3969} 3970 3971// SubscriptionCollectionIterator provides access to a complete listing of SubscriptionContract values. 3972type SubscriptionCollectionIterator struct { 3973 i int 3974 page SubscriptionCollectionPage 3975} 3976 3977// NextWithContext advances to the next value. If there was an error making 3978// the request the iterator does not advance and the error is returned. 3979func (iter *SubscriptionCollectionIterator) NextWithContext(ctx context.Context) (err error) { 3980 if tracing.IsEnabled() { 3981 ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionCollectionIterator.NextWithContext") 3982 defer func() { 3983 sc := -1 3984 if iter.Response().Response.Response != nil { 3985 sc = iter.Response().Response.Response.StatusCode 3986 } 3987 tracing.EndSpan(ctx, sc, err) 3988 }() 3989 } 3990 iter.i++ 3991 if iter.i < len(iter.page.Values()) { 3992 return nil 3993 } 3994 err = iter.page.NextWithContext(ctx) 3995 if err != nil { 3996 iter.i-- 3997 return err 3998 } 3999 iter.i = 0 4000 return nil 4001} 4002 4003// Next advances to the next value. If there was an error making 4004// the request the iterator does not advance and the error is returned. 4005// Deprecated: Use NextWithContext() instead. 4006func (iter *SubscriptionCollectionIterator) Next() error { 4007 return iter.NextWithContext(context.Background()) 4008} 4009 4010// NotDone returns true if the enumeration should be started or is not yet complete. 4011func (iter SubscriptionCollectionIterator) NotDone() bool { 4012 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4013} 4014 4015// Response returns the raw server response from the last page request. 4016func (iter SubscriptionCollectionIterator) Response() SubscriptionCollection { 4017 return iter.page.Response() 4018} 4019 4020// Value returns the current value or a zero-initialized value if the 4021// iterator has advanced beyond the end of the collection. 4022func (iter SubscriptionCollectionIterator) Value() SubscriptionContract { 4023 if !iter.page.NotDone() { 4024 return SubscriptionContract{} 4025 } 4026 return iter.page.Values()[iter.i] 4027} 4028 4029// Creates a new instance of the SubscriptionCollectionIterator type. 4030func NewSubscriptionCollectionIterator(page SubscriptionCollectionPage) SubscriptionCollectionIterator { 4031 return SubscriptionCollectionIterator{page: page} 4032} 4033 4034// IsEmpty returns true if the ListResult contains no values. 4035func (sc SubscriptionCollection) IsEmpty() bool { 4036 return sc.Value == nil || len(*sc.Value) == 0 4037} 4038 4039// hasNextLink returns true if the NextLink is not empty. 4040func (sc SubscriptionCollection) hasNextLink() bool { 4041 return sc.NextLink != nil && len(*sc.NextLink) != 0 4042} 4043 4044// subscriptionCollectionPreparer prepares a request to retrieve the next set of results. 4045// It returns nil if no more results exist. 4046func (sc SubscriptionCollection) subscriptionCollectionPreparer(ctx context.Context) (*http.Request, error) { 4047 if !sc.hasNextLink() { 4048 return nil, nil 4049 } 4050 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4051 autorest.AsJSON(), 4052 autorest.AsGet(), 4053 autorest.WithBaseURL(to.String(sc.NextLink))) 4054} 4055 4056// SubscriptionCollectionPage contains a page of SubscriptionContract values. 4057type SubscriptionCollectionPage struct { 4058 fn func(context.Context, SubscriptionCollection) (SubscriptionCollection, error) 4059 sc SubscriptionCollection 4060} 4061 4062// NextWithContext advances to the next page of values. If there was an error making 4063// the request the page does not advance and the error is returned. 4064func (page *SubscriptionCollectionPage) NextWithContext(ctx context.Context) (err error) { 4065 if tracing.IsEnabled() { 4066 ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionCollectionPage.NextWithContext") 4067 defer func() { 4068 sc := -1 4069 if page.Response().Response.Response != nil { 4070 sc = page.Response().Response.Response.StatusCode 4071 } 4072 tracing.EndSpan(ctx, sc, err) 4073 }() 4074 } 4075 for { 4076 next, err := page.fn(ctx, page.sc) 4077 if err != nil { 4078 return err 4079 } 4080 page.sc = next 4081 if !next.hasNextLink() || !next.IsEmpty() { 4082 break 4083 } 4084 } 4085 return nil 4086} 4087 4088// Next advances to the next page of values. If there was an error making 4089// the request the page does not advance and the error is returned. 4090// Deprecated: Use NextWithContext() instead. 4091func (page *SubscriptionCollectionPage) Next() error { 4092 return page.NextWithContext(context.Background()) 4093} 4094 4095// NotDone returns true if the page enumeration should be started or is not yet complete. 4096func (page SubscriptionCollectionPage) NotDone() bool { 4097 return !page.sc.IsEmpty() 4098} 4099 4100// Response returns the raw server response from the last page request. 4101func (page SubscriptionCollectionPage) Response() SubscriptionCollection { 4102 return page.sc 4103} 4104 4105// Values returns the slice of values for the current page or nil if there are no values. 4106func (page SubscriptionCollectionPage) Values() []SubscriptionContract { 4107 if page.sc.IsEmpty() { 4108 return nil 4109 } 4110 return *page.sc.Value 4111} 4112 4113// Creates a new instance of the SubscriptionCollectionPage type. 4114func NewSubscriptionCollectionPage(cur SubscriptionCollection, getNextPage func(context.Context, SubscriptionCollection) (SubscriptionCollection, error)) SubscriptionCollectionPage { 4115 return SubscriptionCollectionPage{ 4116 fn: getNextPage, 4117 sc: cur, 4118 } 4119} 4120 4121// SubscriptionContract subscription details. 4122type SubscriptionContract struct { 4123 autorest.Response `json:"-"` 4124 // ID - Identifier of the Subscription. 4125 ID *string `json:"id,omitempty"` 4126 // UserID - The user resource identifier of the subscription owner. The value is a valid relative URL in the format of /users/{uid} where {uid} is a user identifier. 4127 UserID *string `json:"userId,omitempty"` 4128 // ProductID - The product resource identifier of the subscribed product. The value is a valid relative URL in the format of /products/{productId} where {productId} is a product identifier. 4129 ProductID *string `json:"productId,omitempty"` 4130 // Name - The name of the subscription, or null if the subscription has no name. 4131 Name *string `json:"name,omitempty"` 4132 // State - Subscription state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated. Possible values include: 'Suspended', 'Active', 'Expired', 'Submitted', 'Rejected', 'Cancelled' 4133 State SubscriptionState `json:"state,omitempty"` 4134 // CreatedDate - READ-ONLY; Subscription creation date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 4135 CreatedDate *date.Time `json:"createdDate,omitempty"` 4136 // StartDate - Subscription activation date. The setting is for audit purposes only and the subscription is not automatically activated. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 4137 StartDate *date.Time `json:"startDate,omitempty"` 4138 // ExpirationDate - Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 4139 ExpirationDate *date.Time `json:"expirationDate,omitempty"` 4140 // EndDate - Date when subscription was cancelled or expired. The setting is for audit purposes only and the subscription is not automatically cancelled. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 4141 EndDate *date.Time `json:"endDate,omitempty"` 4142 // NotificationDate - Upcoming subscription expiration notification date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 4143 NotificationDate *date.Time `json:"notificationDate,omitempty"` 4144 // PrimaryKey - Subscription primary key. 4145 PrimaryKey *string `json:"primaryKey,omitempty"` 4146 // SecondaryKey - Subscription secondary key. 4147 SecondaryKey *string `json:"secondaryKey,omitempty"` 4148 // StateComment - Optional subscription comment added by an administrator. 4149 StateComment *string `json:"stateComment,omitempty"` 4150} 4151 4152// MarshalJSON is the custom marshaler for SubscriptionContract. 4153func (sc SubscriptionContract) MarshalJSON() ([]byte, error) { 4154 objectMap := make(map[string]interface{}) 4155 if sc.ID != nil { 4156 objectMap["id"] = sc.ID 4157 } 4158 if sc.UserID != nil { 4159 objectMap["userId"] = sc.UserID 4160 } 4161 if sc.ProductID != nil { 4162 objectMap["productId"] = sc.ProductID 4163 } 4164 if sc.Name != nil { 4165 objectMap["name"] = sc.Name 4166 } 4167 if sc.State != "" { 4168 objectMap["state"] = sc.State 4169 } 4170 if sc.StartDate != nil { 4171 objectMap["startDate"] = sc.StartDate 4172 } 4173 if sc.ExpirationDate != nil { 4174 objectMap["expirationDate"] = sc.ExpirationDate 4175 } 4176 if sc.EndDate != nil { 4177 objectMap["endDate"] = sc.EndDate 4178 } 4179 if sc.NotificationDate != nil { 4180 objectMap["notificationDate"] = sc.NotificationDate 4181 } 4182 if sc.PrimaryKey != nil { 4183 objectMap["primaryKey"] = sc.PrimaryKey 4184 } 4185 if sc.SecondaryKey != nil { 4186 objectMap["secondaryKey"] = sc.SecondaryKey 4187 } 4188 if sc.StateComment != nil { 4189 objectMap["stateComment"] = sc.StateComment 4190 } 4191 return json.Marshal(objectMap) 4192} 4193 4194// SubscriptionContractProperties subscription details. 4195type SubscriptionContractProperties struct { 4196 // UserID - The user resource identifier of the subscription owner. The value is a valid relative URL in the format of /users/{uid} where {uid} is a user identifier. 4197 UserID *string `json:"userId,omitempty"` 4198 // ProductID - The product resource identifier of the subscribed product. The value is a valid relative URL in the format of /products/{productId} where {productId} is a product identifier. 4199 ProductID *string `json:"productId,omitempty"` 4200 // Name - The name of the subscription, or null if the subscription has no name. 4201 Name *string `json:"name,omitempty"` 4202 // State - Subscription state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated. Possible values include: 'Suspended', 'Active', 'Expired', 'Submitted', 'Rejected', 'Cancelled' 4203 State SubscriptionState `json:"state,omitempty"` 4204 // CreatedDate - READ-ONLY; Subscription creation date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 4205 CreatedDate *date.Time `json:"createdDate,omitempty"` 4206 // StartDate - Subscription activation date. The setting is for audit purposes only and the subscription is not automatically activated. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 4207 StartDate *date.Time `json:"startDate,omitempty"` 4208 // ExpirationDate - Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 4209 ExpirationDate *date.Time `json:"expirationDate,omitempty"` 4210 // EndDate - Date when subscription was cancelled or expired. The setting is for audit purposes only and the subscription is not automatically cancelled. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 4211 EndDate *date.Time `json:"endDate,omitempty"` 4212 // NotificationDate - Upcoming subscription expiration notification date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 4213 NotificationDate *date.Time `json:"notificationDate,omitempty"` 4214 // PrimaryKey - Subscription primary key. 4215 PrimaryKey *string `json:"primaryKey,omitempty"` 4216 // SecondaryKey - Subscription secondary key. 4217 SecondaryKey *string `json:"secondaryKey,omitempty"` 4218 // StateComment - Optional subscription comment added by an administrator. 4219 StateComment *string `json:"stateComment,omitempty"` 4220} 4221 4222// MarshalJSON is the custom marshaler for SubscriptionContractProperties. 4223func (scp SubscriptionContractProperties) MarshalJSON() ([]byte, error) { 4224 objectMap := make(map[string]interface{}) 4225 if scp.UserID != nil { 4226 objectMap["userId"] = scp.UserID 4227 } 4228 if scp.ProductID != nil { 4229 objectMap["productId"] = scp.ProductID 4230 } 4231 if scp.Name != nil { 4232 objectMap["name"] = scp.Name 4233 } 4234 if scp.State != "" { 4235 objectMap["state"] = scp.State 4236 } 4237 if scp.StartDate != nil { 4238 objectMap["startDate"] = scp.StartDate 4239 } 4240 if scp.ExpirationDate != nil { 4241 objectMap["expirationDate"] = scp.ExpirationDate 4242 } 4243 if scp.EndDate != nil { 4244 objectMap["endDate"] = scp.EndDate 4245 } 4246 if scp.NotificationDate != nil { 4247 objectMap["notificationDate"] = scp.NotificationDate 4248 } 4249 if scp.PrimaryKey != nil { 4250 objectMap["primaryKey"] = scp.PrimaryKey 4251 } 4252 if scp.SecondaryKey != nil { 4253 objectMap["secondaryKey"] = scp.SecondaryKey 4254 } 4255 if scp.StateComment != nil { 4256 objectMap["stateComment"] = scp.StateComment 4257 } 4258 return json.Marshal(objectMap) 4259} 4260 4261// SubscriptionCreateParameters parameters supplied to the Create subscription operation. 4262type SubscriptionCreateParameters struct { 4263 // UserID - User (user id path) for whom subscription is being created in form /users/{uid} 4264 UserID *string `json:"userId,omitempty"` 4265 // ProductID - Product (product id path) for which subscription is being created in form /products/{productId} 4266 ProductID *string `json:"productId,omitempty"` 4267 // Name - Subscription name. 4268 Name *string `json:"name,omitempty"` 4269 // PrimaryKey - Primary subscription key. If not specified during request key will be generated automatically. 4270 PrimaryKey *string `json:"primaryKey,omitempty"` 4271 // SecondaryKey - Secondary subscription key. If not specified during request key will be generated automatically. 4272 SecondaryKey *string `json:"secondaryKey,omitempty"` 4273 // State - Initial subscription state. If no value is specified, subscription is created with Submitted state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated. Possible values include: 'Suspended', 'Active', 'Expired', 'Submitted', 'Rejected', 'Cancelled' 4274 State SubscriptionState `json:"state,omitempty"` 4275} 4276 4277// SubscriptionKeyParameterNamesContract subscription key parameter names details. 4278type SubscriptionKeyParameterNamesContract struct { 4279 // Header - Subscription key header name. 4280 Header *string `json:"header,omitempty"` 4281 // Query - Subscription key query string parameter name. 4282 Query *string `json:"query,omitempty"` 4283} 4284 4285// SubscriptionsDelegationSettingsProperties subscriptions delegation settings properties. 4286type SubscriptionsDelegationSettingsProperties struct { 4287 // Enabled - Enable or disable delegation for subscriptions. 4288 Enabled *bool `json:"enabled,omitempty"` 4289} 4290 4291// SubscriptionUpdateParameters parameters supplied to the Update subscription operation. 4292type SubscriptionUpdateParameters struct { 4293 // UserID - User identifier path: /users/{uid} 4294 UserID *string `json:"userId,omitempty"` 4295 // ProductID - Product identifier path: /products/{productId} 4296 ProductID *string `json:"productId,omitempty"` 4297 // ExpirationDate - Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 4298 ExpirationDate *date.Time `json:"expirationDate,omitempty"` 4299 // Name - Subscription name. 4300 Name *string `json:"name,omitempty"` 4301 // PrimaryKey - Primary subscription key. 4302 PrimaryKey *string `json:"primaryKey,omitempty"` 4303 // SecondaryKey - Secondary subscription key. 4304 SecondaryKey *string `json:"secondaryKey,omitempty"` 4305 // State - Subscription state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated. Possible values include: 'Suspended', 'Active', 'Expired', 'Submitted', 'Rejected', 'Cancelled' 4306 State SubscriptionState `json:"state,omitempty"` 4307 // StateComment - Comments describing subscription state change by the administrator. 4308 StateComment *string `json:"stateComment,omitempty"` 4309} 4310 4311// TenantConfigurationDeployFuture an abstraction for monitoring and retrieving the results of a 4312// long-running operation. 4313type TenantConfigurationDeployFuture struct { 4314 azure.FutureAPI 4315 // Result returns the result of the asynchronous operation. 4316 // If the operation has not completed it will return an error. 4317 Result func(TenantConfigurationClient) (OperationResultContract, error) 4318} 4319 4320// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4321func (future *TenantConfigurationDeployFuture) UnmarshalJSON(body []byte) error { 4322 var azFuture azure.Future 4323 if err := json.Unmarshal(body, &azFuture); err != nil { 4324 return err 4325 } 4326 future.FutureAPI = &azFuture 4327 future.Result = future.result 4328 return nil 4329} 4330 4331// result is the default implementation for TenantConfigurationDeployFuture.Result. 4332func (future *TenantConfigurationDeployFuture) result(client TenantConfigurationClient) (orc OperationResultContract, err error) { 4333 var done bool 4334 done, err = future.DoneWithContext(context.Background(), client) 4335 if err != nil { 4336 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationDeployFuture", "Result", future.Response(), "Polling failure") 4337 return 4338 } 4339 if !done { 4340 orc.Response.Response = future.Response() 4341 err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationDeployFuture") 4342 return 4343 } 4344 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4345 if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent { 4346 orc, err = client.DeployResponder(orc.Response.Response) 4347 if err != nil { 4348 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationDeployFuture", "Result", orc.Response.Response, "Failure responding to request") 4349 } 4350 } 4351 return 4352} 4353 4354// TenantConfigurationSaveFuture an abstraction for monitoring and retrieving the results of a long-running 4355// operation. 4356type TenantConfigurationSaveFuture struct { 4357 azure.FutureAPI 4358 // Result returns the result of the asynchronous operation. 4359 // If the operation has not completed it will return an error. 4360 Result func(TenantConfigurationClient) (OperationResultContract, error) 4361} 4362 4363// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4364func (future *TenantConfigurationSaveFuture) UnmarshalJSON(body []byte) error { 4365 var azFuture azure.Future 4366 if err := json.Unmarshal(body, &azFuture); err != nil { 4367 return err 4368 } 4369 future.FutureAPI = &azFuture 4370 future.Result = future.result 4371 return nil 4372} 4373 4374// result is the default implementation for TenantConfigurationSaveFuture.Result. 4375func (future *TenantConfigurationSaveFuture) result(client TenantConfigurationClient) (orc OperationResultContract, err error) { 4376 var done bool 4377 done, err = future.DoneWithContext(context.Background(), client) 4378 if err != nil { 4379 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationSaveFuture", "Result", future.Response(), "Polling failure") 4380 return 4381 } 4382 if !done { 4383 orc.Response.Response = future.Response() 4384 err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationSaveFuture") 4385 return 4386 } 4387 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4388 if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent { 4389 orc, err = client.SaveResponder(orc.Response.Response) 4390 if err != nil { 4391 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationSaveFuture", "Result", orc.Response.Response, "Failure responding to request") 4392 } 4393 } 4394 return 4395} 4396 4397// TenantConfigurationSyncStateContract tenant Configuration Synchronization State. 4398type TenantConfigurationSyncStateContract struct { 4399 autorest.Response `json:"-"` 4400 // Branch - The name of Git branch. 4401 Branch *string `json:"branch,omitempty"` 4402 // CommitID - The latest commit Id. 4403 CommitID *string `json:"commitId,omitempty"` 4404 // IsExport - value indicating if last sync was save (true) or deploy (false) operation. 4405 IsExport *bool `json:"isExport,omitempty"` 4406 // IsSynced - value indicating if last synchronization was later than the configuration change. 4407 IsSynced *bool `json:"isSynced,omitempty"` 4408 // IsGitEnabled - value indicating whether Git configuration access is enabled. 4409 IsGitEnabled *bool `json:"isGitEnabled,omitempty"` 4410 // SyncDate - The date of the latest synchronization. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 4411 SyncDate *date.Time `json:"syncDate,omitempty"` 4412 // ConfigurationChangeDate - The date of the latest configuration change. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 4413 ConfigurationChangeDate *date.Time `json:"configurationChangeDate,omitempty"` 4414} 4415 4416// TenantConfigurationValidateFuture an abstraction for monitoring and retrieving the results of a 4417// long-running operation. 4418type TenantConfigurationValidateFuture struct { 4419 azure.FutureAPI 4420 // Result returns the result of the asynchronous operation. 4421 // If the operation has not completed it will return an error. 4422 Result func(TenantConfigurationClient) (OperationResultContract, error) 4423} 4424 4425// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4426func (future *TenantConfigurationValidateFuture) UnmarshalJSON(body []byte) error { 4427 var azFuture azure.Future 4428 if err := json.Unmarshal(body, &azFuture); err != nil { 4429 return err 4430 } 4431 future.FutureAPI = &azFuture 4432 future.Result = future.result 4433 return nil 4434} 4435 4436// result is the default implementation for TenantConfigurationValidateFuture.Result. 4437func (future *TenantConfigurationValidateFuture) result(client TenantConfigurationClient) (orc OperationResultContract, err error) { 4438 var done bool 4439 done, err = future.DoneWithContext(context.Background(), client) 4440 if err != nil { 4441 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationValidateFuture", "Result", future.Response(), "Polling failure") 4442 return 4443 } 4444 if !done { 4445 orc.Response.Response = future.Response() 4446 err = azure.NewAsyncOpIncompleteError("apimanagement.TenantConfigurationValidateFuture") 4447 return 4448 } 4449 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4450 if orc.Response.Response, err = future.GetResult(sender); err == nil && orc.Response.Response.StatusCode != http.StatusNoContent { 4451 orc, err = client.ValidateResponder(orc.Response.Response) 4452 if err != nil { 4453 err = autorest.NewErrorWithError(err, "apimanagement.TenantConfigurationValidateFuture", "Result", orc.Response.Response, "Failure responding to request") 4454 } 4455 } 4456 return 4457} 4458 4459// TermsOfServiceProperties terms of service contract properties. 4460type TermsOfServiceProperties struct { 4461 // Text - A terms of service text. 4462 Text *string `json:"text,omitempty"` 4463 // Enabled - Display terms of service during a sign-up process. 4464 Enabled *bool `json:"enabled,omitempty"` 4465 // ConsentRequired - Ask user for consent to the terms of service. 4466 ConsentRequired *bool `json:"consentRequired,omitempty"` 4467} 4468 4469// TokenBodyParameterContract oAuth acquire token request body parameter (www-url-form-encoded). 4470type TokenBodyParameterContract struct { 4471 // Name - body parameter name. 4472 Name *string `json:"name,omitempty"` 4473 // Value - body parameter value. 4474 Value *string `json:"value,omitempty"` 4475} 4476 4477// UserCollection paged Users list representation. 4478type UserCollection struct { 4479 autorest.Response `json:"-"` 4480 // Value - Page values. 4481 Value *[]UserContract `json:"value,omitempty"` 4482 // Count - Total number of entities 4483 Count *int32 `json:"count,omitempty"` 4484 // NextLink - Next page link if any. 4485 NextLink *string `json:"nextLink,omitempty"` 4486} 4487 4488// UserCollectionIterator provides access to a complete listing of UserContract values. 4489type UserCollectionIterator struct { 4490 i int 4491 page UserCollectionPage 4492} 4493 4494// NextWithContext advances to the next value. If there was an error making 4495// the request the iterator does not advance and the error is returned. 4496func (iter *UserCollectionIterator) NextWithContext(ctx context.Context) (err error) { 4497 if tracing.IsEnabled() { 4498 ctx = tracing.StartSpan(ctx, fqdn+"/UserCollectionIterator.NextWithContext") 4499 defer func() { 4500 sc := -1 4501 if iter.Response().Response.Response != nil { 4502 sc = iter.Response().Response.Response.StatusCode 4503 } 4504 tracing.EndSpan(ctx, sc, err) 4505 }() 4506 } 4507 iter.i++ 4508 if iter.i < len(iter.page.Values()) { 4509 return nil 4510 } 4511 err = iter.page.NextWithContext(ctx) 4512 if err != nil { 4513 iter.i-- 4514 return err 4515 } 4516 iter.i = 0 4517 return nil 4518} 4519 4520// Next advances to the next value. If there was an error making 4521// the request the iterator does not advance and the error is returned. 4522// Deprecated: Use NextWithContext() instead. 4523func (iter *UserCollectionIterator) Next() error { 4524 return iter.NextWithContext(context.Background()) 4525} 4526 4527// NotDone returns true if the enumeration should be started or is not yet complete. 4528func (iter UserCollectionIterator) NotDone() bool { 4529 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4530} 4531 4532// Response returns the raw server response from the last page request. 4533func (iter UserCollectionIterator) Response() UserCollection { 4534 return iter.page.Response() 4535} 4536 4537// Value returns the current value or a zero-initialized value if the 4538// iterator has advanced beyond the end of the collection. 4539func (iter UserCollectionIterator) Value() UserContract { 4540 if !iter.page.NotDone() { 4541 return UserContract{} 4542 } 4543 return iter.page.Values()[iter.i] 4544} 4545 4546// Creates a new instance of the UserCollectionIterator type. 4547func NewUserCollectionIterator(page UserCollectionPage) UserCollectionIterator { 4548 return UserCollectionIterator{page: page} 4549} 4550 4551// IsEmpty returns true if the ListResult contains no values. 4552func (uc UserCollection) IsEmpty() bool { 4553 return uc.Value == nil || len(*uc.Value) == 0 4554} 4555 4556// hasNextLink returns true if the NextLink is not empty. 4557func (uc UserCollection) hasNextLink() bool { 4558 return uc.NextLink != nil && len(*uc.NextLink) != 0 4559} 4560 4561// userCollectionPreparer prepares a request to retrieve the next set of results. 4562// It returns nil if no more results exist. 4563func (uc UserCollection) userCollectionPreparer(ctx context.Context) (*http.Request, error) { 4564 if !uc.hasNextLink() { 4565 return nil, nil 4566 } 4567 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4568 autorest.AsJSON(), 4569 autorest.AsGet(), 4570 autorest.WithBaseURL(to.String(uc.NextLink))) 4571} 4572 4573// UserCollectionPage contains a page of UserContract values. 4574type UserCollectionPage struct { 4575 fn func(context.Context, UserCollection) (UserCollection, error) 4576 uc UserCollection 4577} 4578 4579// NextWithContext advances to the next page of values. If there was an error making 4580// the request the page does not advance and the error is returned. 4581func (page *UserCollectionPage) NextWithContext(ctx context.Context) (err error) { 4582 if tracing.IsEnabled() { 4583 ctx = tracing.StartSpan(ctx, fqdn+"/UserCollectionPage.NextWithContext") 4584 defer func() { 4585 sc := -1 4586 if page.Response().Response.Response != nil { 4587 sc = page.Response().Response.Response.StatusCode 4588 } 4589 tracing.EndSpan(ctx, sc, err) 4590 }() 4591 } 4592 for { 4593 next, err := page.fn(ctx, page.uc) 4594 if err != nil { 4595 return err 4596 } 4597 page.uc = next 4598 if !next.hasNextLink() || !next.IsEmpty() { 4599 break 4600 } 4601 } 4602 return nil 4603} 4604 4605// Next advances to the next page of values. If there was an error making 4606// the request the page does not advance and the error is returned. 4607// Deprecated: Use NextWithContext() instead. 4608func (page *UserCollectionPage) Next() error { 4609 return page.NextWithContext(context.Background()) 4610} 4611 4612// NotDone returns true if the page enumeration should be started or is not yet complete. 4613func (page UserCollectionPage) NotDone() bool { 4614 return !page.uc.IsEmpty() 4615} 4616 4617// Response returns the raw server response from the last page request. 4618func (page UserCollectionPage) Response() UserCollection { 4619 return page.uc 4620} 4621 4622// Values returns the slice of values for the current page or nil if there are no values. 4623func (page UserCollectionPage) Values() []UserContract { 4624 if page.uc.IsEmpty() { 4625 return nil 4626 } 4627 return *page.uc.Value 4628} 4629 4630// Creates a new instance of the UserCollectionPage type. 4631func NewUserCollectionPage(cur UserCollection, getNextPage func(context.Context, UserCollection) (UserCollection, error)) UserCollectionPage { 4632 return UserCollectionPage{ 4633 fn: getNextPage, 4634 uc: cur, 4635 } 4636} 4637 4638// UserContract user details. 4639type UserContract struct { 4640 autorest.Response `json:"-"` 4641 // ID - Identifier of the entity. 4642 ID *string `json:"id,omitempty"` 4643 // FirstName - First name. 4644 FirstName *string `json:"firstName,omitempty"` 4645 // LastName - Last name. 4646 LastName *string `json:"lastName,omitempty"` 4647 // Email - Email address. 4648 Email *string `json:"email,omitempty"` 4649 // RegistrationDate - Date of user registration. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 4650 RegistrationDate *date.Time `json:"registrationDate,omitempty"` 4651 // Groups - READ-ONLY; Collection of groups user is part of. 4652 Groups *[]GroupContract `json:"groups,omitempty"` 4653 // State - Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active. Possible values include: 'UserStateActive', 'UserStateBlocked' 4654 State UserState `json:"state,omitempty"` 4655 // Note - Optional note about a user set by the administrator. 4656 Note *string `json:"note,omitempty"` 4657 // Identities - READ-ONLY; Collection of user identities. 4658 Identities *[]UserIdentityContract `json:"identities,omitempty"` 4659} 4660 4661// MarshalJSON is the custom marshaler for UserContract. 4662func (uc UserContract) MarshalJSON() ([]byte, error) { 4663 objectMap := make(map[string]interface{}) 4664 if uc.ID != nil { 4665 objectMap["id"] = uc.ID 4666 } 4667 if uc.FirstName != nil { 4668 objectMap["firstName"] = uc.FirstName 4669 } 4670 if uc.LastName != nil { 4671 objectMap["lastName"] = uc.LastName 4672 } 4673 if uc.Email != nil { 4674 objectMap["email"] = uc.Email 4675 } 4676 if uc.RegistrationDate != nil { 4677 objectMap["registrationDate"] = uc.RegistrationDate 4678 } 4679 if uc.State != "" { 4680 objectMap["state"] = uc.State 4681 } 4682 if uc.Note != nil { 4683 objectMap["note"] = uc.Note 4684 } 4685 return json.Marshal(objectMap) 4686} 4687 4688// UserContractProperties user profile. 4689type UserContractProperties struct { 4690 // FirstName - First name. 4691 FirstName *string `json:"firstName,omitempty"` 4692 // LastName - Last name. 4693 LastName *string `json:"lastName,omitempty"` 4694 // Email - Email address. 4695 Email *string `json:"email,omitempty"` 4696 // RegistrationDate - Date of user registration. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 4697 RegistrationDate *date.Time `json:"registrationDate,omitempty"` 4698 // Groups - READ-ONLY; Collection of groups user is part of. 4699 Groups *[]GroupContract `json:"groups,omitempty"` 4700 // State - Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active. Possible values include: 'UserStateActive', 'UserStateBlocked' 4701 State UserState `json:"state,omitempty"` 4702 // Note - Optional note about a user set by the administrator. 4703 Note *string `json:"note,omitempty"` 4704 // Identities - READ-ONLY; Collection of user identities. 4705 Identities *[]UserIdentityContract `json:"identities,omitempty"` 4706} 4707 4708// MarshalJSON is the custom marshaler for UserContractProperties. 4709func (ucp UserContractProperties) MarshalJSON() ([]byte, error) { 4710 objectMap := make(map[string]interface{}) 4711 if ucp.FirstName != nil { 4712 objectMap["firstName"] = ucp.FirstName 4713 } 4714 if ucp.LastName != nil { 4715 objectMap["lastName"] = ucp.LastName 4716 } 4717 if ucp.Email != nil { 4718 objectMap["email"] = ucp.Email 4719 } 4720 if ucp.RegistrationDate != nil { 4721 objectMap["registrationDate"] = ucp.RegistrationDate 4722 } 4723 if ucp.State != "" { 4724 objectMap["state"] = ucp.State 4725 } 4726 if ucp.Note != nil { 4727 objectMap["note"] = ucp.Note 4728 } 4729 return json.Marshal(objectMap) 4730} 4731 4732// UserCreateParameters parameters supplied to the Create User operation. 4733type UserCreateParameters struct { 4734 // Email - Email address. Must not be empty and must be unique within the service instance. 4735 Email *string `json:"email,omitempty"` 4736 // FirstName - First name. 4737 FirstName *string `json:"firstName,omitempty"` 4738 // LastName - Last name. 4739 LastName *string `json:"lastName,omitempty"` 4740 // Password - User Password. If no value is provided, a default password is generated. 4741 Password *string `json:"password,omitempty"` 4742 // State - Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active. Possible values include: 'UserStateActive', 'UserStateBlocked' 4743 State UserState `json:"state,omitempty"` 4744 // Note - Optional note about a user set by the administrator. 4745 Note *string `json:"note,omitempty"` 4746 // Identities - READ-ONLY; Collection of user identities. 4747 Identities *[]UserIdentityContract `json:"identities,omitempty"` 4748} 4749 4750// MarshalJSON is the custom marshaler for UserCreateParameters. 4751func (ucp UserCreateParameters) MarshalJSON() ([]byte, error) { 4752 objectMap := make(map[string]interface{}) 4753 if ucp.Email != nil { 4754 objectMap["email"] = ucp.Email 4755 } 4756 if ucp.FirstName != nil { 4757 objectMap["firstName"] = ucp.FirstName 4758 } 4759 if ucp.LastName != nil { 4760 objectMap["lastName"] = ucp.LastName 4761 } 4762 if ucp.Password != nil { 4763 objectMap["password"] = ucp.Password 4764 } 4765 if ucp.State != "" { 4766 objectMap["state"] = ucp.State 4767 } 4768 if ucp.Note != nil { 4769 objectMap["note"] = ucp.Note 4770 } 4771 return json.Marshal(objectMap) 4772} 4773 4774// UserEntityBaseParameters user Entity Base Parameters set. 4775type UserEntityBaseParameters struct { 4776 // State - Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active. Possible values include: 'UserStateActive', 'UserStateBlocked' 4777 State UserState `json:"state,omitempty"` 4778 // Note - Optional note about a user set by the administrator. 4779 Note *string `json:"note,omitempty"` 4780 // Identities - READ-ONLY; Collection of user identities. 4781 Identities *[]UserIdentityContract `json:"identities,omitempty"` 4782} 4783 4784// MarshalJSON is the custom marshaler for UserEntityBaseParameters. 4785func (uebp UserEntityBaseParameters) MarshalJSON() ([]byte, error) { 4786 objectMap := make(map[string]interface{}) 4787 if uebp.State != "" { 4788 objectMap["state"] = uebp.State 4789 } 4790 if uebp.Note != nil { 4791 objectMap["note"] = uebp.Note 4792 } 4793 return json.Marshal(objectMap) 4794} 4795 4796// UserIdentityCollection list of Users Identity list representation. 4797type UserIdentityCollection struct { 4798 autorest.Response `json:"-"` 4799 // Value - User Identity values. 4800 Value *[]UserIdentityContract `json:"value,omitempty"` 4801 // Count - Total record count number across all pages. 4802 Count *int64 `json:"count,omitempty"` 4803 // NextLink - Next page link if any. 4804 NextLink *string `json:"nextLink,omitempty"` 4805} 4806 4807// UserIdentityContract user identity details. 4808type UserIdentityContract struct { 4809 // Provider - Identity provider name. 4810 Provider *string `json:"provider,omitempty"` 4811 // ID - Identifier value within provider. 4812 ID *string `json:"id,omitempty"` 4813} 4814 4815// UserTokenParameters parameters supplied to the Get User Token operation. 4816type UserTokenParameters struct { 4817 // KeyType - The Key to be used to generate token for user. Possible values include: 'Primary', 'Secondary' 4818 KeyType KeyType `json:"keyType,omitempty"` 4819 // Expiry - The Expiry time of the Token. Maximum token expiry time is set to 30 days. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. 4820 Expiry *date.Time `json:"expiry,omitempty"` 4821} 4822 4823// UserTokenResult get User Token response details. 4824type UserTokenResult struct { 4825 autorest.Response `json:"-"` 4826 // Value - Shared Access Authorization token for the User. 4827 Value *string `json:"value,omitempty"` 4828} 4829 4830// UserUpdateParameters parameters supplied to the Update User operation. 4831type UserUpdateParameters struct { 4832 // Email - Email address. Must not be empty and must be unique within the service instance. 4833 Email *string `json:"email,omitempty"` 4834 // Password - User Password. 4835 Password *string `json:"password,omitempty"` 4836 // FirstName - First name. 4837 FirstName *string `json:"firstName,omitempty"` 4838 // LastName - Last name. 4839 LastName *string `json:"lastName,omitempty"` 4840 // State - Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active. Possible values include: 'UserStateActive', 'UserStateBlocked' 4841 State UserState `json:"state,omitempty"` 4842 // Note - Optional note about a user set by the administrator. 4843 Note *string `json:"note,omitempty"` 4844 // Identities - READ-ONLY; Collection of user identities. 4845 Identities *[]UserIdentityContract `json:"identities,omitempty"` 4846} 4847 4848// MarshalJSON is the custom marshaler for UserUpdateParameters. 4849func (uup UserUpdateParameters) MarshalJSON() ([]byte, error) { 4850 objectMap := make(map[string]interface{}) 4851 if uup.Email != nil { 4852 objectMap["email"] = uup.Email 4853 } 4854 if uup.Password != nil { 4855 objectMap["password"] = uup.Password 4856 } 4857 if uup.FirstName != nil { 4858 objectMap["firstName"] = uup.FirstName 4859 } 4860 if uup.LastName != nil { 4861 objectMap["lastName"] = uup.LastName 4862 } 4863 if uup.State != "" { 4864 objectMap["state"] = uup.State 4865 } 4866 if uup.Note != nil { 4867 objectMap["note"] = uup.Note 4868 } 4869 return json.Marshal(objectMap) 4870} 4871 4872// X509CertificateName properties of server X509Names. 4873type X509CertificateName struct { 4874 // Name - Common Name of the Certificate. 4875 Name *string `json:"name,omitempty"` 4876 // IssuerCertificateThumbprint - Thumbprint for the Issuer of the Certificate. 4877 IssuerCertificateThumbprint *string `json:"issuerCertificateThumbprint,omitempty"` 4878} 4879