From 7253b6ecb7406f0ce503ae7e7fa3de576ac10728 Mon Sep 17 00:00:00 2001 From: kt Date: Wed, 22 Apr 2020 09:54:22 -0700 Subject: [PATCH] provider: upgrade API Management to 2019-12-01 (#6479) unblocks #2613 #5769 --- azurerm/helpers/azure/api_management.go | 2 +- .../services/apimanagement/client/client.go | 12 +- .../data_source_api_management.go | 16 +- .../data_source_api_management_api.go | 8 +- ...a_source_api_management_api_version_set.go | 6 +- .../data_source_api_management_group.go | 2 +- .../data_source_api_management_product.go | 4 +- .../data_source_api_management_user.go | 2 +- .../migration/management_property.go | 59 + .../services/apimanagement/registration.go | 1 + .../resource_arm_api_management.go | 99 +- .../resource_arm_api_management_api.go | 32 +- ...source_arm_api_management_api_operation.go | 18 +- ...arm_api_management_api_operation_policy.go | 28 +- .../resource_arm_api_management_api_policy.go | 28 +- .../resource_arm_api_management_api_schema.go | 14 +- ...urce_arm_api_management_api_version_set.go | 12 +- ...arm_api_management_authorization_server.go | 22 +- .../resource_arm_api_management_backend.go | 20 +- ...resource_arm_api_management_certificate.go | 12 +- .../resource_arm_api_management_diagnostic.go | 26 +- .../resource_arm_api_management_group.go | 12 +- .../resource_arm_api_management_group_user.go | 8 +- ...rm_api_management_identity_provider_aad.go | 16 +- ...i_management_identity_provider_facebook.go | 16 +- ...api_management_identity_provider_google.go | 16 +- ..._management_identity_provider_microsoft.go | 16 +- ...pi_management_identity_provider_twitter.go | 16 +- .../resource_arm_api_management_logger.go | 18 +- ...resource_arm_api_management_named_value.go | 180 + ..._api_management_openid_connect_provider.go | 12 +- .../resource_arm_api_management_product.go | 12 +- ...resource_arm_api_management_product_api.go | 8 +- ...source_arm_api_management_product_group.go | 8 +- ...ource_arm_api_management_product_policy.go | 28 +- .../resource_arm_api_management_property.go | 43 +- ...esource_arm_api_management_subscription.go | 31 +- .../resource_arm_api_management_user.go | 12 +- ...pi_management_api_operation_policy_test.go | 5 +- ...urce_arm_api_management_api_policy_test.go | 5 +- ...pi_management_authorization_server_test.go | 2 +- ...i_management_identity_provider_aad_test.go | 2 +- ...agement_identity_provider_facebook_test.go | 2 +- ...anagement_identity_provider_google_test.go | 2 +- ...gement_identity_provider_microsoft_test.go | 2 +- ...nagement_identity_provider_twitter_test.go | 2 +- ...rce_arm_api_management_named_value_test.go | 190 + ..._arm_api_management_product_policy_test.go | 5 +- ...source_arm_api_management_property_test.go | 7 +- ...ce_arm_api_management_subscription_test.go | 8 - .../apimanagement/apidiagnosticlogger.go | 500 -- .../apimanagement/diagnosticlogger.go | 476 -- .../apimanagement/api.go | 106 +- .../apimanagement/apidiagnostic.go | 83 +- .../apimanagement/apiexport.go | 2 +- .../apimanagement/apiissue.go | 81 +- .../apimanagement/apiissueattachment.go | 42 +- .../apimanagement/apiissuecomment.go | 40 +- .../apimanagement/apioperation.go | 54 +- .../apimanagement/apioperationpolicy.go | 39 +- .../apimanagement/apipolicy.go | 24 +- .../apimanagement/apiproduct.go | 11 +- .../apimanagement/apirelease.go | 142 +- .../apimanagement/apirevision.go} | 84 +- .../apimanagement/apischema.go | 88 +- .../apimanagement/apitagdescription.go} | 249 +- .../apimanagement/apiversionset.go | 45 +- .../apimanagement/authorizationserver.go | 120 +- .../apimanagement/backend.go | 137 +- .../apimanagement/cache.go} | 284 +- .../apimanagement/certificate.go | 30 +- .../apimanagement/client.go | 2 +- .../apimanagement/delegationsettings.go | 105 +- .../apimanagement/diagnostic.go | 65 +- .../apimanagement/emailtemplate.go | 39 +- .../mgmt/2019-12-01/apimanagement/gateway.go | 931 +++ .../2019-12-01/apimanagement/gatewayapi.go | 473 ++ .../gatewayhostnameconfiguration.go | 566 ++ .../apimanagement/group.go | 48 +- .../apimanagement/groupuser.go | 105 +- .../apimanagement/identityprovider.go | 112 +- .../mgmt/2019-12-01/apimanagement/issue.go | 279 + .../apimanagement/logger.go | 115 +- .../apimanagement/models.go | 5373 +++++++++++------ .../2019-12-01/apimanagement/namedvalue.go | 747 +++ .../apimanagement/networkstatus.go | 4 +- .../apimanagement/notification.go | 8 +- .../notificationrecipientemail.go | 8 +- .../notificationrecipientuser.go | 65 +- .../apimanagement/openidconnectprovider.go | 111 +- .../apimanagement/operation.go | 32 +- .../apimanagement/operations.go | 2 +- .../apimanagement/policy.go | 45 +- .../apimanagement/policydescription.go} | 43 +- .../apimanagement/product.go | 217 +- .../apimanagement/productapi.go | 44 +- .../apimanagement/productgroup.go | 54 +- .../apimanagement/productpolicy.go | 49 +- .../apimanagement/productsubscriptions.go | 24 +- .../apimanagement/quotabycounterkeys.go | 4 +- .../apimanagement/quotabyperiodkeys.go | 4 +- .../apimanagement/region.go} | 48 +- .../apimanagement/reports.go | 194 +- .../apimanagement/service.go | 240 +- .../apimanagement/serviceskus.go | 2 +- .../apimanagement/signinsettings.go | 21 +- .../apimanagement/signupsettings.go | 21 +- .../apimanagement/subscription.go | 154 +- .../apimanagement/tag.go | 242 +- .../apimanagement/tagresource.go | 30 +- .../apimanagement/tenantaccess.go | 183 +- .../apimanagement/tenantaccessgit.go | 93 +- .../apimanagement/tenantconfiguration.go | 17 +- .../apimanagement/user.go | 267 +- .../apimanagement/userconfirmationpassword.go | 132 + .../apimanagement/usergroup.go | 35 +- .../apimanagement/useridentities.go | 27 +- .../apimanagement/usersubscription.go | 42 +- .../apimanagement/version.go | 2 +- vendor/modules.txt | 2 +- website/azurerm.erb | 4 + .../api_management_named_value.html.markdown | 83 + .../r/api_management_property.html.markdown | 2 +- 123 files changed, 10185 insertions(+), 5074 deletions(-) create mode 100644 azurerm/internal/services/apimanagement/migration/management_property.go create mode 100644 azurerm/internal/services/apimanagement/resource_arm_api_management_named_value.go create mode 100644 azurerm/internal/services/apimanagement/tests/resource_arm_api_management_named_value_test.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apidiagnosticlogger.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/diagnosticlogger.go rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/api.go (91%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/apidiagnostic.go (87%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/apiexport.go (99%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/apiissue.go (92%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/apiissueattachment.go (95%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/apiissuecomment.go (95%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/apioperation.go (95%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/apioperationpolicy.go (96%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/apipolicy.go (96%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/apiproduct.go (95%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/apirelease.go (82%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01/apimanagement/apirevisions.go => 2019-12-01/apimanagement/apirevision.go} (60%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/apischema.go (89%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01/apimanagement/tagdescription.go => 2019-12-01/apimanagement/apitagdescription.go} (58%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/apiversionset.go (93%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/authorizationserver.go (85%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/backend.go (87%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01/apimanagement/property.go => 2019-12-01/apimanagement/cache.go} (57%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/certificate.go (95%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/client.go (98%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/delegationsettings.go (79%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/diagnostic.go (86%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/emailtemplate.go (94%) create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/gateway.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/gatewayapi.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/gatewayhostnameconfiguration.go rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/group.go (94%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/groupuser.go (83%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/identityprovider.go (85%) create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/issue.go rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/logger.go (86%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/models.go (82%) create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/namedvalue.go rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/networkstatus.go (99%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/notification.go (98%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/notificationrecipientemail.go (99%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/notificationrecipientuser.go (88%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/openidconnectprovider.go (86%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/operation.go (84%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/operations.go (99%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/policy.go (93%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01/apimanagement/policysnippets.go => 2019-12-01/apimanagement/policydescription.go} (62%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/product.go (76%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/productapi.go (93%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/productgroup.go (91%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/productpolicy.go (94%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/productsubscriptions.go (88%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/quotabycounterkeys.go (99%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/quotabyperiodkeys.go (99%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01/apimanagement/regions.go => 2019-12-01/apimanagement/region.go} (66%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/reports.go (81%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/service.go (82%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/serviceskus.go (99%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/signinsettings.go (96%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/signupsettings.go (96%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/subscription.go (85%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/tag.go (92%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/tagresource.go (85%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/tenantaccess.go (68%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/tenantaccessgit.go (76%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/tenantconfiguration.go (94%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/user.go (75%) create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/userconfirmationpassword.go rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/usergroup.go (82%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/useridentities.go (87%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/usersubscription.go (79%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/version.go (99%) create mode 100644 website/docs/r/api_management_named_value.html.markdown diff --git a/azurerm/helpers/azure/api_management.go b/azurerm/helpers/azure/api_management.go index b693e49feb21..007cfc2cf65d 100644 --- a/azurerm/helpers/azure/api_management.go +++ b/azurerm/helpers/azure/api_management.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" diff --git a/azurerm/internal/services/apimanagement/client/client.go b/azurerm/internal/services/apimanagement/client/client.go index 500d7f31f6f7..736c6dcfba7d 100644 --- a/azurerm/internal/services/apimanagement/client/client.go +++ b/azurerm/internal/services/apimanagement/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/common" ) @@ -20,13 +20,13 @@ type Client struct { GroupUsersClient *apimanagement.GroupUserClient IdentityProviderClient *apimanagement.IdentityProviderClient LoggerClient *apimanagement.LoggerClient + NamedValueClient *apimanagement.NamedValueClient OpenIdConnectClient *apimanagement.OpenIDConnectProviderClient PolicyClient *apimanagement.PolicyClient ProductsClient *apimanagement.ProductClient ProductApisClient *apimanagement.ProductAPIClient ProductGroupsClient *apimanagement.ProductGroupClient ProductPoliciesClient *apimanagement.ProductPolicyClient - PropertyClient *apimanagement.PropertyClient ServiceClient *apimanagement.ServiceClient SignInClient *apimanagement.SignInSettingsClient SignUpClient *apimanagement.SignUpSettingsClient @@ -74,6 +74,9 @@ func NewClient(o *common.ClientOptions) *Client { identityProviderClient := apimanagement.NewIdentityProviderClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(&identityProviderClient.Client, o.ResourceManagerAuthorizer) + namedValueClient := apimanagement.NewNamedValueClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) + o.ConfigureClient(&namedValueClient.Client, o.ResourceManagerAuthorizer) + loggerClient := apimanagement.NewLoggerClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(&loggerClient.Client, o.ResourceManagerAuthorizer) @@ -95,9 +98,6 @@ func NewClient(o *common.ClientOptions) *Client { productPoliciesClient := apimanagement.NewProductPolicyClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(&productPoliciesClient.Client, o.ResourceManagerAuthorizer) - propertyClient := apimanagement.NewPropertyClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) - o.ConfigureClient(&propertyClient.Client, o.ResourceManagerAuthorizer) - serviceClient := apimanagement.NewServiceClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(&serviceClient.Client, o.ResourceManagerAuthorizer) @@ -128,13 +128,13 @@ func NewClient(o *common.ClientOptions) *Client { GroupUsersClient: &groupUsersClient, IdentityProviderClient: &identityProviderClient, LoggerClient: &loggerClient, + NamedValueClient: &namedValueClient, OpenIdConnectClient: &openIdConnectClient, PolicyClient: &policyClient, ProductsClient: &productsClient, ProductApisClient: &productApisClient, ProductGroupsClient: &productGroupsClient, ProductPoliciesClient: &productPoliciesClient, - PropertyClient: &propertyClient, ServiceClient: &serviceClient, SignInClient: &signInClient, SignUpClient: &signUpClient, diff --git a/azurerm/internal/services/apimanagement/data_source_api_management.go b/azurerm/internal/services/apimanagement/data_source_api_management.go index 329c8d0ff5b9..b9c8d6cc5d5c 100644 --- a/azurerm/internal/services/apimanagement/data_source_api_management.go +++ b/azurerm/internal/services/apimanagement/data_source_api_management.go @@ -5,7 +5,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" @@ -161,7 +161,7 @@ func dataSourceApiManagementRead(d *schema.ResourceData, meta interface{}) error return fmt.Errorf("API Management Service %q (Resource Group %q) was not found", name, resourceGroup) } - return fmt.Errorf("Error retrieving API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) + return fmt.Errorf("retrieving API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) } d.SetId(*resp.ID) @@ -185,11 +185,11 @@ func dataSourceApiManagementRead(d *schema.ResourceData, meta interface{}) error d.Set("public_ip_addresses", props.PublicIPAddresses) if err := d.Set("hostname_configuration", flattenDataSourceApiManagementHostnameConfigurations(props.HostnameConfigurations)); err != nil { - return fmt.Errorf("Error setting `hostname_configuration`: %+v", err) + return fmt.Errorf("setting `hostname_configuration`: %+v", err) } if err := d.Set("additional_location", flattenDataSourceApiManagementAdditionalLocations(props.AdditionalLocations)); err != nil { - return fmt.Errorf("Error setting `additional_location`: %+v", err) + return fmt.Errorf("setting `additional_location`: %+v", err) } } @@ -225,20 +225,20 @@ func flattenDataSourceApiManagementHostnameConfigurations(input *[]apimanagement } switch strings.ToLower(string(config.Type)) { - case strings.ToLower(string(apimanagement.Proxy)): + case strings.ToLower(string(apimanagement.HostnameTypeProxy)): // only set SSL binding for proxy types if config.DefaultSslBinding != nil { output["default_ssl_binding"] = *config.DefaultSslBinding } proxyResults = append(proxyResults, output) - case strings.ToLower(string(apimanagement.Management)): + case strings.ToLower(string(apimanagement.HostnameTypeManagement)): managementResults = append(managementResults, output) - case strings.ToLower(string(apimanagement.Portal)): + case strings.ToLower(string(apimanagement.HostnameTypePortal)): portalResults = append(portalResults, output) - case strings.ToLower(string(apimanagement.Scm)): + case strings.ToLower(string(apimanagement.HostnameTypeScm)): scmResults = append(scmResults, output) } } diff --git a/azurerm/internal/services/apimanagement/data_source_api_management_api.go b/azurerm/internal/services/apimanagement/data_source_api_management_api.go index 19822f9e9f3a..122f46e7fe70 100644 --- a/azurerm/internal/services/apimanagement/data_source_api_management_api.go +++ b/azurerm/internal/services/apimanagement/data_source_api_management_api.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -129,7 +129,7 @@ func dataSourceApiManagementApiRead(d *schema.ResourceData, meta interface{}) er return fmt.Errorf("API %q Revision %q (API Management Service %q / Resource Group %q) does not exist!", name, revision, serviceName, resourceGroup) } - return fmt.Errorf("Error retrieving API %q / Revision %q (API Management Service %q / Resource Group %q): %+v", name, revision, serviceName, resourceGroup, err) + return fmt.Errorf("retrieving API %q / Revision %q (API Management Service %q / Resource Group %q): %+v", name, revision, serviceName, resourceGroup, err) } d.SetId(*resp.ID) @@ -151,11 +151,11 @@ func dataSourceApiManagementApiRead(d *schema.ResourceData, meta interface{}) er d.Set("version_set_id", props.APIVersionSetID) if err := d.Set("protocols", flattenApiManagementApiDataSourceProtocols(props.Protocols)); err != nil { - return fmt.Errorf("Error setting `protocols`: %s", err) + return fmt.Errorf("setting `protocols`: %s", err) } if err := d.Set("subscription_key_parameter_names", flattenApiManagementApiDataSourceSubscriptionKeyParamNames(props.SubscriptionKeyParameterNames)); err != nil { - return fmt.Errorf("Error setting `subscription_key_parameter_names`: %+v", err) + return fmt.Errorf("setting `subscription_key_parameter_names`: %+v", err) } } diff --git a/azurerm/internal/services/apimanagement/data_source_api_management_api_version_set.go b/azurerm/internal/services/apimanagement/data_source_api_management_api_version_set.go index 1b2229bfc331..f58c2b67a699 100644 --- a/azurerm/internal/services/apimanagement/data_source_api_management_api_version_set.go +++ b/azurerm/internal/services/apimanagement/data_source_api_management_api_version_set.go @@ -66,14 +66,14 @@ func dataSourceApiManagementApiVersionSetRead(d *schema.ResourceData, meta inter resp, err := client.Get(ctx, resourceGroup, serviceName, name) if err != nil { if utils.ResponseWasNotFound(resp.Response) { - return fmt.Errorf("Error: API Version Set %q (API Management Service %q / Resource Group %q) does not exist!", name, serviceName, resourceGroup) + return fmt.Errorf(": API Version Set %q (API Management Service %q / Resource Group %q) does not exist!", name, serviceName, resourceGroup) } - return fmt.Errorf("Error reading API Version Set %q (API Management Service %q / Resource Group %q): %+v", name, serviceName, resourceGroup, err) + return fmt.Errorf("reading API Version Set %q (API Management Service %q / Resource Group %q): %+v", name, serviceName, resourceGroup, err) } if resp.ID == nil || *resp.ID == "" { - return fmt.Errorf("Error retrieving API Version Set %q (API Management Service %q /Resource Group %q): ID was nil or empty", name, serviceName, resourceGroup) + return fmt.Errorf("retrieving API Version Set %q (API Management Service %q /Resource Group %q): ID was nil or empty", name, serviceName, resourceGroup) } d.SetId(*resp.ID) diff --git a/azurerm/internal/services/apimanagement/data_source_api_management_group.go b/azurerm/internal/services/apimanagement/data_source_api_management_group.go index 4b21b6913998..d0dbf410f8e6 100644 --- a/azurerm/internal/services/apimanagement/data_source_api_management_group.go +++ b/azurerm/internal/services/apimanagement/data_source_api_management_group.go @@ -67,7 +67,7 @@ func dataSourceApiManagementGroupRead(d *schema.ResourceData, meta interface{}) return nil } - return fmt.Errorf("Error making Read request for Group %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("making Read request for Group %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } d.SetId(*resp.ID) diff --git a/azurerm/internal/services/apimanagement/data_source_api_management_product.go b/azurerm/internal/services/apimanagement/data_source_api_management_product.go index be1558d436f8..81786c4c3934 100644 --- a/azurerm/internal/services/apimanagement/data_source_api_management_product.go +++ b/azurerm/internal/services/apimanagement/data_source_api_management_product.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" @@ -79,7 +79,7 @@ func dataSourceApiManagementProductRead(d *schema.ResourceData, meta interface{} return fmt.Errorf("Product %q was not found in API Management Service %q / Resource Group %q", productId, serviceName, resourceGroup) } - return fmt.Errorf("Error making Read request on Product %q (API Management Service %q / Resource Group %q): %+v", productId, serviceName, resourceGroup, err) + return fmt.Errorf("making Read request on Product %q (API Management Service %q / Resource Group %q): %+v", productId, serviceName, resourceGroup, err) } d.SetId(*resp.ID) diff --git a/azurerm/internal/services/apimanagement/data_source_api_management_user.go b/azurerm/internal/services/apimanagement/data_source_api_management_user.go index dae4e68bfdde..d4ec762cc02c 100644 --- a/azurerm/internal/services/apimanagement/data_source_api_management_user.go +++ b/azurerm/internal/services/apimanagement/data_source_api_management_user.go @@ -69,7 +69,7 @@ func dataSourceArmApiManagementUserRead(d *schema.ResourceData, meta interface{} return fmt.Errorf("User %q was not found in API Management Service %q / Resource Group %q", userId, serviceName, resourceGroup) } - return fmt.Errorf("Error making Read request on User %q (API Management Service %q / Resource Group %q): %+v", userId, serviceName, resourceGroup, err) + return fmt.Errorf("making Read request on User %q (API Management Service %q / Resource Group %q): %+v", userId, serviceName, resourceGroup, err) } d.SetId(*resp.ID) diff --git a/azurerm/internal/services/apimanagement/migration/management_property.go b/azurerm/internal/services/apimanagement/migration/management_property.go new file mode 100644 index 000000000000..29c8f1289ed5 --- /dev/null +++ b/azurerm/internal/services/apimanagement/migration/management_property.go @@ -0,0 +1,59 @@ +package migration + +import ( + "log" + "strings" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" +) + +func APIManagementApiPropertyUpgradeV0Schema() *schema.Resource { + return &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": azure.SchemaApiManagementChildName(), + + "resource_group_name": azure.SchemaResourceGroupName(), + + "api_management_name": azure.SchemaApiManagementName(), + + "display_name": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + + "value": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + + "secret": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, + + "tags": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + } +} + +func APIManagementApiPropertyUpgradeV0ToV1(rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) { + oldId := rawState["id"].(string) + newId := strings.Replace(rawState["id"].(string), "/properties/", "/namedValues/", 1) + + log.Printf("[DEBUG] Updating ID from %q to %q", oldId, newId) + + rawState["id"] = newId + + return rawState, nil +} diff --git a/azurerm/internal/services/apimanagement/registration.go b/azurerm/internal/services/apimanagement/registration.go index 40c70ea6b70d..c3edea311cf6 100644 --- a/azurerm/internal/services/apimanagement/registration.go +++ b/azurerm/internal/services/apimanagement/registration.go @@ -52,6 +52,7 @@ func (r Registration) SupportedResources() map[string]*schema.Resource { "azurerm_api_management_identity_provider_microsoft": resourceArmApiManagementIdentityProviderMicrosoft(), "azurerm_api_management_identity_provider_twitter": resourceArmApiManagementIdentityProviderTwitter(), "azurerm_api_management_logger": resourceArmApiManagementLogger(), + "azurerm_api_management_named_value": resourceArmApiManagementNamedValue(), "azurerm_api_management_openid_connect_provider": resourceArmApiManagementOpenIDConnectProvider(), "azurerm_api_management_product": resourceArmApiManagementProduct(), "azurerm_api_management_product_api": resourceArmApiManagementProductApi(), diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management.go b/azurerm/internal/services/apimanagement/resource_arm_api_management.go index 574509b536b7..f52e5682ee56 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management.go @@ -7,7 +7,8 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" + "github.com/hashicorp/go-azure-helpers/response" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -398,7 +399,7 @@ func resourceArmApiManagementServiceCreateUpdate(d *schema.ResourceData, meta in existing, err := client.Get(ctx, resourceGroup, name) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing API Management Service %q (Resource Group %q): %s", name, resourceGroup, err) + return fmt.Errorf("checking for presence of existing API Management Service %q (Resource Group %q): %s", name, resourceGroup, err) } } @@ -445,16 +446,16 @@ func resourceArmApiManagementServiceCreateUpdate(d *schema.ResourceData, meta in future, err := client.CreateOrUpdate(ctx, resourceGroup, name, properties) if err != nil { - return fmt.Errorf("Error creating/updating API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) + return fmt.Errorf("creating/updating API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) } if err = future.WaitForCompletionRef(ctx, client.Client); err != nil { - return fmt.Errorf("Error waiting for creation/update of API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) + return fmt.Errorf("waiting for creation/update of API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) } read, err := client.Get(ctx, resourceGroup, name) if err != nil { - return fmt.Errorf("Error retrieving API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) + return fmt.Errorf("retrieving API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) } if read.ID == nil { @@ -466,15 +467,15 @@ func resourceArmApiManagementServiceCreateUpdate(d *schema.ResourceData, meta in signInSettingsRaw := d.Get("sign_in").([]interface{}) signInSettings := expandApiManagementSignInSettings(signInSettingsRaw) signInClient := meta.(*clients.Client).ApiManagement.SignInClient - if _, err := signInClient.CreateOrUpdate(ctx, resourceGroup, name, signInSettings); err != nil { - return fmt.Errorf("Error setting Sign In settings for API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) + if _, err := signInClient.CreateOrUpdate(ctx, resourceGroup, name, signInSettings, ""); err != nil { + return fmt.Errorf(" setting Sign In settings for API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) } signUpSettingsRaw := d.Get("sign_up").([]interface{}) signUpSettings := expandApiManagementSignUpSettings(signUpSettingsRaw) signUpClient := meta.(*clients.Client).ApiManagement.SignUpClient - if _, err := signUpClient.CreateOrUpdate(ctx, resourceGroup, name, signUpSettings); err != nil { - return fmt.Errorf("Error setting Sign Up settings for API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) + if _, err := signUpClient.CreateOrUpdate(ctx, resourceGroup, name, signUpSettings, ""); err != nil { + return fmt.Errorf(" setting Sign Up settings for API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) } policyClient := meta.(*clients.Client).ApiManagement.PolicyClient @@ -488,14 +489,14 @@ func resourceArmApiManagementServiceCreateUpdate(d *schema.ResourceData, meta in // remove the existing policy if resp, err := policyClient.Delete(ctx, resourceGroup, name, ""); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error removing Policies from API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) + return fmt.Errorf("removing Policies from API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) } } // then add the new one, if it exists if policy != nil { - if _, err := policyClient.CreateOrUpdate(ctx, resourceGroup, name, *policy); err != nil { - return fmt.Errorf("Error setting Policies for API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) + if _, err := policyClient.CreateOrUpdate(ctx, resourceGroup, name, *policy, ""); err != nil { + return fmt.Errorf(" setting Policies for API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) } } } @@ -524,26 +525,26 @@ func resourceArmApiManagementServiceRead(d *schema.ResourceData, meta interface{ return nil } - return fmt.Errorf("Error making Read request on API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) + return fmt.Errorf("making Read request on API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) } signInClient := meta.(*clients.Client).ApiManagement.SignInClient signInSettings, err := signInClient.Get(ctx, resourceGroup, name) if err != nil { - return fmt.Errorf("Error retrieving Sign In Settings for API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) + return fmt.Errorf("retrieving Sign In Settings for API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) } signUpClient := meta.(*clients.Client).ApiManagement.SignUpClient signUpSettings, err := signUpClient.Get(ctx, resourceGroup, name) if err != nil { - return fmt.Errorf("Error retrieving Sign Up Settings for API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) + return fmt.Errorf("retrieving Sign Up Settings for API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) } policyClient := meta.(*clients.Client).ApiManagement.PolicyClient - policy, err := policyClient.Get(ctx, resourceGroup, name) + policy, err := policyClient.Get(ctx, resourceGroup, name, apimanagement.PolicyExportFormatXML) if err != nil { if !utils.ResponseWasNotFound(policy.Response) { - return fmt.Errorf("Error retrieving Policy for API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) + return fmt.Errorf("retrieving Policy for API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) } } @@ -556,7 +557,7 @@ func resourceArmApiManagementServiceRead(d *schema.ResourceData, meta interface{ identity := flattenAzureRmApiManagementMachineIdentity(resp.Identity) if err := d.Set("identity", identity); err != nil { - return fmt.Errorf("Error setting `identity`: %+v", err) + return fmt.Errorf("setting `identity`: %+v", err) } if props := resp.ServiceProperties; props != nil { @@ -571,37 +572,37 @@ func resourceArmApiManagementServiceRead(d *schema.ResourceData, meta interface{ d.Set("public_ip_addresses", props.PublicIPAddresses) if err := d.Set("security", flattenApiManagementSecurityCustomProperties(props.CustomProperties)); err != nil { - return fmt.Errorf("Error setting `security`: %+v", err) + return fmt.Errorf("setting `security`: %+v", err) } if err := d.Set("protocols", flattenApiManagementProtocolsCustomProperties(props.CustomProperties)); err != nil { - return fmt.Errorf("Error setting `protocols`: %+v", err) + return fmt.Errorf("setting `protocols`: %+v", err) } hostnameConfigs := flattenApiManagementHostnameConfigurations(props.HostnameConfigurations, d) if err := d.Set("hostname_configuration", hostnameConfigs); err != nil { - return fmt.Errorf("Error setting `hostname_configuration`: %+v", err) + return fmt.Errorf("setting `hostname_configuration`: %+v", err) } if err := d.Set("additional_location", flattenApiManagementAdditionalLocations(props.AdditionalLocations)); err != nil { - return fmt.Errorf("Error setting `additional_location`: %+v", err) + return fmt.Errorf("setting `additional_location`: %+v", err) } } if err := d.Set("sku_name", flattenApiManagementServiceSkuName(resp.Sku)); err != nil { - return fmt.Errorf("Error setting `sku_name`: %+v", err) + return fmt.Errorf("setting `sku_name`: %+v", err) } if err := d.Set("sign_in", flattenApiManagementSignInSettings(signInSettings)); err != nil { - return fmt.Errorf("Error setting `sign_in`: %+v", err) + return fmt.Errorf("setting `sign_in`: %+v", err) } if err := d.Set("sign_up", flattenApiManagementSignUpSettings(signUpSettings)); err != nil { - return fmt.Errorf("Error setting `sign_up`: %+v", err) + return fmt.Errorf("setting `sign_up`: %+v", err) } if err := d.Set("policy", flattenApiManagementPolicies(d, policy)); err != nil { - return fmt.Errorf("Error setting `policy`: %+v", err) + return fmt.Errorf("setting `policy`: %+v", err) } return tags.FlattenAndSet(d, resp.Tags) @@ -620,10 +621,14 @@ func resourceArmApiManagementServiceDelete(d *schema.ResourceData, meta interfac name := id.Path["service"] log.Printf("[DEBUG] Deleting API Management Service %q (Resource Grouo %q)", name, resourceGroup) - resp, err := client.Delete(ctx, resourceGroup, name) + future, err := client.Delete(ctx, resourceGroup, name) if err != nil { - if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) + return fmt.Errorf("deleting API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) + } + + if err = future.WaitForCompletionRef(ctx, client.Client); err != nil { + if !response.WasNotFound(future.Response()) { + return fmt.Errorf("waiting for deletion of API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) } } @@ -640,21 +645,21 @@ func expandAzureRmApiManagementHostnameConfigurations(d *schema.ResourceData) *[ managementVs := hostnameV["management"].([]interface{}) for _, managementV := range managementVs { v := managementV.(map[string]interface{}) - output := expandApiManagementCommonHostnameConfiguration(v, apimanagement.Management) + output := expandApiManagementCommonHostnameConfiguration(v, apimanagement.HostnameTypeManagement) results = append(results, output) } portalVs := hostnameV["portal"].([]interface{}) for _, portalV := range portalVs { v := portalV.(map[string]interface{}) - output := expandApiManagementCommonHostnameConfiguration(v, apimanagement.Portal) + output := expandApiManagementCommonHostnameConfiguration(v, apimanagement.HostnameTypePortal) results = append(results, output) } proxyVs := hostnameV["proxy"].([]interface{}) for _, proxyV := range proxyVs { v := proxyV.(map[string]interface{}) - output := expandApiManagementCommonHostnameConfiguration(v, apimanagement.Proxy) + output := expandApiManagementCommonHostnameConfiguration(v, apimanagement.HostnameTypeProxy) if value, ok := v["default_ssl_binding"]; ok { output.DefaultSslBinding = utils.Bool(value.(bool)) } @@ -664,7 +669,7 @@ func expandAzureRmApiManagementHostnameConfigurations(d *schema.ResourceData) *[ scmVs := hostnameV["scm"].([]interface{}) for _, scmV := range scmVs { v := scmV.(map[string]interface{}) - output := expandApiManagementCommonHostnameConfiguration(v, apimanagement.Scm) + output := expandApiManagementCommonHostnameConfiguration(v, apimanagement.HostnameTypeScm) results = append(results, output) } } @@ -740,20 +745,20 @@ func flattenApiManagementHostnameConfigurations(input *[]apimanagement.HostnameC } switch strings.ToLower(string(config.Type)) { - case strings.ToLower(string(apimanagement.Proxy)): + case strings.ToLower(string(apimanagement.HostnameTypeProxy)): // only set SSL binding for proxy types if config.DefaultSslBinding != nil { output["default_ssl_binding"] = *config.DefaultSslBinding } proxyResults = append(proxyResults, output) - case strings.ToLower(string(apimanagement.Management)): + case strings.ToLower(string(apimanagement.HostnameTypeManagement)): managementResults = append(managementResults, output) - case strings.ToLower(string(apimanagement.Portal)): + case strings.ToLower(string(apimanagement.HostnameTypePortal)): portalResults = append(portalResults, output) - case strings.ToLower(string(apimanagement.Scm)): + case strings.ToLower(string(apimanagement.HostnameTypeScm)): scmResults = append(scmResults, output) } } @@ -848,7 +853,7 @@ func expandAzureRmApiManagementIdentity(d *schema.ResourceData) *apimanagement.S v := vs[0].(map[string]interface{}) identityType := v["type"].(string) return &apimanagement.ServiceIdentity{ - Type: utils.String(identityType), + Type: apimanagement.ApimIdentityType(identityType), } } @@ -859,9 +864,7 @@ func flattenAzureRmApiManagementMachineIdentity(identity *apimanagement.ServiceI result := make(map[string]interface{}) - if identity.Type != nil { - result["type"] = *identity.Type - } + result["type"] = string(identity.Type) if identity.PrincipalID != nil { result["principal_id"] = identity.PrincipalID.String() @@ -1030,7 +1033,7 @@ func parseApiManagementNilableDictionary(input map[string]*string, key string) b val, err := strconv.ParseBool(*v) if err != nil { - log.Printf("Error parsing %q (key %q) as bool: %+v - assuming false", key, *v, err) + log.Printf(" parsing %q (key %q) as bool: %+v - assuming false", key, *v, err) return false } @@ -1151,8 +1154,8 @@ func expandApiManagementPolicies(input []interface{}) (*apimanagement.PolicyCont if xmlContent != "" { return &apimanagement.PolicyContract{ PolicyContractProperties: &apimanagement.PolicyContractProperties{ - ContentFormat: apimanagement.XML, - PolicyContent: utils.String(xmlContent), + Format: apimanagement.XML, + Value: utils.String(xmlContent), }, }, nil } @@ -1160,8 +1163,8 @@ func expandApiManagementPolicies(input []interface{}) (*apimanagement.PolicyCont if xmlLink != "" { return &apimanagement.PolicyContract{ PolicyContractProperties: &apimanagement.PolicyContractProperties{ - ContentFormat: apimanagement.XMLLink, - PolicyContent: utils.String(xmlLink), + Format: apimanagement.XMLLink, + Value: utils.String(xmlLink), }, }, nil } @@ -1172,8 +1175,8 @@ func expandApiManagementPolicies(input []interface{}) (*apimanagement.PolicyCont func flattenApiManagementPolicies(d *schema.ResourceData, input apimanagement.PolicyContract) []interface{} { xmlContent := "" if props := input.PolicyContractProperties; props != nil { - if props.PolicyContent != nil { - xmlContent = *props.PolicyContent + if props.Value != nil { + xmlContent = *props.Value } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_api.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_api.go index 72bac26ee556..ea79b207f4be 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_api.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_api.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -207,14 +207,14 @@ func resourceArmApiManagementApiCreateUpdate(d *schema.ResourceData, meta interf versionSetId := d.Get("version_set_id").(string) if version != "" && versionSetId == "" { - return fmt.Errorf("Error setting `version` without the required `version_set_id`") + return fmt.Errorf("setting `version` without the required `version_set_id`") } if features.ShouldResourcesBeImported() && d.IsNewResource() { existing, err := client.Get(ctx, resourceGroup, serviceName, apiId) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing API %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing API %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) } } @@ -246,12 +246,12 @@ func resourceArmApiManagementApiCreateUpdate(d *schema.ResourceData, meta interf log.Printf("[DEBUG] Importing API Management API %q of type %q", name, contentFormat) apiParams := apimanagement.APICreateOrUpdateParameter{ APICreateOrUpdateProperties: &apimanagement.APICreateOrUpdateProperties{ - APIType: apiType, - SoapAPIType: soapApiType, - ContentFormat: apimanagement.ContentFormat(contentFormat), - ContentValue: utils.String(contentValue), - Path: utils.String(path), - APIVersion: utils.String(version), + APIType: apiType, + SoapAPIType: soapApiType, + Format: apimanagement.ContentFormat(contentFormat), + Value: utils.String(contentValue), + Path: utils.String(path), + APIVersion: utils.String(version), }, } wsdlSelectorVs := importV["wsdl_selector"].([]interface{}) @@ -271,7 +271,7 @@ func resourceArmApiManagementApiCreateUpdate(d *schema.ResourceData, meta interf } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, apiId, apiParams, ""); err != nil { - return fmt.Errorf("Error creating/updating API Management API %q (Resource Group %q): %+v", name, resourceGroup, err) + return fmt.Errorf("creating/updating API Management API %q (Resource Group %q): %+v", name, resourceGroup, err) } } @@ -304,12 +304,12 @@ func resourceArmApiManagementApiCreateUpdate(d *schema.ResourceData, meta interf } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, apiId, params, ""); err != nil { - return fmt.Errorf("Error creating/updating API %q / Revision %q (API Management Service %q / Resource Group %q): %+v", name, revision, serviceName, resourceGroup, err) + return fmt.Errorf("creating/updating API %q / Revision %q (API Management Service %q / Resource Group %q): %+v", name, revision, serviceName, resourceGroup, err) } read, err := client.Get(ctx, resourceGroup, serviceName, apiId) if err != nil { - return fmt.Errorf("Error retrieving API %q / Revision %q (API Management Service %q / Resource Group %q): %+v", name, revision, serviceName, resourceGroup, err) + return fmt.Errorf("retrieving API %q / Revision %q (API Management Service %q / Resource Group %q): %+v", name, revision, serviceName, resourceGroup, err) } if read.ID == nil { @@ -349,7 +349,7 @@ func resourceArmApiManagementApiRead(d *schema.ResourceData, meta interface{}) e return nil } - return fmt.Errorf("Error retrieving API %q / Revision %q (API Management Service %q / Resource Group %q): %+v", name, revision, serviceName, resourceGroup, err) + return fmt.Errorf("retrieving API %q / Revision %q (API Management Service %q / Resource Group %q): %+v", name, revision, serviceName, resourceGroup, err) } d.Set("api_management_name", serviceName) @@ -369,11 +369,11 @@ func resourceArmApiManagementApiRead(d *schema.ResourceData, meta interface{}) e d.Set("version_set_id", props.APIVersionSetID) if err := d.Set("protocols", flattenApiManagementApiProtocols(props.Protocols)); err != nil { - return fmt.Errorf("Error setting `protocols`: %s", err) + return fmt.Errorf("setting `protocols`: %s", err) } if err := d.Set("subscription_key_parameter_names", flattenApiManagementApiSubscriptionKeyParamNames(props.SubscriptionKeyParameterNames)); err != nil { - return fmt.Errorf("Error setting `subscription_key_parameter_names`: %+v", err) + return fmt.Errorf("setting `subscription_key_parameter_names`: %+v", err) } } @@ -404,7 +404,7 @@ func resourceArmApiManagementApiDelete(d *schema.ResourceData, meta interface{}) deleteRevisions := utils.Bool(true) if resp, err := client.Delete(ctx, resourceGroup, serviceName, name, "", deleteRevisions); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting API %q / Revision %q (API Management Service %q / Resource Group %q): %s", name, revision, serviceName, resourceGroup, err) + return fmt.Errorf("deleting API %q / Revision %q (API Management Service %q / Resource Group %q): %s", name, revision, serviceName, resourceGroup, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_api_operation.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_api_operation.go index 8bb615228573..1a93f71e002d 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_api_operation.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_api_operation.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" @@ -123,7 +123,7 @@ func resourceArmApiManagementApiOperationCreateUpdate(d *schema.ResourceData, me existing, err := client.Get(ctx, resourceGroup, serviceName, apiId, operationId) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing Operation %q (API %q / API Management Service %q / Resource Group %q): %s", operationId, apiId, serviceName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing Operation %q (API %q / API Management Service %q / Resource Group %q): %s", operationId, apiId, serviceName, resourceGroup, err) } } @@ -165,12 +165,12 @@ func resourceArmApiManagementApiOperationCreateUpdate(d *schema.ResourceData, me } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, apiId, operationId, parameters, ""); err != nil { - return fmt.Errorf("Error creating/updating API Operation %q (API %q / API Management Service %q / Resource Group %q): %+v", operationId, apiId, serviceName, resourceGroup, err) + return fmt.Errorf("creating/updating API Operation %q (API %q / API Management Service %q / Resource Group %q): %+v", operationId, apiId, serviceName, resourceGroup, err) } resp, err := client.Get(ctx, resourceGroup, serviceName, apiId, operationId) if err != nil { - return fmt.Errorf("Error retrieving API Operation %q (API %q / API Management Service %q / Resource Group %q): %+v", operationId, apiId, serviceName, resourceGroup, err) + return fmt.Errorf("retrieving API Operation %q (API %q / API Management Service %q / Resource Group %q): %+v", operationId, apiId, serviceName, resourceGroup, err) } d.SetId(*resp.ID) @@ -201,7 +201,7 @@ func resourceArmApiManagementApiOperationRead(d *schema.ResourceData, meta inter return nil } - return fmt.Errorf("Error retrieving API Operation %q (API %q / API Management Service %q / Resource Group %q): %+v", operationId, apiId, serviceName, resourceGroup, err) + return fmt.Errorf("retrieving API Operation %q (API %q / API Management Service %q / Resource Group %q): %+v", operationId, apiId, serviceName, resourceGroup, err) } d.Set("operation_id", operationId) @@ -217,17 +217,17 @@ func resourceArmApiManagementApiOperationRead(d *schema.ResourceData, meta inter flattenedRequest := flattenApiManagementOperationRequestContract(props.Request) if err := d.Set("request", flattenedRequest); err != nil { - return fmt.Errorf("Error flattening `request`: %+v", err) + return fmt.Errorf("flattening `request`: %+v", err) } flattenedResponse := flattenApiManagementOperationResponseContract(props.Responses) if err := d.Set("response", flattenedResponse); err != nil { - return fmt.Errorf("Error flattening `response`: %+v", err) + return fmt.Errorf("flattening `response`: %+v", err) } flattenedTemplateParams := azure.FlattenApiManagementOperationParameterContract(props.TemplateParameters) if err := d.Set("template_parameter", flattenedTemplateParams); err != nil { - return fmt.Errorf("Error flattening `template_parameter`: %+v", err) + return fmt.Errorf("flattening `template_parameter`: %+v", err) } } @@ -252,7 +252,7 @@ func resourceArmApiManagementApiOperationDelete(d *schema.ResourceData, meta int resp, err := client.Delete(ctx, resourceGroup, serviceName, apiId, operationId, "") if err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting API Operation %q (API %q / API Management Service %q / Resource Group %q): %+v", operationId, apiId, serviceName, resourceGroup, err) + return fmt.Errorf("deleting API Operation %q (API %q / API Management Service %q / Resource Group %q): %+v", operationId, apiId, serviceName, resourceGroup, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_api_operation_policy.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_api_operation_policy.go index 64206fa158c4..0992d19f5631 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_api_operation_policy.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_api_operation_policy.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/suppress" @@ -70,10 +70,10 @@ func resourceArmApiManagementAPIOperationPolicyCreateUpdate(d *schema.ResourceDa operationID := d.Get("operation_id").(string) if features.ShouldResourcesBeImported() && d.IsNewResource() { - existing, err := client.Get(ctx, resourceGroup, serviceName, apiName, operationID) + existing, err := client.Get(ctx, resourceGroup, serviceName, apiName, operationID, apimanagement.PolicyExportFormatXML) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing API Operation Policy (API Management Service %q / API %q / Operation %q / Resource Group %q): %s", serviceName, apiName, operationID, resourceGroup, err) + return fmt.Errorf("checking for presence of existing API Operation Policy (API Management Service %q / API %q / Operation %q / Resource Group %q): %s", serviceName, apiName, operationID, resourceGroup, err) } } @@ -89,15 +89,15 @@ func resourceArmApiManagementAPIOperationPolicyCreateUpdate(d *schema.ResourceDa if xmlContent != "" { parameters.PolicyContractProperties = &apimanagement.PolicyContractProperties{ - ContentFormat: apimanagement.XML, - PolicyContent: utils.String(xmlContent), + Format: apimanagement.XML, + Value: utils.String(xmlContent), } } if xmlLink != "" { parameters.PolicyContractProperties = &apimanagement.PolicyContractProperties{ - ContentFormat: apimanagement.XMLLink, - PolicyContent: utils.String(xmlLink), + Format: apimanagement.XMLLink, + Value: utils.String(xmlLink), } } @@ -106,12 +106,12 @@ func resourceArmApiManagementAPIOperationPolicyCreateUpdate(d *schema.ResourceDa } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, apiName, operationID, parameters, ""); err != nil { - return fmt.Errorf("Error creating or updating API Operation Policy (Resource Group %q / API Management Service %q / API %q / Operation %q): %+v", resourceGroup, serviceName, apiName, operationID, err) + return fmt.Errorf("creating or updating API Operation Policy (Resource Group %q / API Management Service %q / API %q / Operation %q): %+v", resourceGroup, serviceName, apiName, operationID, err) } - resp, err := client.Get(ctx, resourceGroup, serviceName, apiName, operationID) + resp, err := client.Get(ctx, resourceGroup, serviceName, apiName, operationID, apimanagement.PolicyExportFormatXML) if err != nil { - return fmt.Errorf("Error retrieving API Operation Policy (Resource Group %q / API Management Service %q / API %q / Operation %q): %+v", resourceGroup, serviceName, apiName, operationID, err) + return fmt.Errorf("retrieving API Operation Policy (Resource Group %q / API Management Service %q / API %q / Operation %q): %+v", resourceGroup, serviceName, apiName, operationID, err) } if resp.ID == nil { return fmt.Errorf("Cannot read ID for API Operation Policy (Resource Group %q / API Management Service %q / API %q / Operation %q): %+v", resourceGroup, serviceName, apiName, operationID, err) @@ -135,7 +135,7 @@ func resourceArmApiManagementAPIOperationPolicyRead(d *schema.ResourceData, meta apiName := id.Path["apis"] operationID := id.Path["operations"] - resp, err := client.Get(ctx, resourceGroup, serviceName, apiName, operationID) + resp, err := client.Get(ctx, resourceGroup, serviceName, apiName, operationID, apimanagement.PolicyExportFormatXML) if err != nil { if utils.ResponseWasNotFound(resp.Response) { log.Printf("[DEBUG] API Operation Policy (Resource Group %q / API Management Service %q / API %q / Operation %q) was not found - removing from state!", resourceGroup, serviceName, apiName, operationID) @@ -143,7 +143,7 @@ func resourceArmApiManagementAPIOperationPolicyRead(d *schema.ResourceData, meta return nil } - return fmt.Errorf("Error making Read request for API Operation Policy (Resource Group %q / API Management Service %q / API %q / Operation %q): %+v", resourceGroup, serviceName, apiName, operationID, err) + return fmt.Errorf("making Read request for API Operation Policy (Resource Group %q / API Management Service %q / API %q / Operation %q): %+v", resourceGroup, serviceName, apiName, operationID, err) } d.Set("resource_group_name", resourceGroup) @@ -154,7 +154,7 @@ func resourceArmApiManagementAPIOperationPolicyRead(d *schema.ResourceData, meta if properties := resp.PolicyContractProperties; properties != nil { // when you submit an `xml_link` to the API, the API downloads this link and stores it as `xml_content` // as such there is no way to set `xml_link` and we'll let Terraform handle it - d.Set("xml_content", properties.PolicyContent) + d.Set("xml_content", properties.Value) } return nil @@ -176,7 +176,7 @@ func resourceArmApiManagementAPIOperationPolicyDelete(d *schema.ResourceData, me if resp, err := client.Delete(ctx, resourceGroup, serviceName, apiName, operationID, ""); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting API Operation Policy (Resource Group %q / API Management Service %q / API %q / Operation %q): %+v", resourceGroup, serviceName, apiName, operationID, err) + return fmt.Errorf("deleting API Operation Policy (Resource Group %q / API Management Service %q / API %q / Operation %q): %+v", resourceGroup, serviceName, apiName, operationID, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_api_policy.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_api_policy.go index 25c08754eae9..1ffc2d7fa2fe 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_api_policy.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_api_policy.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" @@ -67,10 +67,10 @@ func resourceArmApiManagementAPIPolicyCreateUpdate(d *schema.ResourceData, meta apiName := d.Get("api_name").(string) if features.ShouldResourcesBeImported() && d.IsNewResource() { - existing, err := client.Get(ctx, resourceGroup, serviceName, apiName) + existing, err := client.Get(ctx, resourceGroup, serviceName, apiName, apimanagement.PolicyExportFormatXML) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing API Policy (API Management Service %q / API %q / Resource Group %q): %s", serviceName, apiName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing API Policy (API Management Service %q / API %q / Resource Group %q): %s", serviceName, apiName, resourceGroup, err) } } @@ -86,8 +86,8 @@ func resourceArmApiManagementAPIPolicyCreateUpdate(d *schema.ResourceData, meta if xmlLink != "" { parameters.PolicyContractProperties = &apimanagement.PolicyContractProperties{ - ContentFormat: apimanagement.RawxmlLink, - PolicyContent: utils.String(xmlLink), + Format: apimanagement.RawxmlLink, + Value: utils.String(xmlLink), } } else if xmlContent != "" { // this is intentionally an else-if since `xml_content` is computed @@ -98,8 +98,8 @@ func resourceArmApiManagementAPIPolicyCreateUpdate(d *schema.ResourceData, meta } parameters.PolicyContractProperties = &apimanagement.PolicyContractProperties{ - ContentFormat: apimanagement.Rawxml, - PolicyContent: utils.String(xmlContent), + Format: apimanagement.Rawxml, + Value: utils.String(xmlContent), } } @@ -108,12 +108,12 @@ func resourceArmApiManagementAPIPolicyCreateUpdate(d *schema.ResourceData, meta } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, apiName, parameters, ""); err != nil { - return fmt.Errorf("Error creating or updating API Policy (Resource Group %q / API Management Service %q / API %q): %+v", resourceGroup, serviceName, apiName, err) + return fmt.Errorf("creating or updating API Policy (Resource Group %q / API Management Service %q / API %q): %+v", resourceGroup, serviceName, apiName, err) } - resp, err := client.Get(ctx, resourceGroup, serviceName, apiName) + resp, err := client.Get(ctx, resourceGroup, serviceName, apiName, apimanagement.PolicyExportFormatXML) if err != nil { - return fmt.Errorf("Error retrieving API Policy (Resource Group %q / API Management Service %q / API %q): %+v", resourceGroup, serviceName, apiName, err) + return fmt.Errorf("retrieving API Policy (Resource Group %q / API Management Service %q / API %q): %+v", resourceGroup, serviceName, apiName, err) } if resp.ID == nil { return fmt.Errorf("Cannot read ID for API Policy (Resource Group %q / API Management Service %q / API %q): %+v", resourceGroup, serviceName, apiName, err) @@ -136,7 +136,7 @@ func resourceArmApiManagementAPIPolicyRead(d *schema.ResourceData, meta interfac serviceName := id.Path["service"] apiName := id.Path["apis"] - resp, err := client.Get(ctx, resourceGroup, serviceName, apiName) + resp, err := client.Get(ctx, resourceGroup, serviceName, apiName, apimanagement.PolicyExportFormatXML) if err != nil { if utils.ResponseWasNotFound(resp.Response) { log.Printf("[DEBUG] API Policy (Resource Group %q / API Management Service %q / API %q) was not found - removing from state!", resourceGroup, serviceName, apiName) @@ -144,7 +144,7 @@ func resourceArmApiManagementAPIPolicyRead(d *schema.ResourceData, meta interfac return nil } - return fmt.Errorf("Error making Read request for API Policy (Resource Group %q / API Management Service %q / API %q): %+v", resourceGroup, serviceName, apiName, err) + return fmt.Errorf("making Read request for API Policy (Resource Group %q / API Management Service %q / API %q): %+v", resourceGroup, serviceName, apiName, err) } d.Set("resource_group_name", resourceGroup) @@ -153,7 +153,7 @@ func resourceArmApiManagementAPIPolicyRead(d *schema.ResourceData, meta interfac if properties := resp.PolicyContractProperties; properties != nil { policyContent := "" - if pc := properties.PolicyContent; pc != nil { + if pc := properties.Value; pc != nil { policyContent = html.UnescapeString(*pc) } @@ -180,7 +180,7 @@ func resourceArmApiManagementAPIPolicyDelete(d *schema.ResourceData, meta interf if resp, err := client.Delete(ctx, resourceGroup, serviceName, apiName, ""); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting API Policy (Resource Group %q / API Management Service %q / API %q): %+v", resourceGroup, serviceName, apiName, err) + return fmt.Errorf("deleting API Policy (Resource Group %q / API Management Service %q / API %q): %+v", resourceGroup, serviceName, apiName, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_api_schema.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_api_schema.go index 165750c8bb6b..d9b808f6ec17 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_api_schema.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_api_schema.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -71,7 +71,7 @@ func resourceArmApiManagementApiSchemaCreateUpdate(d *schema.ResourceData, meta existing, err := client.Get(ctx, resourceGroup, serviceName, apiName, schemaID) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing API Schema %q (API Management Service %q / API %q / Resource Group %q): %s", schemaID, serviceName, apiName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing API Schema %q (API Management Service %q / API %q / Resource Group %q): %s", schemaID, serviceName, apiName, resourceGroup, err) } } @@ -92,12 +92,12 @@ func resourceArmApiManagementApiSchemaCreateUpdate(d *schema.ResourceData, meta } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, apiName, schemaID, parameters, ""); err != nil { - return fmt.Errorf("Error creating or updating API Schema %q (API Management Service %q / API %q / Resource Group %q): %s", schemaID, serviceName, apiName, resourceGroup, err) + return fmt.Errorf("creating or updating API Schema %q (API Management Service %q / API %q / Resource Group %q): %s", schemaID, serviceName, apiName, resourceGroup, err) } resp, err := client.Get(ctx, resourceGroup, serviceName, apiName, schemaID) if err != nil { - return fmt.Errorf("Error retrieving API Schema %q (API Management Service %q / API %q / Resource Group %q): %s", schemaID, serviceName, apiName, resourceGroup, err) + return fmt.Errorf("retrieving API Schema %q (API Management Service %q / API %q / Resource Group %q): %s", schemaID, serviceName, apiName, resourceGroup, err) } if resp.ID == nil { return fmt.Errorf("Cannot read ID for API Schema %q (API Management Service %q / API %q / Resource Group %q): %s", schemaID, serviceName, apiName, resourceGroup, err) @@ -129,7 +129,7 @@ func resourceArmApiManagementApiSchemaRead(d *schema.ResourceData, meta interfac return nil } - return fmt.Errorf("Error making Read request for API Schema %q (API Management Service %q / API %q / Resource Group %q): %s", schemaID, serviceName, apiName, resourceGroup, err) + return fmt.Errorf("making Read request for API Schema %q (API Management Service %q / API %q / Resource Group %q): %s", schemaID, serviceName, apiName, resourceGroup, err) } d.Set("resource_group_name", resourceGroup) @@ -161,9 +161,9 @@ func resourceArmApiManagementApiSchemaDelete(d *schema.ResourceData, meta interf apiName := id.Path["apis"] schemaID := id.Path["schemas"] - if resp, err := client.Delete(ctx, resourceGroup, serviceName, apiName, schemaID, ""); err != nil { + if resp, err := client.Delete(ctx, resourceGroup, serviceName, apiName, schemaID, "", utils.Bool(false)); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting API Schema %q (API Management Service %q / API %q / Resource Group %q): %s", schemaID, serviceName, apiName, resourceGroup, err) + return fmt.Errorf("deleting API Schema %q (API Management Service %q / API %q / Resource Group %q): %s", schemaID, serviceName, apiName, resourceGroup, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_api_version_set.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_api_version_set.go index 987d79b8593d..6983656a61db 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_api_version_set.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_api_version_set.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -92,7 +92,7 @@ func resourceArmApiManagementApiVersionSetCreateUpdate(d *schema.ResourceData, m existing, err := client.Get(ctx, resourceGroup, serviceName, name) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing Api Version Set %q (Api Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing Api Version Set %q (Api Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) } } @@ -147,12 +147,12 @@ func resourceArmApiManagementApiVersionSetCreateUpdate(d *schema.ResourceData, m } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, name, parameters, ""); err != nil { - return fmt.Errorf("Error creating/updating Api Version Set %q (Resource Group %q / Api Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("creating/updating Api Version Set %q (Resource Group %q / Api Management Service %q): %+v", name, resourceGroup, serviceName, err) } resp, err := client.Get(ctx, resourceGroup, serviceName, name) if err != nil { - return fmt.Errorf("Error retrieving Api Version Set %q (Resource Group %q / Api Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("retrieving Api Version Set %q (Resource Group %q / Api Management Service %q): %+v", name, resourceGroup, serviceName, err) } if resp.ID == nil { return fmt.Errorf("Cannot read ID for Api Version Set %q (Resource Group %q / Api Management Service %q)", name, resourceGroup, serviceName) @@ -183,7 +183,7 @@ func resourceArmApiManagementApiVersionSetRead(d *schema.ResourceData, meta inte return nil } - return fmt.Errorf("Error making Read request for Api Version Set %q (Resource Group %q / Api Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("making Read request for Api Version Set %q (Resource Group %q / Api Management Service %q): %+v", name, resourceGroup, serviceName, err) } d.Set("name", resp.Name) @@ -216,7 +216,7 @@ func resourceArmApiManagementApiVersionSetDelete(d *schema.ResourceData, meta in if resp, err := client.Delete(ctx, resourceGroup, serviceName, name, ""); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting Api Version Set %q (Resource Group %q / Api Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("deleting Api Version Set %q (Resource Group %q / Api Management Service %q): %+v", name, resourceGroup, serviceName, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_authorization_server.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_authorization_server.go index 204c26d7cf4f..b1b868b7a4eb 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_authorization_server.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_authorization_server.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -197,7 +197,7 @@ func resourceArmApiManagementAuthorizationServerCreateUpdate(d *schema.ResourceD existing, err := client.Get(ctx, resourceGroup, serviceName, name) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing Authorization Server %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing Authorization Server %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) } } @@ -262,12 +262,12 @@ func resourceArmApiManagementAuthorizationServerCreateUpdate(d *schema.ResourceD } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, name, params, ""); err != nil { - return fmt.Errorf("Error creating/updating Authorization Server %q (API Management Service %q / Resource Group %q): %+v", name, serviceName, resourceGroup, err) + return fmt.Errorf("creating/updating Authorization Server %q (API Management Service %q / Resource Group %q): %+v", name, serviceName, resourceGroup, err) } read, err := client.Get(ctx, resourceGroup, serviceName, name) if err != nil { - return fmt.Errorf("Error retrieving Authorization Server %q (API Management Service %q / Resource Group %q): %+v", name, serviceName, resourceGroup, err) + return fmt.Errorf("retrieving Authorization Server %q (API Management Service %q / Resource Group %q): %+v", name, serviceName, resourceGroup, err) } if read.ID == nil { @@ -300,7 +300,7 @@ func resourceArmApiManagementAuthorizationServerRead(d *schema.ResourceData, met return nil } - return fmt.Errorf("Error retrieving Authorization Server %q (API Management Service %q / Resource Group %q): %+v", name, serviceName, resourceGroup, err) + return fmt.Errorf("retrieving Authorization Server %q (API Management Service %q / Resource Group %q): %+v", name, serviceName, resourceGroup, err) } d.Set("api_management_name", serviceName) @@ -321,23 +321,23 @@ func resourceArmApiManagementAuthorizationServerRead(d *schema.ResourceData, met d.Set("token_endpoint", props.TokenEndpoint) if err := d.Set("authorization_methods", flattenApiManagementAuthorizationServerAuthorizationMethods(props.AuthorizationMethods)); err != nil { - return fmt.Errorf("Error flattening `authorization_methods`: %+v", err) + return fmt.Errorf("flattening `authorization_methods`: %+v", err) } if err := d.Set("bearer_token_sending_methods", flattenApiManagementAuthorizationServerBearerTokenSendingMethods(props.BearerTokenSendingMethods)); err != nil { - return fmt.Errorf("Error flattening `bearer_token_sending_methods`: %+v", err) + return fmt.Errorf("flattening `bearer_token_sending_methods`: %+v", err) } if err := d.Set("client_authentication_method", flattenApiManagementAuthorizationServerClientAuthenticationMethods(props.ClientAuthenticationMethod)); err != nil { - return fmt.Errorf("Error flattening `client_authentication_method`: %+v", err) + return fmt.Errorf("flattening `client_authentication_method`: %+v", err) } if err := d.Set("grant_types", flattenApiManagementAuthorizationServerGrantTypes(props.GrantTypes)); err != nil { - return fmt.Errorf("Error flattening `grant_types`: %+v", err) + return fmt.Errorf("flattening `grant_types`: %+v", err) } if err := d.Set("token_body_parameter", flattenApiManagementAuthorizationServerTokenBodyParameters(props.TokenBodyParameters)); err != nil { - return fmt.Errorf("Error flattening `token_body_parameter`: %+v", err) + return fmt.Errorf("flattening `token_body_parameter`: %+v", err) } } @@ -360,7 +360,7 @@ func resourceArmApiManagementAuthorizationServerDelete(d *schema.ResourceData, m if resp, err := client.Delete(ctx, resourceGroup, serviceName, name, ""); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting Authorization Server %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) + return fmt.Errorf("deleting Authorization Server %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_backend.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_backend.go index b4bde35a0cbf..7b807633488e 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_backend.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_backend.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -248,7 +248,7 @@ func resourceArmApiManagementBackendCreateUpdate(d *schema.ResourceData, meta in existing, err := client.Get(ctx, resourceGroup, serviceName, name) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing backend %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing backend %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) } } @@ -296,12 +296,12 @@ func resourceArmApiManagementBackendCreateUpdate(d *schema.ResourceData, meta in } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, name, backendContract, ""); err != nil { - return fmt.Errorf("Error creating/updating backend %q (API Management Service %q / Resource Group %q): %+v", name, serviceName, resourceGroup, err) + return fmt.Errorf("creating/updating backend %q (API Management Service %q / Resource Group %q): %+v", name, serviceName, resourceGroup, err) } read, err := client.Get(ctx, resourceGroup, serviceName, name) if err != nil { - return fmt.Errorf("Error retrieving backend %q (API Management Service %q / Resource Group %q): %+v", name, serviceName, resourceGroup, err) + return fmt.Errorf("retrieving backend %q (API Management Service %q / Resource Group %q): %+v", name, serviceName, resourceGroup, err) } if read.ID == nil { @@ -333,7 +333,7 @@ func resourceArmApiManagementBackendRead(d *schema.ResourceData, meta interface{ return nil } - return fmt.Errorf("Error retrieving backend %q (API Management Service %q / Resource Group %q): %+v", name, serviceName, resourceGroup, err) + return fmt.Errorf("retrieving backend %q (API Management Service %q / Resource Group %q): %+v", name, serviceName, resourceGroup, err) } d.Set("name", name) @@ -347,18 +347,18 @@ func resourceArmApiManagementBackendRead(d *schema.ResourceData, meta interface{ d.Set("title", props.Title) d.Set("url", props.URL) if err := d.Set("credentials", flattenApiManagementBackendCredentials(props.Credentials)); err != nil { - return fmt.Errorf("Error setting `credentials`: %s", err) + return fmt.Errorf("setting `credentials`: %s", err) } if err := d.Set("proxy", flattenApiManagementBackendProxy(props.Proxy)); err != nil { - return fmt.Errorf("Error setting `proxy`: %s", err) + return fmt.Errorf("setting `proxy`: %s", err) } if properties := props.Properties; properties != nil { if err := d.Set("service_fabric_cluster", flattenApiManagementBackendServiceFabricCluster(properties.ServiceFabricCluster)); err != nil { - return fmt.Errorf("Error setting `service_fabric_cluster`: %s", err) + return fmt.Errorf("setting `service_fabric_cluster`: %s", err) } } if err := d.Set("tls", flattenApiManagementBackendTls(props.TLS)); err != nil { - return fmt.Errorf("Error setting `tls`: %s", err) + return fmt.Errorf("setting `tls`: %s", err) } } @@ -381,7 +381,7 @@ func resourceArmApiManagementBackendDelete(d *schema.ResourceData, meta interfac if resp, err := client.Delete(ctx, resourceGroup, serviceName, name, ""); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting backend %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) + return fmt.Errorf("deleting backend %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_certificate.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_certificate.go index a540651eebb2..d1b4dcacbcc3 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_certificate.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_certificate.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -86,7 +86,7 @@ func resourceArmApiManagementCertificateCreateUpdate(d *schema.ResourceData, met existing, err := client.Get(ctx, resourceGroup, serviceName, name) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing Certificate %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing Certificate %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) } } @@ -103,12 +103,12 @@ func resourceArmApiManagementCertificateCreateUpdate(d *schema.ResourceData, met } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, name, parameters, ""); err != nil { - return fmt.Errorf("Error creating or updating Certificate %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("creating or updating Certificate %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } resp, err := client.Get(ctx, resourceGroup, serviceName, name) if err != nil { - return fmt.Errorf("Error retrieving Certificate %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("retrieving Certificate %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } if resp.ID == nil { return fmt.Errorf("Cannot read ID for Certificate %q (Resource Group %q / API Management Service %q)", name, resourceGroup, serviceName) @@ -139,7 +139,7 @@ func resourceArmApiManagementCertificateRead(d *schema.ResourceData, meta interf return nil } - return fmt.Errorf("Error making Read request for Certificate %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("making Read request for Certificate %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } d.Set("name", resp.Name) @@ -174,7 +174,7 @@ func resourceArmApiManagementCertificateDelete(d *schema.ResourceData, meta inte if resp, err := client.Delete(ctx, resourceGroup, serviceName, name, ""); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting Certificate %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("deleting Certificate %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_diagnostic.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_diagnostic.go index adffb9250b79..d5024163d77b 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_diagnostic.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_diagnostic.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -48,8 +48,9 @@ func resourceArmApiManagementDiagnostic() *schema.Resource { "api_management_name": azure.SchemaApiManagementName(), "enabled": { - Type: schema.TypeBool, - Required: true, + Type: schema.TypeBool, + Optional: true, + Deprecated: "this property has been removed from the API and will be removed in version 3.0 of the provider", }, }, } @@ -63,13 +64,12 @@ func resourceArmApiManagementDiagnosticCreateUpdate(d *schema.ResourceData, meta diagnosticId := d.Get("identifier").(string) resourceGroup := d.Get("resource_group_name").(string) serviceName := d.Get("api_management_name").(string) - enabled := d.Get("enabled").(bool) if features.ShouldResourcesBeImported() && d.IsNewResource() { existing, err := client.Get(ctx, resourceGroup, serviceName, diagnosticId) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing Diagnostic %q (API Management Service %q / Resource Group %q): %s", diagnosticId, serviceName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing Diagnostic %q (API Management Service %q / Resource Group %q): %s", diagnosticId, serviceName, resourceGroup, err) } } @@ -79,18 +79,16 @@ func resourceArmApiManagementDiagnosticCreateUpdate(d *schema.ResourceData, meta } parameters := apimanagement.DiagnosticContract{ - DiagnosticContractProperties: &apimanagement.DiagnosticContractProperties{ - Enabled: utils.Bool(enabled), - }, + DiagnosticContractProperties: &apimanagement.DiagnosticContractProperties{}, } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, diagnosticId, parameters, ""); err != nil { - return fmt.Errorf("Error creating or updating Diagnostic %q (Resource Group %q / API Management Service %q): %+v", diagnosticId, resourceGroup, serviceName, err) + return fmt.Errorf("creating or updating Diagnostic %q (Resource Group %q / API Management Service %q): %+v", diagnosticId, resourceGroup, serviceName, err) } resp, err := client.Get(ctx, resourceGroup, serviceName, diagnosticId) if err != nil { - return fmt.Errorf("Error retrieving Diagnostic %q (Resource Group %q / API Management Service %q): %+v", diagnosticId, resourceGroup, serviceName, err) + return fmt.Errorf("retrieving Diagnostic %q (Resource Group %q / API Management Service %q): %+v", diagnosticId, resourceGroup, serviceName, err) } if resp.ID == nil { return fmt.Errorf("Cannot read ID for Diagnostic %q (Resource Group %q / API Management Service %q)", diagnosticId, resourceGroup, serviceName) @@ -121,17 +119,13 @@ func resourceArmApiManagementDiagnosticRead(d *schema.ResourceData, meta interfa return nil } - return fmt.Errorf("Error making Read request for Diagnostic %q (Resource Group %q / API Management Service %q): %+v", diagnosticId, resourceGroup, serviceName, err) + return fmt.Errorf("making Read request for Diagnostic %q (Resource Group %q / API Management Service %q): %+v", diagnosticId, resourceGroup, serviceName, err) } d.Set("identifier", resp.Name) d.Set("resource_group_name", resourceGroup) d.Set("api_management_name", serviceName) - if props := resp.DiagnosticContractProperties; props != nil { - d.Set("enabled", props.Enabled) - } - return nil } @@ -150,7 +144,7 @@ func resourceArmApiManagementDiagnosticDelete(d *schema.ResourceData, meta inter if resp, err := client.Delete(ctx, resourceGroup, serviceName, diagnosticId, ""); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting Diagnostic %q (Resource Group %q / API Management Service %q): %+v", diagnosticId, resourceGroup, serviceName, err) + return fmt.Errorf("deleting Diagnostic %q (Resource Group %q / API Management Service %q): %+v", diagnosticId, resourceGroup, serviceName, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_group.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_group.go index 229239105e87..a35d1e34af61 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_group.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_group.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -89,7 +89,7 @@ func resourceArmApiManagementGroupCreateUpdate(d *schema.ResourceData, meta inte existing, err := client.Get(ctx, resourceGroup, serviceName, name) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing Group %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing Group %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) } } @@ -108,12 +108,12 @@ func resourceArmApiManagementGroupCreateUpdate(d *schema.ResourceData, meta inte } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, name, parameters, ""); err != nil { - return fmt.Errorf("Error creating or updating Group %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("creating or updating Group %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } resp, err := client.Get(ctx, resourceGroup, serviceName, name) if err != nil { - return fmt.Errorf("Error retrieving Group %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("retrieving Group %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } if resp.ID == nil { return fmt.Errorf("Cannot read ID for Group %q (Resource Group %q / API Management Service %q)", name, resourceGroup, serviceName) @@ -144,7 +144,7 @@ func resourceArmApiManagementGroupRead(d *schema.ResourceData, meta interface{}) return nil } - return fmt.Errorf("Error making Read request for Group %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("making Read request for Group %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } d.Set("name", resp.Name) @@ -176,7 +176,7 @@ func resourceArmApiManagementGroupDelete(d *schema.ResourceData, meta interface{ if resp, err := client.Delete(ctx, resourceGroup, serviceName, name, ""); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting Group %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("deleting Group %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_group_user.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_group_user.go index 2df9f01a1266..9942b7dd0801 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_group_user.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_group_user.go @@ -56,7 +56,7 @@ func resourceArmApiManagementGroupUserCreate(d *schema.ResourceData, meta interf resp, err := client.CheckEntityExists(ctx, resourceGroup, serviceName, groupName, userId) if err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error checking for present of existing User %q / Group %q (API Management Service %q / Resource Group %q): %+v", userId, groupName, serviceName, resourceGroup, err) + return fmt.Errorf("checking for present of existing User %q / Group %q (API Management Service %q / Resource Group %q): %+v", userId, groupName, serviceName, resourceGroup, err) } } @@ -69,7 +69,7 @@ func resourceArmApiManagementGroupUserCreate(d *schema.ResourceData, meta interf resp, err := client.Create(ctx, resourceGroup, serviceName, groupName, userId) if err != nil { - return fmt.Errorf("Error adding User %q to Group %q (API Management Service %q / Resource Group %q): %+v", userId, groupName, serviceName, resourceGroup, err) + return fmt.Errorf("adding User %q to Group %q (API Management Service %q / Resource Group %q): %+v", userId, groupName, serviceName, resourceGroup, err) } // there's no Read so this is best-effort @@ -100,7 +100,7 @@ func resourceArmApiManagementGroupUserRead(d *schema.ResourceData, meta interfac return nil } - return fmt.Errorf("Error retrieving User %q / Group %q (API Management Service %q / Resource Group %q): %+v", userId, groupName, serviceName, resourceGroup, err) + return fmt.Errorf("retrieving User %q / Group %q (API Management Service %q / Resource Group %q): %+v", userId, groupName, serviceName, resourceGroup, err) } d.Set("group_name", groupName) @@ -127,7 +127,7 @@ func resourceArmApiManagementGroupUserDelete(d *schema.ResourceData, meta interf if resp, err := client.Delete(ctx, resourceGroup, serviceName, groupName, userId); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error removing User %q from Group %q (API Management Service %q / Resource Group %q): %+v", userId, groupName, serviceName, resourceGroup, err) + return fmt.Errorf("removing User %q from Group %q (API Management Service %q / Resource Group %q): %+v", userId, groupName, serviceName, resourceGroup, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_aad.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_aad.go index 3cd60f701a13..d08e3572da8a 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_aad.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_aad.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -78,7 +78,7 @@ func resourceArmApiManagementIdentityProviderAADCreateUpdate(d *schema.ResourceD existing, err := client.Get(ctx, resourceGroup, serviceName, apimanagement.Aad) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing Identity Provider %q (API Management Service %q / Resource Group %q): %s", apimanagement.Aad, serviceName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing Identity Provider %q (API Management Service %q / Resource Group %q): %s", apimanagement.Aad, serviceName, resourceGroup, err) } } @@ -87,8 +87,8 @@ func resourceArmApiManagementIdentityProviderAADCreateUpdate(d *schema.ResourceD } } - parameters := apimanagement.IdentityProviderContract{ - IdentityProviderContractProperties: &apimanagement.IdentityProviderContractProperties{ + parameters := apimanagement.IdentityProviderCreateContract{ + IdentityProviderCreateContractProperties: &apimanagement.IdentityProviderCreateContractProperties{ ClientID: utils.String(clientID), ClientSecret: utils.String(clientSecret), Type: apimanagement.Aad, @@ -97,12 +97,12 @@ func resourceArmApiManagementIdentityProviderAADCreateUpdate(d *schema.ResourceD } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, apimanagement.Aad, parameters, ""); err != nil { - return fmt.Errorf("Error creating or updating Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Aad, resourceGroup, serviceName, err) + return fmt.Errorf("creating or updating Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Aad, resourceGroup, serviceName, err) } resp, err := client.Get(ctx, resourceGroup, serviceName, apimanagement.Aad) if err != nil { - return fmt.Errorf("Error retrieving Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Aad, resourceGroup, serviceName, err) + return fmt.Errorf("retrieving Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Aad, resourceGroup, serviceName, err) } if resp.ID == nil { return fmt.Errorf("Cannot read ID for Identity Provider %q (Resource Group %q / API Management Service %q)", apimanagement.Aad, resourceGroup, serviceName) @@ -133,7 +133,7 @@ func resourceArmApiManagementIdentityProviderAADRead(d *schema.ResourceData, met return nil } - return fmt.Errorf("Error making Read request for Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) + return fmt.Errorf("making Read request for Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) } d.Set("resource_group_name", resourceGroup) @@ -163,7 +163,7 @@ func resourceArmApiManagementIdentityProviderAADDelete(d *schema.ResourceData, m if resp, err := client.Delete(ctx, resourceGroup, serviceName, apimanagement.IdentityProviderType(identityProviderName), ""); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) + return fmt.Errorf("deleting Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_facebook.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_facebook.go index 5b2de8d111c4..82d3cb3cd94b 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_facebook.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_facebook.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -68,7 +68,7 @@ func resourceArmApiManagementIdentityProviderFacebookCreateUpdate(d *schema.Reso existing, err := client.Get(ctx, resourceGroup, serviceName, apimanagement.Facebook) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing Identity Provider %q (API Management Service %q / Resource Group %q): %s", apimanagement.Facebook, serviceName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing Identity Provider %q (API Management Service %q / Resource Group %q): %s", apimanagement.Facebook, serviceName, resourceGroup, err) } } @@ -77,8 +77,8 @@ func resourceArmApiManagementIdentityProviderFacebookCreateUpdate(d *schema.Reso } } - parameters := apimanagement.IdentityProviderContract{ - IdentityProviderContractProperties: &apimanagement.IdentityProviderContractProperties{ + parameters := apimanagement.IdentityProviderCreateContract{ + IdentityProviderCreateContractProperties: &apimanagement.IdentityProviderCreateContractProperties{ ClientID: utils.String(clientID), ClientSecret: utils.String(clientSecret), Type: apimanagement.Facebook, @@ -86,12 +86,12 @@ func resourceArmApiManagementIdentityProviderFacebookCreateUpdate(d *schema.Reso } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, apimanagement.Facebook, parameters, ""); err != nil { - return fmt.Errorf("Error creating or updating Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Facebook, resourceGroup, serviceName, err) + return fmt.Errorf("creating or updating Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Facebook, resourceGroup, serviceName, err) } resp, err := client.Get(ctx, resourceGroup, serviceName, apimanagement.Facebook) if err != nil { - return fmt.Errorf("Error retrieving Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Facebook, resourceGroup, serviceName, err) + return fmt.Errorf("retrieving Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Facebook, resourceGroup, serviceName, err) } if resp.ID == nil { return fmt.Errorf("Cannot read ID for Identity Provider %q (Resource Group %q / API Management Service %q)", apimanagement.Facebook, resourceGroup, serviceName) @@ -122,7 +122,7 @@ func resourceArmApiManagementIdentityProviderFacebookRead(d *schema.ResourceData return nil } - return fmt.Errorf("Error making Read request for Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) + return fmt.Errorf("making Read request for Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) } d.Set("resource_group_name", resourceGroup) @@ -151,7 +151,7 @@ func resourceArmApiManagementIdentityProviderFacebookDelete(d *schema.ResourceDa if resp, err := client.Delete(ctx, resourceGroup, serviceName, apimanagement.IdentityProviderType(identityProviderName), ""); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) + return fmt.Errorf("deleting Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_google.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_google.go index 1aa03781f31d..c74b44e3a99c 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_google.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_google.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -69,7 +69,7 @@ func resourceArmApiManagementIdentityProviderGoogleCreateUpdate(d *schema.Resour existing, err := client.Get(ctx, resourceGroup, serviceName, apimanagement.Google) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing Identity Provider %q (API Management Service %q / Resource Group %q): %s", apimanagement.Google, serviceName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing Identity Provider %q (API Management Service %q / Resource Group %q): %s", apimanagement.Google, serviceName, resourceGroup, err) } } @@ -78,8 +78,8 @@ func resourceArmApiManagementIdentityProviderGoogleCreateUpdate(d *schema.Resour } } - parameters := apimanagement.IdentityProviderContract{ - IdentityProviderContractProperties: &apimanagement.IdentityProviderContractProperties{ + parameters := apimanagement.IdentityProviderCreateContract{ + IdentityProviderCreateContractProperties: &apimanagement.IdentityProviderCreateContractProperties{ ClientID: utils.String(clientID), ClientSecret: utils.String(clientSecret), Type: apimanagement.Google, @@ -87,12 +87,12 @@ func resourceArmApiManagementIdentityProviderGoogleCreateUpdate(d *schema.Resour } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, apimanagement.Google, parameters, ""); err != nil { - return fmt.Errorf("Error creating or updating Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Google, resourceGroup, serviceName, err) + return fmt.Errorf("creating or updating Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Google, resourceGroup, serviceName, err) } resp, err := client.Get(ctx, resourceGroup, serviceName, apimanagement.Google) if err != nil { - return fmt.Errorf("Error retrieving Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Google, resourceGroup, serviceName, err) + return fmt.Errorf("retrieving Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Google, resourceGroup, serviceName, err) } if resp.ID == nil { return fmt.Errorf("Cannot read ID for Identity Provider %q (Resource Group %q / API Management Service %q)", apimanagement.Google, resourceGroup, serviceName) @@ -123,7 +123,7 @@ func resourceArmApiManagementIdentityProviderGoogleRead(d *schema.ResourceData, return nil } - return fmt.Errorf("Error making Read request for Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) + return fmt.Errorf("making Read request for Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) } d.Set("resource_group_name", resourceGroup) @@ -152,7 +152,7 @@ func resourceArmApiManagementIdentityProviderGoogleDelete(d *schema.ResourceData if resp, err := client.Delete(ctx, resourceGroup, serviceName, apimanagement.IdentityProviderType(identityProviderName), ""); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) + return fmt.Errorf("deleting Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_microsoft.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_microsoft.go index b8498d0d456e..9e2cdbe2388e 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_microsoft.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_microsoft.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -68,7 +68,7 @@ func resourceArmApiManagementIdentityProviderMicrosoftCreateUpdate(d *schema.Res existing, err := client.Get(ctx, resourceGroup, serviceName, apimanagement.Microsoft) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing Identity Provider %q (API Management Service %q / Resource Group %q): %s", apimanagement.Microsoft, serviceName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing Identity Provider %q (API Management Service %q / Resource Group %q): %s", apimanagement.Microsoft, serviceName, resourceGroup, err) } } @@ -77,8 +77,8 @@ func resourceArmApiManagementIdentityProviderMicrosoftCreateUpdate(d *schema.Res } } - parameters := apimanagement.IdentityProviderContract{ - IdentityProviderContractProperties: &apimanagement.IdentityProviderContractProperties{ + parameters := apimanagement.IdentityProviderCreateContract{ + IdentityProviderCreateContractProperties: &apimanagement.IdentityProviderCreateContractProperties{ ClientID: utils.String(clientID), ClientSecret: utils.String(clientSecret), Type: apimanagement.Microsoft, @@ -86,12 +86,12 @@ func resourceArmApiManagementIdentityProviderMicrosoftCreateUpdate(d *schema.Res } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, apimanagement.Microsoft, parameters, ""); err != nil { - return fmt.Errorf("Error creating or updating Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Microsoft, resourceGroup, serviceName, err) + return fmt.Errorf("creating or updating Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Microsoft, resourceGroup, serviceName, err) } resp, err := client.Get(ctx, resourceGroup, serviceName, apimanagement.Microsoft) if err != nil { - return fmt.Errorf("Error retrieving Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Microsoft, resourceGroup, serviceName, err) + return fmt.Errorf("retrieving Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Microsoft, resourceGroup, serviceName, err) } if resp.ID == nil { return fmt.Errorf("Cannot read ID for Identity Provider %q (Resource Group %q / API Management Service %q)", apimanagement.Microsoft, resourceGroup, serviceName) @@ -122,7 +122,7 @@ func resourceArmApiManagementIdentityProviderMicrosoftRead(d *schema.ResourceDat return nil } - return fmt.Errorf("Error making Read request for Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) + return fmt.Errorf("making Read request for Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) } d.Set("resource_group_name", resourceGroup) @@ -151,7 +151,7 @@ func resourceArmApiManagementIdentityProviderMicrosoftDelete(d *schema.ResourceD if resp, err := client.Delete(ctx, resourceGroup, serviceName, apimanagement.IdentityProviderType(identityProviderName), ""); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) + return fmt.Errorf("deleting Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_twitter.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_twitter.go index 290eb738076d..b217fe348ec1 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_twitter.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_twitter.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -68,7 +68,7 @@ func resourceArmApiManagementIdentityProviderTwitterCreateUpdate(d *schema.Resou existing, err := client.Get(ctx, resourceGroup, serviceName, apimanagement.Twitter) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing Identity Provider %q (API Management Service %q / Resource Group %q): %s", apimanagement.Twitter, serviceName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing Identity Provider %q (API Management Service %q / Resource Group %q): %s", apimanagement.Twitter, serviceName, resourceGroup, err) } } @@ -77,8 +77,8 @@ func resourceArmApiManagementIdentityProviderTwitterCreateUpdate(d *schema.Resou } } - parameters := apimanagement.IdentityProviderContract{ - IdentityProviderContractProperties: &apimanagement.IdentityProviderContractProperties{ + parameters := apimanagement.IdentityProviderCreateContract{ + IdentityProviderCreateContractProperties: &apimanagement.IdentityProviderCreateContractProperties{ ClientID: utils.String(clientID), ClientSecret: utils.String(clientSecret), Type: apimanagement.Twitter, @@ -86,12 +86,12 @@ func resourceArmApiManagementIdentityProviderTwitterCreateUpdate(d *schema.Resou } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, apimanagement.Twitter, parameters, ""); err != nil { - return fmt.Errorf("Error creating or updating Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Twitter, resourceGroup, serviceName, err) + return fmt.Errorf("creating or updating Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Twitter, resourceGroup, serviceName, err) } resp, err := client.Get(ctx, resourceGroup, serviceName, apimanagement.Twitter) if err != nil { - return fmt.Errorf("Error retrieving Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Twitter, resourceGroup, serviceName, err) + return fmt.Errorf("retrieving Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Twitter, resourceGroup, serviceName, err) } if resp.ID == nil { return fmt.Errorf("Cannot read ID for Identity Provider %q (Resource Group %q / API Management Service %q)", apimanagement.Twitter, resourceGroup, serviceName) @@ -122,7 +122,7 @@ func resourceArmApiManagementIdentityProviderTwitterRead(d *schema.ResourceData, return nil } - return fmt.Errorf("Error making Read request for Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) + return fmt.Errorf("making Read request for Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) } d.Set("resource_group_name", resourceGroup) @@ -151,7 +151,7 @@ func resourceArmApiManagementIdentityProviderTwitterDelete(d *schema.ResourceDat if resp, err := client.Delete(ctx, resourceGroup, serviceName, apimanagement.IdentityProviderType(identityProviderName), ""); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) + return fmt.Errorf("deleting Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_logger.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_logger.go index 963ac28bf39f..cf42f43b3a4f 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_logger.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_logger.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -117,7 +117,7 @@ func resourceArmApiManagementLoggerCreate(d *schema.ResourceData, meta interface existing, err := client.Get(ctx, resourceGroup, serviceName, name) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing Logger %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing Logger %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) } } @@ -142,12 +142,12 @@ func resourceArmApiManagementLoggerCreate(d *schema.ResourceData, meta interface } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, name, parameters, ""); err != nil { - return fmt.Errorf("Error creating Logger %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("creating Logger %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } resp, err := client.Get(ctx, resourceGroup, serviceName, name) if err != nil { - return fmt.Errorf("Error retrieving Logger %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("retrieving Logger %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } if resp.ID == nil { return fmt.Errorf("Cannot read Logger %q (Resource Group %q / API Management Service %q) ID", name, resourceGroup, serviceName) @@ -177,7 +177,7 @@ func resourceArmApiManagementLoggerRead(d *schema.ResourceData, meta interface{} d.SetId("") return nil } - return fmt.Errorf("Error reading Logger %q (API Management Service %q / Resource Group %q): %+v", name, serviceName, resourceGroup, err) + return fmt.Errorf("reading Logger %q (API Management Service %q / Resource Group %q): %+v", name, serviceName, resourceGroup, err) } d.Set("name", resp.Name) @@ -188,7 +188,7 @@ func resourceArmApiManagementLoggerRead(d *schema.ResourceData, meta interface{} d.Set("buffered", properties.IsBuffered) d.Set("description", properties.Description) if err := d.Set("eventhub", flattenArmApiManagementLoggerEventHub(d, properties)); err != nil { - return fmt.Errorf("Error setting `eventhub`: %s", err) + return fmt.Errorf("setting `eventhub`: %s", err) } } @@ -223,7 +223,7 @@ func resourceArmApiManagementLoggerUpdate(d *schema.ResourceData, meta interface } if _, err := client.Update(ctx, resourceGroup, serviceName, name, parameters, ""); err != nil { - return fmt.Errorf("Error updating Logger %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("updating Logger %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } return resourceArmApiManagementLoggerRead(d, meta) @@ -243,9 +243,9 @@ func resourceArmApiManagementLoggerDelete(d *schema.ResourceData, meta interface serviceName := id.Path["service"] name := id.Path["loggers"] - if resp, err := client.Delete(ctx, resourceGroup, serviceName, name, ""); err != nil { + if resp, err := client.Delete(ctx, resourceGroup, serviceName, name, "", utils.Bool(false)); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting Logger %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("deleting Logger %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_named_value.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_named_value.go new file mode 100644 index 000000000000..02e688127a21 --- /dev/null +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_named_value.go @@ -0,0 +1,180 @@ +package apimanagement + +import ( + "fmt" + "log" + "time" + + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" +) + +func resourceArmApiManagementNamedValue() *schema.Resource { + return &schema.Resource{ + Create: resourceArmApiManagementNamedValueCreateUpdate, + Read: resourceArmApiManagementNamedValueRead, + Update: resourceArmApiManagementNamedValueCreateUpdate, + Delete: resourceArmApiManagementNamedValueDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(30 * time.Minute), + Read: schema.DefaultTimeout(5 * time.Minute), + Update: schema.DefaultTimeout(30 * time.Minute), + Delete: schema.DefaultTimeout(30 * time.Minute), + }, + + Schema: map[string]*schema.Schema{ + "name": azure.SchemaApiManagementChildName(), + + "resource_group_name": azure.SchemaResourceGroupName(), + + "api_management_name": azure.SchemaApiManagementName(), + + "display_name": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + + "value": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + + "secret": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, + + "tags": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + } +} + +func resourceArmApiManagementNamedValueCreateUpdate(d *schema.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).ApiManagement.NamedValueClient + ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d) + defer cancel() + + name := d.Get("name").(string) + resourceGroup := d.Get("resource_group_name").(string) + serviceName := d.Get("api_management_name").(string) + + if features.ShouldResourcesBeImported() && d.IsNewResource() { + existing, err := client.Get(ctx, resourceGroup, serviceName, name) + if err != nil { + if !utils.ResponseWasNotFound(existing.Response) { + return fmt.Errorf(" checking for presence of existing Property %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) + } + } + + if existing.ID != nil && *existing.ID != "" { + return tf.ImportAsExistsError("azurerm_api_management_property", *existing.ID) + } + } + + parameters := apimanagement.NamedValueCreateContract{ + NamedValueCreateContractProperties: &apimanagement.NamedValueCreateContractProperties{ + DisplayName: utils.String(d.Get("display_name").(string)), + Secret: utils.Bool(d.Get("secret").(bool)), + Value: utils.String(d.Get("value").(string)), + }, + } + + if tags, ok := d.GetOk("tags"); ok { + parameters.NamedValueCreateContractProperties.Tags = utils.ExpandStringSlice(tags.([]interface{})) + } + + if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, name, parameters, ""); err != nil { + return fmt.Errorf(" creating or updating Property %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + } + + resp, err := client.Get(ctx, resourceGroup, serviceName, name) + if err != nil { + return fmt.Errorf(" retrieving Property %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + } + if resp.ID == nil { + return fmt.Errorf("Cannot read ID for Property %q (Resource Group %q / API Management Service %q)", name, resourceGroup, serviceName) + } + d.SetId(*resp.ID) + + return resourceArmApiManagementNamedValueRead(d, meta) +} + +func resourceArmApiManagementNamedValueRead(d *schema.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).ApiManagement.NamedValueClient + ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) + defer cancel() + + id, err := azure.ParseAzureResourceID(d.Id()) + if err != nil { + return err + } + resourceGroup := id.ResourceGroup + serviceName := id.Path["service"] + name := id.Path["namedValues"] + + resp, err := client.Get(ctx, resourceGroup, serviceName, name) + if err != nil { + if utils.ResponseWasNotFound(resp.Response) { + log.Printf("[DEBUG] Property %q (Resource Group %q / API Management Service %q) was not found - removing from state!", name, resourceGroup, serviceName) + d.SetId("") + return nil + } + + return fmt.Errorf(" making Read request for Property %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + } + + d.Set("name", resp.Name) + d.Set("resource_group_name", resourceGroup) + d.Set("api_management_name", serviceName) + + if properties := resp.NamedValueContractProperties; properties != nil { + d.Set("display_name", properties.DisplayName) + d.Set("secret", properties.Secret) + d.Set("value", properties.Value) + d.Set("tags", properties.Tags) + } + + return nil +} + +func resourceArmApiManagementNamedValueDelete(d *schema.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).ApiManagement.NamedValueClient + ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) + defer cancel() + + id, err := azure.ParseAzureResourceID(d.Id()) + if err != nil { + return err + } + resourceGroup := id.ResourceGroup + serviceName := id.Path["service"] + name := id.Path["namedValues"] + + if resp, err := client.Delete(ctx, resourceGroup, serviceName, name, ""); err != nil { + if !utils.ResponseWasNotFound(resp) { + return fmt.Errorf(" deleting Property %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + } + } + + return nil +} diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_openid_connect_provider.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_openid_connect_provider.go index 85c580762ae1..1c12798730f7 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_openid_connect_provider.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_openid_connect_provider.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -88,7 +88,7 @@ func resourceArmApiManagementOpenIDConnectProviderCreateUpdate(d *schema.Resourc existing, err := client.Get(ctx, resourceGroup, serviceName, name) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing OpenID Connect Provider %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing OpenID Connect Provider %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) } } @@ -108,12 +108,12 @@ func resourceArmApiManagementOpenIDConnectProviderCreateUpdate(d *schema.Resourc } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, name, parameters, ""); err != nil { - return fmt.Errorf("Error creating OpenID Connect Provider %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("creating OpenID Connect Provider %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } resp, err := client.Get(ctx, resourceGroup, serviceName, name) if err != nil { - return fmt.Errorf("Error retrieving OpenID Connect Provider %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("retrieving OpenID Connect Provider %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } if resp.ID == nil { return fmt.Errorf("Cannot read OpenID Connect Provider %q (Resource Group %q / API Management Service %q) ID", name, resourceGroup, serviceName) @@ -143,7 +143,7 @@ func resourceArmApiManagementOpenIDConnectProviderRead(d *schema.ResourceData, m d.SetId("") return nil } - return fmt.Errorf("Error reading OpenID Connect Provider %q (API Management Service %q / Resource Group %q): %+v", name, serviceName, resourceGroup, err) + return fmt.Errorf("reading OpenID Connect Provider %q (API Management Service %q / Resource Group %q): %+v", name, serviceName, resourceGroup, err) } d.Set("name", resp.Name) @@ -176,7 +176,7 @@ func resourceArmApiManagementOpenIDConnectProviderDelete(d *schema.ResourceData, if resp, err := client.Delete(ctx, resourceGroup, serviceName, name, ""); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting OpenID Connect Provider %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("deleting OpenID Connect Provider %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_product.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_product.go index 7ebae6bd2957..6785de665d18 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_product.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_product.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -102,7 +102,7 @@ func resourceArmApiManagementProductCreateUpdate(d *schema.ResourceData, meta in existing, err := client.Get(ctx, resourceGroup, serviceName, productId) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing Product %q (API Management Service %q / Resource Group %q): %s", productId, serviceName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing Product %q (API Management Service %q / Resource Group %q): %s", productId, serviceName, resourceGroup, err) } } @@ -135,12 +135,12 @@ func resourceArmApiManagementProductCreateUpdate(d *schema.ResourceData, meta in } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, productId, properties, ""); err != nil { - return fmt.Errorf("Error creating/updating Product %q (API Management Service %q / Resource Group %q): %+v", productId, serviceName, resourceGroup, err) + return fmt.Errorf("creating/updating Product %q (API Management Service %q / Resource Group %q): %+v", productId, serviceName, resourceGroup, err) } read, err := client.Get(ctx, resourceGroup, serviceName, productId) if err != nil { - return fmt.Errorf("Error retrieving Product %q (API Management Service %q / Resource Group %q): %+v", productId, serviceName, resourceGroup, err) + return fmt.Errorf("retrieving Product %q (API Management Service %q / Resource Group %q): %+v", productId, serviceName, resourceGroup, err) } if read.ID == nil { @@ -174,7 +174,7 @@ func resourceArmApiManagementProductRead(d *schema.ResourceData, meta interface{ return nil } - return fmt.Errorf("Error making Read request on Product %q (API Management Service %q / Resource Group %q): %+v", productId, serviceName, resourceGroup, err) + return fmt.Errorf("making Read request on Product %q (API Management Service %q / Resource Group %q): %+v", productId, serviceName, resourceGroup, err) } d.Set("product_id", productId) @@ -212,7 +212,7 @@ func resourceArmApiManagementProductDelete(d *schema.ResourceData, meta interfac resp, err := client.Delete(ctx, resourceGroup, serviceName, productId, "", utils.Bool(deleteSubscriptions)) if err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting Product %q (API Management Service %q / Resource Group %q): %+v", productId, serviceName, resourceGroup, err) + return fmt.Errorf("deleting Product %q (API Management Service %q / Resource Group %q): %+v", productId, serviceName, resourceGroup, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_product_api.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_product_api.go index 950fda861a2f..555f6f15c1f7 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_product_api.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_product_api.go @@ -56,7 +56,7 @@ func resourceArmApiManagementProductApiCreate(d *schema.ResourceData, meta inter resp, err := client.CheckEntityExists(ctx, resourceGroup, serviceName, productId, apiName) if err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error checking for present of existing API %q / Product %q (API Management Service %q / Resource Group %q): %+v", apiName, productId, serviceName, resourceGroup, err) + return fmt.Errorf("checking for present of existing API %q / Product %q (API Management Service %q / Resource Group %q): %+v", apiName, productId, serviceName, resourceGroup, err) } } @@ -69,7 +69,7 @@ func resourceArmApiManagementProductApiCreate(d *schema.ResourceData, meta inter resp, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, productId, apiName) if err != nil { - return fmt.Errorf("Error adding API %q to Product %q (API Management Service %q / Resource Group %q): %+v", apiName, productId, serviceName, resourceGroup, err) + return fmt.Errorf("adding API %q to Product %q (API Management Service %q / Resource Group %q): %+v", apiName, productId, serviceName, resourceGroup, err) } // there's no Read so this is best-effort @@ -100,7 +100,7 @@ func resourceArmApiManagementProductApiRead(d *schema.ResourceData, meta interfa return nil } - return fmt.Errorf("Error retrieving API %q / Product %q (API Management Service %q / Resource Group %q): %+v", apiName, productId, serviceName, resourceGroup, err) + return fmt.Errorf("retrieving API %q / Product %q (API Management Service %q / Resource Group %q): %+v", apiName, productId, serviceName, resourceGroup, err) } // This can be removed once updated to apimanagement API to 2019-01-01 @@ -135,7 +135,7 @@ func resourceArmApiManagementProductApiDelete(d *schema.ResourceData, meta inter if resp, err := client.Delete(ctx, resourceGroup, serviceName, productId, apiName); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error removing API %q from Product %q (API Management Service %q / Resource Group %q): %+v", apiName, productId, serviceName, resourceGroup, err) + return fmt.Errorf("removing API %q from Product %q (API Management Service %q / Resource Group %q): %+v", apiName, productId, serviceName, resourceGroup, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_product_group.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_product_group.go index d8ef73d3181f..b2de69044605 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_product_group.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_product_group.go @@ -56,7 +56,7 @@ func resourceArmApiManagementProductGroupCreate(d *schema.ResourceData, meta int resp, err := client.CheckEntityExists(ctx, resourceGroup, serviceName, productId, groupName) if err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error checking for present of existing Product %q / Group %q (API Management Service %q / Resource Group %q): %+v", productId, groupName, serviceName, resourceGroup, err) + return fmt.Errorf("checking for present of existing Product %q / Group %q (API Management Service %q / Resource Group %q): %+v", productId, groupName, serviceName, resourceGroup, err) } } @@ -69,7 +69,7 @@ func resourceArmApiManagementProductGroupCreate(d *schema.ResourceData, meta int resp, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, productId, groupName) if err != nil { - return fmt.Errorf("Error adding Product %q to Group %q (API Management Service %q / Resource Group %q): %+v", productId, groupName, serviceName, resourceGroup, err) + return fmt.Errorf("adding Product %q to Group %q (API Management Service %q / Resource Group %q): %+v", productId, groupName, serviceName, resourceGroup, err) } // there's no Read so this is best-effort @@ -100,7 +100,7 @@ func resourceArmApiManagementProductGroupRead(d *schema.ResourceData, meta inter return nil } - return fmt.Errorf("Error retrieving Product %q / Group %q (API Management Service %q / Resource Group %q): %+v", productId, groupName, serviceName, resourceGroup, err) + return fmt.Errorf("retrieving Product %q / Group %q (API Management Service %q / Resource Group %q): %+v", productId, groupName, serviceName, resourceGroup, err) } d.Set("group_name", groupName) @@ -127,7 +127,7 @@ func resourceArmApiManagementProductGroupDelete(d *schema.ResourceData, meta int if resp, err := client.Delete(ctx, resourceGroup, serviceName, productId, groupName); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error removing Product %q from Group %q (API Management Service %q / Resource Group %q): %+v", productId, groupName, serviceName, resourceGroup, err) + return fmt.Errorf("removing Product %q from Group %q (API Management Service %q / Resource Group %q): %+v", productId, groupName, serviceName, resourceGroup, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_product_policy.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_product_policy.go index 1987b3c401a0..8ecab822a7c4 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_product_policy.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_product_policy.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/suppress" @@ -67,10 +67,10 @@ func resourceArmApiManagementProductPolicyCreateUpdate(d *schema.ResourceData, m productID := d.Get("product_id").(string) if features.ShouldResourcesBeImported() && d.IsNewResource() { - existing, err := client.Get(ctx, resourceGroup, serviceName, productID) + existing, err := client.Get(ctx, resourceGroup, serviceName, productID, apimanagement.PolicyExportFormatXML) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing Product Policy (API Management Service %q / Product %q / Resource Group %q): %s", serviceName, productID, resourceGroup, err) + return fmt.Errorf("checking for presence of existing Product Policy (API Management Service %q / Product %q / Resource Group %q): %s", serviceName, productID, resourceGroup, err) } } @@ -86,15 +86,15 @@ func resourceArmApiManagementProductPolicyCreateUpdate(d *schema.ResourceData, m if xmlContent != "" { parameters.PolicyContractProperties = &apimanagement.PolicyContractProperties{ - ContentFormat: apimanagement.XML, - PolicyContent: utils.String(xmlContent), + Format: apimanagement.XML, + Value: utils.String(xmlContent), } } if xmlLink != "" { parameters.PolicyContractProperties = &apimanagement.PolicyContractProperties{ - ContentFormat: apimanagement.XMLLink, - PolicyContent: utils.String(xmlLink), + Format: apimanagement.XMLLink, + Value: utils.String(xmlLink), } } @@ -103,12 +103,12 @@ func resourceArmApiManagementProductPolicyCreateUpdate(d *schema.ResourceData, m } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, productID, parameters, ""); err != nil { - return fmt.Errorf("Error creating or updating Product Policy (Resource Group %q / API Management Service %q / Product %q): %+v", resourceGroup, serviceName, productID, err) + return fmt.Errorf("creating or updating Product Policy (Resource Group %q / API Management Service %q / Product %q): %+v", resourceGroup, serviceName, productID, err) } - resp, err := client.Get(ctx, resourceGroup, serviceName, productID) + resp, err := client.Get(ctx, resourceGroup, serviceName, productID, apimanagement.PolicyExportFormatXML) if err != nil { - return fmt.Errorf("Error retrieving Product Policy (Resource Group %q / API Management Service %q / Product %q): %+v", resourceGroup, serviceName, productID, err) + return fmt.Errorf("retrieving Product Policy (Resource Group %q / API Management Service %q / Product %q): %+v", resourceGroup, serviceName, productID, err) } if resp.ID == nil { return fmt.Errorf("Cannot read ID for Product Policy (Resource Group %q / API Management Service %q / Product %q): %+v", resourceGroup, serviceName, productID, err) @@ -131,7 +131,7 @@ func resourceArmApiManagementProductPolicyRead(d *schema.ResourceData, meta inte serviceName := id.Path["service"] productID := id.Path["products"] - resp, err := client.Get(ctx, resourceGroup, serviceName, productID) + resp, err := client.Get(ctx, resourceGroup, serviceName, productID, apimanagement.PolicyExportFormatXML) if err != nil { if utils.ResponseWasNotFound(resp.Response) { log.Printf("[DEBUG] Product Policy (Resource Group %q / API Management Service %q / Product %q) was not found - removing from state!", resourceGroup, serviceName, productID) @@ -139,7 +139,7 @@ func resourceArmApiManagementProductPolicyRead(d *schema.ResourceData, meta inte return nil } - return fmt.Errorf("Error making Read request for Product Policy (Resource Group %q / API Management Service %q / Product %q): %+v", resourceGroup, serviceName, productID, err) + return fmt.Errorf("making Read request for Product Policy (Resource Group %q / API Management Service %q / Product %q): %+v", resourceGroup, serviceName, productID, err) } d.Set("resource_group_name", resourceGroup) @@ -149,7 +149,7 @@ func resourceArmApiManagementProductPolicyRead(d *schema.ResourceData, meta inte if properties := resp.PolicyContractProperties; properties != nil { // when you submit an `xml_link` to the API, the API downloads this link and stores it as `xml_content` // as such there is no way to set `xml_link` and we'll let Terraform handle it - d.Set("xml_content", properties.PolicyContent) + d.Set("xml_content", properties.Value) } return nil @@ -170,7 +170,7 @@ func resourceArmApiManagementProductPolicyDelete(d *schema.ResourceData, meta in if resp, err := client.Delete(ctx, resourceGroup, serviceName, productID, ""); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting Product Policy (Resource Group %q / API Management Service %q / Product %q): %+v", resourceGroup, serviceName, productID, err) + return fmt.Errorf("deleting Product Policy (Resource Group %q / API Management Service %q / Product %q): %+v", resourceGroup, serviceName, productID, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_property.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_property.go index 318355fb6555..8c3188d11e81 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_property.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_property.go @@ -5,13 +5,14 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement/migration" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -22,6 +23,9 @@ func resourceArmApiManagementProperty() *schema.Resource { Read: resourceArmApiManagementPropertyRead, Update: resourceArmApiManagementPropertyCreateUpdate, Delete: resourceArmApiManagementPropertyDelete, + + DeprecationMessage: "This resource has been superseded by `azurerm_api_management_named_value` to reflects changes in the API/SDK and will be removed in version 3.0 of the provider.", + Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, @@ -33,6 +37,15 @@ func resourceArmApiManagementProperty() *schema.Resource { Delete: schema.DefaultTimeout(30 * time.Minute), }, + SchemaVersion: 1, + StateUpgraders: []schema.StateUpgrader{ + { + Type: migration.APIManagementApiPropertyUpgradeV0Schema().CoreConfigSchema().ImpliedType(), + Upgrade: migration.APIManagementApiPropertyUpgradeV0ToV1, + Version: 0, + }, + }, + Schema: map[string]*schema.Schema{ "name": azure.SchemaApiManagementChildName(), @@ -70,7 +83,7 @@ func resourceArmApiManagementProperty() *schema.Resource { } func resourceArmApiManagementPropertyCreateUpdate(d *schema.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).ApiManagement.PropertyClient + client := meta.(*clients.Client).ApiManagement.NamedValueClient ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d) defer cancel() @@ -82,7 +95,7 @@ func resourceArmApiManagementPropertyCreateUpdate(d *schema.ResourceData, meta i existing, err := client.Get(ctx, resourceGroup, serviceName, name) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing Property %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing Property %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) } } @@ -91,8 +104,8 @@ func resourceArmApiManagementPropertyCreateUpdate(d *schema.ResourceData, meta i } } - parameters := apimanagement.PropertyContract{ - PropertyContractProperties: &apimanagement.PropertyContractProperties{ + parameters := apimanagement.NamedValueCreateContract{ + NamedValueCreateContractProperties: &apimanagement.NamedValueCreateContractProperties{ DisplayName: utils.String(d.Get("display_name").(string)), Secret: utils.Bool(d.Get("secret").(bool)), Value: utils.String(d.Get("value").(string)), @@ -100,16 +113,16 @@ func resourceArmApiManagementPropertyCreateUpdate(d *schema.ResourceData, meta i } if tags, ok := d.GetOk("tags"); ok { - parameters.PropertyContractProperties.Tags = utils.ExpandStringSlice(tags.([]interface{})) + parameters.NamedValueCreateContractProperties.Tags = utils.ExpandStringSlice(tags.([]interface{})) } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, name, parameters, ""); err != nil { - return fmt.Errorf("Error creating or updating Property %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("creating or updating Property %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } resp, err := client.Get(ctx, resourceGroup, serviceName, name) if err != nil { - return fmt.Errorf("Error retrieving Property %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("retrieving Property %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } if resp.ID == nil { return fmt.Errorf("Cannot read ID for Property %q (Resource Group %q / API Management Service %q)", name, resourceGroup, serviceName) @@ -120,7 +133,7 @@ func resourceArmApiManagementPropertyCreateUpdate(d *schema.ResourceData, meta i } func resourceArmApiManagementPropertyRead(d *schema.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).ApiManagement.PropertyClient + client := meta.(*clients.Client).ApiManagement.NamedValueClient ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() @@ -130,7 +143,7 @@ func resourceArmApiManagementPropertyRead(d *schema.ResourceData, meta interface } resourceGroup := id.ResourceGroup serviceName := id.Path["service"] - name := id.Path["properties"] + name := id.Path["namedValues"] resp, err := client.Get(ctx, resourceGroup, serviceName, name) if err != nil { @@ -140,14 +153,14 @@ func resourceArmApiManagementPropertyRead(d *schema.ResourceData, meta interface return nil } - return fmt.Errorf("Error making Read request for Property %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("making Read request for Property %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } d.Set("name", resp.Name) d.Set("resource_group_name", resourceGroup) d.Set("api_management_name", serviceName) - if properties := resp.PropertyContractProperties; properties != nil { + if properties := resp.NamedValueContractProperties; properties != nil { d.Set("display_name", properties.DisplayName) d.Set("secret", properties.Secret) d.Set("value", properties.Value) @@ -158,7 +171,7 @@ func resourceArmApiManagementPropertyRead(d *schema.ResourceData, meta interface } func resourceArmApiManagementPropertyDelete(d *schema.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).ApiManagement.PropertyClient + client := meta.(*clients.Client).ApiManagement.NamedValueClient ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() @@ -168,11 +181,11 @@ func resourceArmApiManagementPropertyDelete(d *schema.ResourceData, meta interfa } resourceGroup := id.ResourceGroup serviceName := id.Path["service"] - name := id.Path["properties"] + name := id.Path["namedValues"] if resp, err := client.Delete(ctx, resourceGroup, serviceName, name, ""); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting Property %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("deleting Property %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_subscription.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_subscription.go index d1bf7c511f87..d049752217e3 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_subscription.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_subscription.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/satori/uuid" @@ -43,10 +43,9 @@ func resourceArmApiManagementSubscription() *schema.Resource { ValidateFunc: validation.Any(validation.IsUUID, validation.StringIsEmpty), }, + // 3.0 this seems to have been renamed to owner id? "user_id": azure.SchemaApiManagementChildID(), - "product_id": azure.SchemaApiManagementChildID(), - "resource_group_name": azure.SchemaResourceGroupName(), "api_management_name": azure.SchemaApiManagementName(), @@ -57,6 +56,14 @@ func resourceArmApiManagementSubscription() *schema.Resource { ValidateFunc: validation.StringIsNotEmpty, }, + // TODO this now sets the scope property - either a scope block needs adding or additional properties `api_id` and maybe `all_apis` + "product_id": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + ValidateFunc: azure.ValidateResourceID, + }, + "state": { Type: schema.TypeString, Optional: true, @@ -104,7 +111,7 @@ func resourceArmApiManagementSubscriptionCreateUpdate(d *schema.ResourceData, me resp, err := client.Get(ctx, resourceGroup, serviceName, subscriptionId) if err != nil { if !utils.ResponseWasNotFound(resp.Response) { - return fmt.Errorf("Error checking for present of existing Subscription %q (API Management Service %q / Resource Group %q): %+v", subscriptionId, serviceName, resourceGroup, err) + return fmt.Errorf("checking for present of existing Subscription %q (API Management Service %q / Resource Group %q): %+v", subscriptionId, serviceName, resourceGroup, err) } } @@ -121,9 +128,9 @@ func resourceArmApiManagementSubscriptionCreateUpdate(d *schema.ResourceData, me params := apimanagement.SubscriptionCreateParameters{ SubscriptionCreateParameterProperties: &apimanagement.SubscriptionCreateParameterProperties{ DisplayName: utils.String(displayName), - ProductID: utils.String(productId), + Scope: utils.String(productId), State: apimanagement.SubscriptionState(state), - UserID: utils.String(userId), + OwnerID: utils.String(userId), }, } @@ -138,12 +145,12 @@ func resourceArmApiManagementSubscriptionCreateUpdate(d *schema.ResourceData, me sendEmail := utils.Bool(false) _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, subscriptionId, params, sendEmail, "") if err != nil { - return fmt.Errorf("Error creating/updating Subscription %q (API Management Service %q / Resource Group %q): %+v", subscriptionId, serviceName, resourceGroup, err) + return fmt.Errorf("creating/updating Subscription %q (API Management Service %q / Resource Group %q): %+v", subscriptionId, serviceName, resourceGroup, err) } resp, err := client.Get(ctx, resourceGroup, serviceName, subscriptionId) if err != nil { - return fmt.Errorf("Error retrieving Subscription %q (API Management Service %q / Resource Group %q): %+v", subscriptionId, serviceName, resourceGroup, err) + return fmt.Errorf("retrieving Subscription %q (API Management Service %q / Resource Group %q): %+v", subscriptionId, serviceName, resourceGroup, err) } d.SetId(*resp.ID) @@ -172,7 +179,7 @@ func resourceArmApiManagementSubscriptionRead(d *schema.ResourceData, meta inter return nil } - return fmt.Errorf("Error retrieving Subscription %q (API Management Service %q / Resource Group %q): %+v", subscriptionId, serviceName, resourceGroup, err) + return fmt.Errorf("retrieving Subscription %q (API Management Service %q / Resource Group %q): %+v", subscriptionId, serviceName, resourceGroup, err) } d.Set("subscription_id", subscriptionId) @@ -184,8 +191,8 @@ func resourceArmApiManagementSubscriptionRead(d *schema.ResourceData, meta inter d.Set("primary_key", props.PrimaryKey) d.Set("secondary_key", props.SecondaryKey) d.Set("state", string(props.State)) - d.Set("product_id", props.ProductID) - d.Set("user_id", props.UserID) + d.Set("product_id", props.Scope) + d.Set("user_id", props.OwnerID) } return nil @@ -206,7 +213,7 @@ func resourceArmApiManagementSubscriptionDelete(d *schema.ResourceData, meta int if resp, err := client.Delete(ctx, resourceGroup, serviceName, subscriptionId, ""); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error removing Subscription %q (API Management Service %q / Resource Group %q): %+v", subscriptionId, serviceName, resourceGroup, err) + return fmt.Errorf("removing Subscription %q (API Management Service %q / Resource Group %q): %+v", subscriptionId, serviceName, resourceGroup, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_user.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_user.go index 65e05a630d07..91d8b104ac90 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_user.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_user.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -115,7 +115,7 @@ func resourceArmApiManagementUserCreateUpdate(d *schema.ResourceData, meta inter existing, err := client.Get(ctx, resourceGroup, serviceName, userId) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing User %q (API Management Service %q / Resource Group %q): %s", userId, serviceName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing User %q (API Management Service %q / Resource Group %q): %s", userId, serviceName, resourceGroup, err) } } @@ -147,12 +147,12 @@ func resourceArmApiManagementUserCreateUpdate(d *schema.ResourceData, meta inter } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, userId, properties, ""); err != nil { - return fmt.Errorf("Error creating/updating User %q (API Management Service %q / Resource Group %q): %+v", userId, serviceName, resourceGroup, err) + return fmt.Errorf("creating/updating User %q (API Management Service %q / Resource Group %q): %+v", userId, serviceName, resourceGroup, err) } read, err := client.Get(ctx, resourceGroup, serviceName, userId) if err != nil { - return fmt.Errorf("Error retrieving User %q (API Management Service %q / Resource Group %q): %+v", userId, serviceName, resourceGroup, err) + return fmt.Errorf("retrieving User %q (API Management Service %q / Resource Group %q): %+v", userId, serviceName, resourceGroup, err) } if read.ID == nil { @@ -186,7 +186,7 @@ func resourceArmApiManagementUserRead(d *schema.ResourceData, meta interface{}) return nil } - return fmt.Errorf("Error making Read request on User %q (API Management Service %q / Resource Group %q): %+v", userId, serviceName, resourceGroup, err) + return fmt.Errorf("making Read request on User %q (API Management Service %q / Resource Group %q): %+v", userId, serviceName, resourceGroup, err) } d.Set("user_id", userId) @@ -223,7 +223,7 @@ func resourceArmApiManagementUserDelete(d *schema.ResourceData, meta interface{} resp, err := client.Delete(ctx, resourceGroup, serviceName, userId, "", deleteSubscriptions, notify) if err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting User %q (API Management Service %q / Resource Group %q): %+v", userId, serviceName, resourceGroup, err) + return fmt.Errorf("deleting User %q (API Management Service %q / Resource Group %q): %+v", userId, serviceName, resourceGroup, err) } } diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_operation_policy_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_operation_policy_test.go index 699c970db8d9..bd7e74cc2521 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_operation_policy_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_operation_policy_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" @@ -100,7 +101,7 @@ func testCheckAzureRMApiManagementAPIOperationPolicyExists(resourceName string) resourceGroup := rs.Primary.Attributes["resource_group_name"] operationID := rs.Primary.Attributes["operation_id"] - resp, err := conn.Get(ctx, resourceGroup, serviceName, apiName, operationID) + resp, err := conn.Get(ctx, resourceGroup, serviceName, apiName, operationID, apimanagement.PolicyExportFormatXML) if err != nil { if utils.ResponseWasNotFound(resp.Response) { return fmt.Errorf("Bad: API Policy (API Management Service %q / API %q / Operation %q / Resource Group %q) does not exist", serviceName, apiName, operationID, resourceGroup) @@ -127,7 +128,7 @@ func testCheckAzureRMApiManagementAPIOperationPolicyDestroy(s *terraform.State) resourceGroup := rs.Primary.Attributes["resource_group_name"] operationID := rs.Primary.Attributes["operation_id"] - resp, err := conn.Get(ctx, resourceGroup, serviceName, apiName, operationID) + resp, err := conn.Get(ctx, resourceGroup, serviceName, apiName, operationID, apimanagement.PolicyExportFormatXML) if err != nil { if utils.ResponseWasNotFound(resp.Response) { return nil diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_policy_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_policy_test.go index 75f710ad2eec..5339dd1e27d1 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_policy_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_policy_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" @@ -123,7 +124,7 @@ func testCheckAzureRMApiManagementAPIPolicyExists(resourceName string) resource. serviceName := rs.Primary.Attributes["api_management_name"] resourceGroup := rs.Primary.Attributes["resource_group_name"] - resp, err := conn.Get(ctx, resourceGroup, serviceName, apiName) + resp, err := conn.Get(ctx, resourceGroup, serviceName, apiName, apimanagement.PolicyExportFormatXML) if err != nil { if utils.ResponseWasNotFound(resp.Response) { return fmt.Errorf("Bad: API Policy (API Management Service %q / API %q/ Resource Group %q) does not exist", serviceName, apiName, resourceGroup) @@ -149,7 +150,7 @@ func testCheckAzureRMApiManagementAPIPolicyDestroy(s *terraform.State) error { serviceName := rs.Primary.Attributes["api_management_name"] resourceGroup := rs.Primary.Attributes["resource_group_name"] - resp, err := conn.Get(ctx, resourceGroup, serviceName, apiName) + resp, err := conn.Get(ctx, resourceGroup, serviceName, apiName, apimanagement.PolicyExportFormatXML) if err != nil { if utils.ResponseWasNotFound(resp.Response) { return nil diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_authorization_server_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_authorization_server_test.go index ae0fe570fa18..4010e6e17181 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_authorization_server_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_authorization_server_test.go @@ -63,7 +63,7 @@ func TestAccAzureRMAPIManagementAuthorizationServer_complete(t *testing.T) { testCheckAzureRMAPIManagementAuthorizationServerExists(data.ResourceName), ), }, - data.ImportStep(), + data.ImportStep("client_secret"), }, }) } diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_aad_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_aad_test.go index d9ece846b691..3a889bb8c096 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_aad_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_aad_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_facebook_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_facebook_test.go index 413ff7477d0b..d71c28242937 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_facebook_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_facebook_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_google_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_google_test.go index e752072baa92..6b9b237d0cd8 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_google_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_google_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_microsoft_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_microsoft_test.go index 273362ae8bee..975821e5a9f2 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_microsoft_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_microsoft_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_twitter_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_twitter_test.go index e85177501bfe..5ea1504ee45e 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_twitter_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_twitter_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_named_value_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_named_value_test.go new file mode 100644 index 000000000000..ba1fb9b37d5b --- /dev/null +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_named_value_test.go @@ -0,0 +1,190 @@ +package tests + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" +) + +func TestAccAzureRMAPIManagementNamedValue_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_api_management_named_value", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMAPIManagementNamedValueDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMAPIManagementNamedValue_basic(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMAPIManagementNamedValueExists(data.ResourceName), + resource.TestCheckResourceAttr(data.ResourceName, "display_name", fmt.Sprintf("TestProperty%d", data.RandomInteger)), + resource.TestCheckResourceAttr(data.ResourceName, "value", "Test Value"), + resource.TestCheckResourceAttr(data.ResourceName, "tags.0", "tag1"), + resource.TestCheckResourceAttr(data.ResourceName, "tags.1", "tag2"), + ), + }, + data.ImportStep(), + }, + }) +} + +func TestAccAzureRMAPIManagementNamedValue_update(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_api_management_named_value", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMAPIManagementNamedValueDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMAPIManagementNamedValue_basic(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMAPIManagementNamedValueExists(data.ResourceName), + resource.TestCheckResourceAttr(data.ResourceName, "display_name", fmt.Sprintf("TestProperty%d", data.RandomInteger)), + resource.TestCheckResourceAttr(data.ResourceName, "value", "Test Value"), + resource.TestCheckResourceAttr(data.ResourceName, "tags.0", "tag1"), + resource.TestCheckResourceAttr(data.ResourceName, "tags.1", "tag2"), + ), + }, + { + Config: testAccAzureRMAPIManagementNamedValue_update(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMAPIManagementNamedValueExists(data.ResourceName), + resource.TestCheckResourceAttr(data.ResourceName, "display_name", fmt.Sprintf("TestProperty2%d", data.RandomInteger)), + resource.TestCheckResourceAttr(data.ResourceName, "value", "Test Value2"), + resource.TestCheckResourceAttr(data.ResourceName, "secret", "true"), + resource.TestCheckResourceAttr(data.ResourceName, "tags.0", "tag3"), + resource.TestCheckResourceAttr(data.ResourceName, "tags.1", "tag4"), + ), + }, + data.ImportStep(), + }, + }) +} + +func testCheckAzureRMAPIManagementNamedValueDestroy(s *terraform.State) error { + client := acceptance.AzureProvider.Meta().(*clients.Client).ApiManagement.NamedValueClient + ctx := acceptance.AzureProvider.Meta().(*clients.Client).StopContext + + for _, rs := range s.RootModule().Resources { + if rs.Type != "azurerm_api_management_named_value" { + continue + } + + name := rs.Primary.Attributes["name"] + resourceGroup := rs.Primary.Attributes["resource_group_name"] + serviceName := rs.Primary.Attributes["api_management_name"] + + resp, err := client.Get(ctx, resourceGroup, serviceName, name) + + if err != nil { + if !utils.ResponseWasNotFound(resp.Response) { + return err + } + } + + return nil + } + return nil +} + +func testCheckAzureRMAPIManagementNamedValueExists(resourceName string) resource.TestCheckFunc { + return func(s *terraform.State) error { + client := acceptance.AzureProvider.Meta().(*clients.Client).ApiManagement.NamedValueClient + ctx := acceptance.AzureProvider.Meta().(*clients.Client).StopContext + + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return fmt.Errorf("Not found: %s", resourceName) + } + + name := rs.Primary.Attributes["name"] + resourceGroup := rs.Primary.Attributes["resource_group_name"] + serviceName := rs.Primary.Attributes["api_management_name"] + + resp, err := client.Get(ctx, resourceGroup, serviceName, name) + if err != nil { + if utils.ResponseWasNotFound(resp.Response) { + return fmt.Errorf("Bad: API Management Property %q (Resource Group %q / API Management Service %q) does not exist", name, resourceGroup, serviceName) + } + return fmt.Errorf("Bad: Get on apiManagement.NamedValueClient: %+v", err) + } + + return nil + } +} + +/* + + */ + +func testAccAzureRMAPIManagementNamedValue_basic(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "%s" +} + +resource "azurerm_api_management" "test" { + name = "acctestAM-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + publisher_name = "pub1" + publisher_email = "pub1@email.com" + + sku_name = "Developer_1" +} + +resource "azurerm_api_management_named_value" "test" { + name = "acctestAMProperty-%d" + resource_group_name = azurerm_api_management.test.resource_group_name + api_management_name = azurerm_api_management.test.name + display_name = "TestProperty%d" + value = "Test Value" + tags = ["tag1", "tag2"] +} +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, data.RandomInteger) +} + +func testAccAzureRMAPIManagementNamedValue_update(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "%s" +} + +resource "azurerm_api_management" "test" { + name = "acctestAM-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + publisher_name = "pub1" + publisher_email = "pub1@email.com" + + sku_name = "Developer_1" +} + +resource "azurerm_api_management_named_value" "test" { + name = "acctestAMProperty-%d" + resource_group_name = azurerm_api_management.test.resource_group_name + api_management_name = azurerm_api_management.test.name + display_name = "TestProperty2%d" + value = "Test Value2" + secret = true + tags = ["tag3", "tag4"] +} +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, data.RandomInteger) +} diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_product_policy_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_product_policy_test.go index 79bcf035726c..6249e8121d1b 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_product_policy_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_product_policy_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" @@ -99,7 +100,7 @@ func testCheckAzureRMApiManagementProductPolicyExists(resourceName string) resou serviceName := rs.Primary.Attributes["api_management_name"] resourceGroup := rs.Primary.Attributes["resource_group_name"] - resp, err := conn.Get(ctx, resourceGroup, serviceName, productID) + resp, err := conn.Get(ctx, resourceGroup, serviceName, productID, apimanagement.PolicyExportFormatXML) if err != nil { if utils.ResponseWasNotFound(resp.Response) { return fmt.Errorf("Bad: Product Policy (API Management Service %q / Product %q/ Resource Group %q) does not exist", serviceName, productID, resourceGroup) @@ -124,7 +125,7 @@ func testCheckAzureRMApiManagementProductPolicyDestroy(s *terraform.State) error productID := rs.Primary.Attributes["product_id"] serviceName := rs.Primary.Attributes["api_management_name"] resourceGroup := rs.Primary.Attributes["resource_group_name"] - resp, err := conn.Get(ctx, resourceGroup, serviceName, productID) + resp, err := conn.Get(ctx, resourceGroup, serviceName, productID, apimanagement.PolicyExportFormatXML) if err != nil { if utils.ResponseWasNotFound(resp.Response) { return nil diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_property_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_property_test.go index a2cb8630738b..a183a37d6c30 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_property_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_property_test.go @@ -52,6 +52,7 @@ func TestAccAzureRMAPIManagementProperty_update(t *testing.T) { resource.TestCheckResourceAttr(data.ResourceName, "tags.1", "tag2"), ), }, + data.ImportStep(), { Config: testAccAzureRMAPIManagementProperty_update(data), Check: resource.ComposeTestCheckFunc( @@ -69,7 +70,7 @@ func TestAccAzureRMAPIManagementProperty_update(t *testing.T) { } func testCheckAzureRMAPIManagementPropertyDestroy(s *terraform.State) error { - client := acceptance.AzureProvider.Meta().(*clients.Client).ApiManagement.PropertyClient + client := acceptance.AzureProvider.Meta().(*clients.Client).ApiManagement.NamedValueClient ctx := acceptance.AzureProvider.Meta().(*clients.Client).StopContext for _, rs := range s.RootModule().Resources { @@ -96,7 +97,7 @@ func testCheckAzureRMAPIManagementPropertyDestroy(s *terraform.State) error { func testCheckAzureRMAPIManagementPropertyExists(resourceName string) resource.TestCheckFunc { return func(s *terraform.State) error { - client := acceptance.AzureProvider.Meta().(*clients.Client).ApiManagement.PropertyClient + client := acceptance.AzureProvider.Meta().(*clients.Client).ApiManagement.NamedValueClient ctx := acceptance.AzureProvider.Meta().(*clients.Client).StopContext rs, ok := s.RootModule().Resources[resourceName] @@ -113,7 +114,7 @@ func testCheckAzureRMAPIManagementPropertyExists(resourceName string) resource.T if utils.ResponseWasNotFound(resp.Response) { return fmt.Errorf("Bad: API Management Property %q (Resource Group %q / API Management Service %q) does not exist", name, resourceGroup, serviceName) } - return fmt.Errorf("Bad: Get on apiManagement.PropertyClient: %+v", err) + return fmt.Errorf("Bad: Get on apiManagement.NamedValueClient: %+v", err) } return nil diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_subscription_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_subscription_test.go index a709f9c18c56..b9b029821e3e 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_subscription_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_subscription_test.go @@ -24,8 +24,6 @@ func TestAccAzureRMAPIManagementSubscription_basic(t *testing.T) { Check: resource.ComposeTestCheckFunc( testCheckAzureRMAPIManagementSubscriptionExists(data.ResourceName), resource.TestCheckResourceAttrSet(data.ResourceName, "subscription_id"), - resource.TestCheckResourceAttrSet(data.ResourceName, "primary_key"), - resource.TestCheckResourceAttrSet(data.ResourceName, "secondary_key"), ), }, data.ImportStep(), @@ -46,8 +44,6 @@ func TestAccAzureRMAPIManagementSubscription_requiresImport(t *testing.T) { Check: resource.ComposeTestCheckFunc( testCheckAzureRMAPIManagementSubscriptionExists(data.ResourceName), resource.TestCheckResourceAttrSet(data.ResourceName, "subscription_id"), - resource.TestCheckResourceAttrSet(data.ResourceName, "primary_key"), - resource.TestCheckResourceAttrSet(data.ResourceName, "secondary_key"), ), }, data.RequiresImportErrorStep(testAccAzureRMAPIManagementSubscription_requiresImport), @@ -69,8 +65,6 @@ func TestAccAzureRMAPIManagementSubscription_update(t *testing.T) { testCheckAzureRMAPIManagementSubscriptionExists(data.ResourceName), resource.TestCheckResourceAttr(data.ResourceName, "state", "submitted"), resource.TestCheckResourceAttrSet(data.ResourceName, "subscription_id"), - resource.TestCheckResourceAttrSet(data.ResourceName, "primary_key"), - resource.TestCheckResourceAttrSet(data.ResourceName, "secondary_key"), ), }, { @@ -112,8 +106,6 @@ func TestAccAzureRMAPIManagementSubscription_complete(t *testing.T) { testCheckAzureRMAPIManagementSubscriptionExists(data.ResourceName), resource.TestCheckResourceAttr(data.ResourceName, "state", "active"), resource.TestCheckResourceAttrSet(data.ResourceName, "subscription_id"), - resource.TestCheckResourceAttrSet(data.ResourceName, "primary_key"), - resource.TestCheckResourceAttrSet(data.ResourceName, "secondary_key"), ), }, data.ImportStep(), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apidiagnosticlogger.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apidiagnosticlogger.go deleted file mode 100644 index 84f0176ba957..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apidiagnosticlogger.go +++ /dev/null @@ -1,500 +0,0 @@ -package apimanagement - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// APIDiagnosticLoggerClient is the apiManagement Client -type APIDiagnosticLoggerClient struct { - BaseClient -} - -// NewAPIDiagnosticLoggerClient creates an instance of the APIDiagnosticLoggerClient client. -func NewAPIDiagnosticLoggerClient(subscriptionID string) APIDiagnosticLoggerClient { - return NewAPIDiagnosticLoggerClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewAPIDiagnosticLoggerClientWithBaseURI creates an instance of the APIDiagnosticLoggerClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewAPIDiagnosticLoggerClientWithBaseURI(baseURI string, subscriptionID string) APIDiagnosticLoggerClient { - return APIDiagnosticLoggerClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CheckEntityExists checks that logger entity specified by identifier is associated with the diagnostics entity. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceName - the name of the API Management service. -// apiid - API identifier. Must be unique in the current API Management service instance. -// diagnosticID - diagnostic identifier. Must be unique in the current API Management service instance. -// loggerid - logger identifier. Must be unique in the API Management service instance. -func (client APIDiagnosticLoggerClient) CheckEntityExists(ctx context.Context, resourceGroupName string, serviceName string, apiid string, diagnosticID string, loggerid string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/APIDiagnosticLoggerClient.CheckEntityExists") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: serviceName, - Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, - {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: apiid, - Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, - {TargetValue: diagnosticID, - Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, - {TargetValue: loggerid, - Constraints: []validation.Constraint{{Target: "loggerid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "loggerid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { - return result, validation.NewError("apimanagement.APIDiagnosticLoggerClient", "CheckEntityExists", err.Error()) - } - - req, err := client.CheckEntityExistsPreparer(ctx, resourceGroupName, serviceName, apiid, diagnosticID, loggerid) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticLoggerClient", "CheckEntityExists", nil, "Failure preparing request") - return - } - - resp, err := client.CheckEntityExistsSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticLoggerClient", "CheckEntityExists", resp, "Failure sending request") - return - } - - result, err = client.CheckEntityExistsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticLoggerClient", "CheckEntityExists", resp, "Failure responding to request") - } - - return -} - -// CheckEntityExistsPreparer prepares the CheckEntityExists request. -func (client APIDiagnosticLoggerClient) CheckEntityExistsPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, diagnosticID string, loggerid string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "apiId": autorest.Encode("path", apiid), - "diagnosticId": autorest.Encode("path", diagnosticID), - "loggerid": autorest.Encode("path", loggerid), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-01-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsHead(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}/loggers/{loggerid}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CheckEntityExistsSender sends the CheckEntityExists request. The method will close the -// http.Response Body if it receives an error. -func (client APIDiagnosticLoggerClient) CheckEntityExistsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CheckEntityExistsResponder handles the response to the CheckEntityExists request. The method always -// closes the http.Response Body. -func (client APIDiagnosticLoggerClient) CheckEntityExistsResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), - autorest.ByClosing()) - result.Response = resp - return -} - -// CreateOrUpdate attaches a logger to a diagnostic for an API. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceName - the name of the API Management service. -// apiid - API identifier. Must be unique in the current API Management service instance. -// diagnosticID - diagnostic identifier. Must be unique in the current API Management service instance. -// loggerid - logger identifier. Must be unique in the API Management service instance. -func (client APIDiagnosticLoggerClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiid string, diagnosticID string, loggerid string) (result LoggerContract, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/APIDiagnosticLoggerClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: serviceName, - Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, - {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: apiid, - Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, - {TargetValue: diagnosticID, - Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, - {TargetValue: loggerid, - Constraints: []validation.Constraint{{Target: "loggerid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "loggerid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { - return result, validation.NewError("apimanagement.APIDiagnosticLoggerClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, apiid, diagnosticID, loggerid) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticLoggerClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticLoggerClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticLoggerClient", "CreateOrUpdate", resp, "Failure responding to request") - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client APIDiagnosticLoggerClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, diagnosticID string, loggerid string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "apiId": autorest.Encode("path", apiid), - "diagnosticId": autorest.Encode("path", diagnosticID), - "loggerid": autorest.Encode("path", loggerid), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-01-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}/loggers/{loggerid}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client APIDiagnosticLoggerClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client APIDiagnosticLoggerClient) CreateOrUpdateResponder(resp *http.Response) (result LoggerContract, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified Logger from Diagnostic for an API. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceName - the name of the API Management service. -// apiid - API identifier. Must be unique in the current API Management service instance. -// diagnosticID - diagnostic identifier. Must be unique in the current API Management service instance. -// loggerid - logger identifier. Must be unique in the API Management service instance. -func (client APIDiagnosticLoggerClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, diagnosticID string, loggerid string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/APIDiagnosticLoggerClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: serviceName, - Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, - {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: apiid, - Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, - {TargetValue: diagnosticID, - Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, - {TargetValue: loggerid, - Constraints: []validation.Constraint{{Target: "loggerid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "loggerid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { - return result, validation.NewError("apimanagement.APIDiagnosticLoggerClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, apiid, diagnosticID, loggerid) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticLoggerClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticLoggerClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticLoggerClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client APIDiagnosticLoggerClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, diagnosticID string, loggerid string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "apiId": autorest.Encode("path", apiid), - "diagnosticId": autorest.Encode("path", diagnosticID), - "loggerid": autorest.Encode("path", loggerid), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-01-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}/loggers/{loggerid}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client APIDiagnosticLoggerClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client APIDiagnosticLoggerClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// ListByService lists all loggers associated with the specified Diagnostic of an API. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceName - the name of the API Management service. -// apiid - API identifier. Must be unique in the current API Management service instance. -// diagnosticID - diagnostic identifier. Must be unique in the current API Management service instance. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|-----------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | -// | type | eq | | -// top - number of records to return. -// skip - number of records to skip. -func (client APIDiagnosticLoggerClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, apiid string, diagnosticID string, filter string, top *int32, skip *int32) (result LoggerCollectionPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/APIDiagnosticLoggerClient.ListByService") - defer func() { - sc := -1 - if result.lc.Response.Response != nil { - sc = result.lc.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: serviceName, - Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, - {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: apiid, - Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, - {TargetValue: diagnosticID, - Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, - {TargetValue: top, - Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, - {TargetValue: skip, - Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil { - return result, validation.NewError("apimanagement.APIDiagnosticLoggerClient", "ListByService", err.Error()) - } - - result.fn = client.listByServiceNextResults - req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, apiid, diagnosticID, filter, top, skip) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticLoggerClient", "ListByService", nil, "Failure preparing request") - return - } - - resp, err := client.ListByServiceSender(req) - if err != nil { - result.lc.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticLoggerClient", "ListByService", resp, "Failure sending request") - return - } - - result.lc, err = client.ListByServiceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticLoggerClient", "ListByService", resp, "Failure responding to request") - } - - return -} - -// ListByServicePreparer prepares the ListByService request. -func (client APIDiagnosticLoggerClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, diagnosticID string, filter string, top *int32, skip *int32) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "apiId": autorest.Encode("path", apiid), - "diagnosticId": autorest.Encode("path", diagnosticID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-01-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - if skip != nil { - queryParameters["$skip"] = autorest.Encode("query", *skip) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}/loggers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByServiceSender sends the ListByService request. The method will close the -// http.Response Body if it receives an error. -func (client APIDiagnosticLoggerClient) ListByServiceSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByServiceResponder handles the response to the ListByService request. The method always -// closes the http.Response Body. -func (client APIDiagnosticLoggerClient) ListByServiceResponder(resp *http.Response) (result LoggerCollection, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByServiceNextResults retrieves the next set of results, if any. -func (client APIDiagnosticLoggerClient) listByServiceNextResults(ctx context.Context, lastResults LoggerCollection) (result LoggerCollection, err error) { - req, err := lastResults.loggerCollectionPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticLoggerClient", "listByServiceNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByServiceSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticLoggerClient", "listByServiceNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByServiceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticLoggerClient", "listByServiceNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. -func (client APIDiagnosticLoggerClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, diagnosticID string, filter string, top *int32, skip *int32) (result LoggerCollectionIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/APIDiagnosticLoggerClient.ListByService") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, apiid, diagnosticID, filter, top, skip) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/diagnosticlogger.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/diagnosticlogger.go deleted file mode 100644 index 86d9a145d860..000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/diagnosticlogger.go +++ /dev/null @@ -1,476 +0,0 @@ -package apimanagement - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// DiagnosticLoggerClient is the apiManagement Client -type DiagnosticLoggerClient struct { - BaseClient -} - -// NewDiagnosticLoggerClient creates an instance of the DiagnosticLoggerClient client. -func NewDiagnosticLoggerClient(subscriptionID string) DiagnosticLoggerClient { - return NewDiagnosticLoggerClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDiagnosticLoggerClientWithBaseURI creates an instance of the DiagnosticLoggerClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewDiagnosticLoggerClientWithBaseURI(baseURI string, subscriptionID string) DiagnosticLoggerClient { - return DiagnosticLoggerClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CheckEntityExists checks that logger entity specified by identifier is associated with the diagnostics entity. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceName - the name of the API Management service. -// diagnosticID - diagnostic identifier. Must be unique in the current API Management service instance. -// loggerid - logger identifier. Must be unique in the API Management service instance. -func (client DiagnosticLoggerClient) CheckEntityExists(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, loggerid string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticLoggerClient.CheckEntityExists") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: serviceName, - Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, - {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: diagnosticID, - Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, - {TargetValue: loggerid, - Constraints: []validation.Constraint{{Target: "loggerid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "loggerid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { - return result, validation.NewError("apimanagement.DiagnosticLoggerClient", "CheckEntityExists", err.Error()) - } - - req, err := client.CheckEntityExistsPreparer(ctx, resourceGroupName, serviceName, diagnosticID, loggerid) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticLoggerClient", "CheckEntityExists", nil, "Failure preparing request") - return - } - - resp, err := client.CheckEntityExistsSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticLoggerClient", "CheckEntityExists", resp, "Failure sending request") - return - } - - result, err = client.CheckEntityExistsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticLoggerClient", "CheckEntityExists", resp, "Failure responding to request") - } - - return -} - -// CheckEntityExistsPreparer prepares the CheckEntityExists request. -func (client DiagnosticLoggerClient) CheckEntityExistsPreparer(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, loggerid string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diagnosticId": autorest.Encode("path", diagnosticID), - "loggerid": autorest.Encode("path", loggerid), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-01-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsHead(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}/loggers/{loggerid}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CheckEntityExistsSender sends the CheckEntityExists request. The method will close the -// http.Response Body if it receives an error. -func (client DiagnosticLoggerClient) CheckEntityExistsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CheckEntityExistsResponder handles the response to the CheckEntityExists request. The method always -// closes the http.Response Body. -func (client DiagnosticLoggerClient) CheckEntityExistsResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), - autorest.ByClosing()) - result.Response = resp - return -} - -// CreateOrUpdate attaches a logger to a diagnostic. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceName - the name of the API Management service. -// diagnosticID - diagnostic identifier. Must be unique in the current API Management service instance. -// loggerid - logger identifier. Must be unique in the API Management service instance. -func (client DiagnosticLoggerClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, loggerid string) (result LoggerContract, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticLoggerClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: serviceName, - Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, - {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: diagnosticID, - Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, - {TargetValue: loggerid, - Constraints: []validation.Constraint{{Target: "loggerid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "loggerid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { - return result, validation.NewError("apimanagement.DiagnosticLoggerClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, diagnosticID, loggerid) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticLoggerClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticLoggerClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticLoggerClient", "CreateOrUpdate", resp, "Failure responding to request") - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DiagnosticLoggerClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, loggerid string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diagnosticId": autorest.Encode("path", diagnosticID), - "loggerid": autorest.Encode("path", loggerid), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-01-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}/loggers/{loggerid}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client DiagnosticLoggerClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client DiagnosticLoggerClient) CreateOrUpdateResponder(resp *http.Response) (result LoggerContract, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified Logger from Diagnostic. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceName - the name of the API Management service. -// diagnosticID - diagnostic identifier. Must be unique in the current API Management service instance. -// loggerid - logger identifier. Must be unique in the API Management service instance. -func (client DiagnosticLoggerClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, loggerid string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticLoggerClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: serviceName, - Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, - {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: diagnosticID, - Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, - {TargetValue: loggerid, - Constraints: []validation.Constraint{{Target: "loggerid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "loggerid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { - return result, validation.NewError("apimanagement.DiagnosticLoggerClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, diagnosticID, loggerid) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticLoggerClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticLoggerClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticLoggerClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client DiagnosticLoggerClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, loggerid string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diagnosticId": autorest.Encode("path", diagnosticID), - "loggerid": autorest.Encode("path", loggerid), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-01-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}/loggers/{loggerid}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client DiagnosticLoggerClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client DiagnosticLoggerClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// ListByService lists all loggers associated with the specified Diagnostic of the API Management service instance. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceName - the name of the API Management service. -// diagnosticID - diagnostic identifier. Must be unique in the current API Management service instance. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|-----------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | -// | type | eq | | -// top - number of records to return. -// skip - number of records to skip. -func (client DiagnosticLoggerClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, filter string, top *int32, skip *int32) (result LoggerCollectionPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticLoggerClient.ListByService") - defer func() { - sc := -1 - if result.lc.Response.Response != nil { - sc = result.lc.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: serviceName, - Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, - {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: diagnosticID, - Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, - {TargetValue: top, - Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, - {TargetValue: skip, - Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil { - return result, validation.NewError("apimanagement.DiagnosticLoggerClient", "ListByService", err.Error()) - } - - result.fn = client.listByServiceNextResults - req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, diagnosticID, filter, top, skip) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticLoggerClient", "ListByService", nil, "Failure preparing request") - return - } - - resp, err := client.ListByServiceSender(req) - if err != nil { - result.lc.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticLoggerClient", "ListByService", resp, "Failure sending request") - return - } - - result.lc, err = client.ListByServiceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticLoggerClient", "ListByService", resp, "Failure responding to request") - } - - return -} - -// ListByServicePreparer prepares the ListByService request. -func (client DiagnosticLoggerClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, filter string, top *int32, skip *int32) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diagnosticId": autorest.Encode("path", diagnosticID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-01-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - if skip != nil { - queryParameters["$skip"] = autorest.Encode("query", *skip) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}/loggers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByServiceSender sends the ListByService request. The method will close the -// http.Response Body if it receives an error. -func (client DiagnosticLoggerClient) ListByServiceSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByServiceResponder handles the response to the ListByService request. The method always -// closes the http.Response Body. -func (client DiagnosticLoggerClient) ListByServiceResponder(resp *http.Response) (result LoggerCollection, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByServiceNextResults retrieves the next set of results, if any. -func (client DiagnosticLoggerClient) listByServiceNextResults(ctx context.Context, lastResults LoggerCollection) (result LoggerCollection, err error) { - req, err := lastResults.loggerCollectionPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "apimanagement.DiagnosticLoggerClient", "listByServiceNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByServiceSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "apimanagement.DiagnosticLoggerClient", "listByServiceNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByServiceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticLoggerClient", "listByServiceNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. -func (client DiagnosticLoggerClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, filter string, top *int32, skip *int32) (result LoggerCollectionIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticLoggerClient.ListByService") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, diagnosticID, filter, top, skip) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/api.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/api.go similarity index 91% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/api.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/api.go index 78b85c06e52f..daf54dd9f0e3 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/api.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/api.go @@ -50,13 +50,13 @@ func NewAPIClientWithBaseURI(baseURI string, subscriptionID string) APIClient { // revision has ;rev=n as a suffix where n is the revision number. // parameters - create or update parameters. // ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. -func (client APIClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiid string, parameters APICreateOrUpdateParameter, ifMatch string) (result APIContract, err error) { +func (client APIClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiid string, parameters APICreateOrUpdateParameter, ifMatch string) (result APICreateOrUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APIClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.Response() != nil { + sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -79,18 +79,12 @@ func (client APIClient) CreateOrUpdate(ctx context.Context, resourceGroupName st return } - resp, err := client.CreateOrUpdateSender(req) + result, err = client.CreateOrUpdateSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "apimanagement.APIClient", "CreateOrUpdate", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "apimanagement.APIClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.APIClient", "CreateOrUpdate", resp, "Failure responding to request") - } - return } @@ -103,7 +97,7 @@ func (client APIClient) CreateOrUpdatePreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -124,8 +118,14 @@ func (client APIClient) CreateOrUpdatePreparer(ctx context.Context, resourceGrou // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. -func (client APIClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +func (client APIClient) CreateOrUpdateSender(req *http.Request) (future APICreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -134,7 +134,7 @@ func (client APIClient) CreateOrUpdateResponder(resp *http.Response) (result API err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} @@ -203,7 +203,7 @@ func (client APIClient) DeletePreparer(ctx context.Context, resourceGroupName st "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -297,7 +297,7 @@ func (client APIClient) GetPreparer(ctx context.Context, resourceGroupName strin "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -388,7 +388,7 @@ func (client APIClient) GetEntityTagPreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -423,17 +423,18 @@ func (client APIClient) GetEntityTagResponder(resp *http.Response) (result autor // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|-----------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | -// | name | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | -// | description | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | -// | serviceUrl | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | -// | path | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| serviceUrl | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| path | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. +// tags - include tags in the response. // expandAPIVersionSet - include full ApiVersionSet resource in response -func (client APIClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, expandAPIVersionSet *bool) (result APICollectionPage, err error) { +func (client APIClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, tags string, expandAPIVersionSet *bool) (result APICollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APIClient.ListByService") defer func() { @@ -459,7 +460,7 @@ func (client APIClient) ListByService(ctx context.Context, resourceGroupName str } result.fn = client.listByServiceNextResults - req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip, expandAPIVersionSet) + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip, tags, expandAPIVersionSet) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.APIClient", "ListByService", nil, "Failure preparing request") return @@ -481,14 +482,14 @@ func (client APIClient) ListByService(ctx context.Context, resourceGroupName str } // ListByServicePreparer prepares the ListByService request. -func (client APIClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, expandAPIVersionSet *bool) (*http.Request, error) { +func (client APIClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, tags string, expandAPIVersionSet *bool) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -501,10 +502,11 @@ func (client APIClient) ListByServicePreparer(ctx context.Context, resourceGroup if skip != nil { queryParameters["$skip"] = autorest.Encode("query", *skip) } + if len(tags) > 0 { + queryParameters["tags"] = autorest.Encode("query", tags) + } if expandAPIVersionSet != nil { queryParameters["expandApiVersionSet"] = autorest.Encode("query", *expandAPIVersionSet) - } else { - queryParameters["expandApiVersionSet"] = autorest.Encode("query", false) } preparer := autorest.CreatePreparer( @@ -556,7 +558,7 @@ func (client APIClient) listByServiceNextResults(ctx context.Context, lastResult } // ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. -func (client APIClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, expandAPIVersionSet *bool) (result APICollectionIterator, err error) { +func (client APIClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, tags string, expandAPIVersionSet *bool) (result APICollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APIClient.ListByService") defer func() { @@ -567,7 +569,7 @@ func (client APIClient) ListByServiceComplete(ctx context.Context, resourceGroup tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip, expandAPIVersionSet) + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip, tags, expandAPIVersionSet) return } @@ -575,19 +577,20 @@ func (client APIClient) ListByServiceComplete(ctx context.Context, resourceGroup // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | aid | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | apiRevision | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | path | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | serviceUrl | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | isCurrent | eq | substringof, contains, startswith, endswith | +// filter - | Field | Supported operators | Supported functions | +// |-------------|------------------------|-----------------------------------| +// +// |name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith| +// |displayName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith| +// |apiRevision | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith| +// |path | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith| +// |description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith| +// |serviceUrl | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith| +// |isCurrent | eq | | // top - number of records to return. // skip - number of records to skip. -func (client APIClient) ListByTags(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result TagResourceCollectionPage, err error) { +// includeNotTaggedApis - include not tagged APIs. +func (client APIClient) ListByTags(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, includeNotTaggedApis *bool) (result TagResourceCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APIClient.ListByTags") defer func() { @@ -613,7 +616,7 @@ func (client APIClient) ListByTags(ctx context.Context, resourceGroupName string } result.fn = client.listByTagsNextResults - req, err := client.ListByTagsPreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + req, err := client.ListByTagsPreparer(ctx, resourceGroupName, serviceName, filter, top, skip, includeNotTaggedApis) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.APIClient", "ListByTags", nil, "Failure preparing request") return @@ -635,14 +638,14 @@ func (client APIClient) ListByTags(ctx context.Context, resourceGroupName string } // ListByTagsPreparer prepares the ListByTags request. -func (client APIClient) ListByTagsPreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { +func (client APIClient) ListByTagsPreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, includeNotTaggedApis *bool) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -655,6 +658,9 @@ func (client APIClient) ListByTagsPreparer(ctx context.Context, resourceGroupNam if skip != nil { queryParameters["$skip"] = autorest.Encode("query", *skip) } + if includeNotTaggedApis != nil { + queryParameters["includeNotTaggedApis"] = autorest.Encode("query", *includeNotTaggedApis) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -705,7 +711,7 @@ func (client APIClient) listByTagsNextResults(ctx context.Context, lastResults T } // ListByTagsComplete enumerates all values, automatically crossing page boundaries as required. -func (client APIClient) ListByTagsComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result TagResourceCollectionIterator, err error) { +func (client APIClient) ListByTagsComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, includeNotTaggedApis *bool) (result TagResourceCollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APIClient.ListByTags") defer func() { @@ -716,7 +722,7 @@ func (client APIClient) ListByTagsComplete(ctx context.Context, resourceGroupNam tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByTags(ctx, resourceGroupName, serviceName, filter, top, skip) + result.page, err = client.ListByTags(ctx, resourceGroupName, serviceName, filter, top, skip, includeNotTaggedApis) return } @@ -782,7 +788,7 @@ func (client APIClient) UpdatePreparer(ctx context.Context, resourceGroupName st "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apidiagnostic.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apidiagnostic.go similarity index 87% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apidiagnostic.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apidiagnostic.go index ed355bf25315..c662aac38f00 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apidiagnostic.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apidiagnostic.go @@ -68,15 +68,49 @@ func (client APIDiagnosticClient) CreateOrUpdate(ctx context.Context, resourceGr {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: diagnosticID, Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "diagnosticID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Enabled", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.LoggerID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.DiagnosticContractProperties.Sampling", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Sampling.Percentage", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Sampling.Percentage", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, + {Target: "parameters.DiagnosticContractProperties.Sampling.Percentage", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, + }}, + }}, + {Target: "parameters.DiagnosticContractProperties.Frontend", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Request", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Request.Body", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Request.Body.Bytes", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Request.Body.Bytes", Name: validation.InclusiveMaximum, Rule: int64(8192), Chain: nil}}}, + }}, + }}, + {Target: "parameters.DiagnosticContractProperties.Frontend.Response", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Response.Body", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Response.Body.Bytes", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Response.Body.Bytes", Name: validation.InclusiveMaximum, Rule: int64(8192), Chain: nil}}}, + }}, + }}, + }}, + {Target: "parameters.DiagnosticContractProperties.Backend", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Request", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Request.Body", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Request.Body.Bytes", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Request.Body.Bytes", Name: validation.InclusiveMaximum, Rule: int64(8192), Chain: nil}}}, + }}, + }}, + {Target: "parameters.DiagnosticContractProperties.Backend.Response", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Response.Body", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Response.Body.Bytes", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Response.Body.Bytes", Name: validation.InclusiveMaximum, Rule: int64(8192), Chain: nil}}}, + }}, + }}, + }}, + }}}}}); err != nil { return result, validation.NewError("apimanagement.APIDiagnosticClient", "CreateOrUpdate", err.Error()) } @@ -111,7 +145,7 @@ func (client APIDiagnosticClient) CreateOrUpdatePreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -175,12 +209,11 @@ func (client APIDiagnosticClient) Delete(ctx context.Context, resourceGroupName {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: diagnosticID, Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "diagnosticID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIDiagnosticClient", "Delete", err.Error()) } @@ -215,7 +248,7 @@ func (client APIDiagnosticClient) DeletePreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -271,12 +304,11 @@ func (client APIDiagnosticClient) Get(ctx context.Context, resourceGroupName str {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: diagnosticID, Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "diagnosticID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIDiagnosticClient", "Get", err.Error()) } @@ -311,7 +343,7 @@ func (client APIDiagnosticClient) GetPreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -367,12 +399,11 @@ func (client APIDiagnosticClient) GetEntityTag(ctx context.Context, resourceGrou {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: diagnosticID, Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "diagnosticID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIDiagnosticClient", "GetEntityTag", err.Error()) } @@ -407,7 +438,7 @@ func (client APIDiagnosticClient) GetEntityTagPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -443,9 +474,9 @@ func (client APIDiagnosticClient) GetEntityTagResponder(resp *http.Response) (re // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // apiid - API identifier. Must be unique in the current API Management service instance. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|-----------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. func (client APIDiagnosticClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result DiagnosticCollectionPage, err error) { @@ -466,8 +497,7 @@ func (client APIDiagnosticClient) ListByService(ctx context.Context, resourceGro {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, @@ -508,7 +538,7 @@ func (client APIDiagnosticClient) ListByServicePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -613,12 +643,11 @@ func (client APIDiagnosticClient) Update(ctx context.Context, resourceGroupName {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: diagnosticID, Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "diagnosticID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIDiagnosticClient", "Update", err.Error()) } @@ -653,7 +682,7 @@ func (client APIDiagnosticClient) UpdatePreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apiexport.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apiexport.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apiexport.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apiexport.go index 5f0356cd9221..849552b455c4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apiexport.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apiexport.go @@ -104,7 +104,7 @@ func (client APIExportClient) GetPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, "export": autorest.Encode("query", "true"), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apiissue.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apiissue.go similarity index 92% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apiissue.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apiissue.go index 98124a95ac86..2dd822dd10f1 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apiissue.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apiissue.go @@ -49,8 +49,7 @@ func NewAPIIssueClientWithBaseURI(baseURI string, subscriptionID string) APIIssu // apiid - API identifier. Must be unique in the current API Management service instance. // issueID - issue identifier. Must be unique in the current API Management service instance. // parameters - create parameters. -// ifMatch - eTag of the Issue Entity. ETag should match the current entity state from the header response of -// the GET request or it should be * for unconditional update. +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. func (client APIIssueClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, parameters IssueContract, ifMatch string) (result IssueContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APIIssueClient.CreateOrUpdate") @@ -69,8 +68,7 @@ func (client APIIssueClient) CreateOrUpdate(ctx context.Context, resourceGroupNa {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: issueID, Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -115,7 +113,7 @@ func (client APIIssueClient) CreateOrUpdatePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -159,8 +157,8 @@ func (client APIIssueClient) CreateOrUpdateResponder(resp *http.Response) (resul // serviceName - the name of the API Management service. // apiid - API identifier. Must be unique in the current API Management service instance. // issueID - issue identifier. Must be unique in the current API Management service instance. -// ifMatch - eTag of the Issue Entity. ETag should match the current entity state from the header response of -// the GET request or it should be * for unconditional update. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. func (client APIIssueClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, ifMatch string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APIIssueClient.Delete") @@ -179,8 +177,7 @@ func (client APIIssueClient) Delete(ctx context.Context, resourceGroupName strin {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: issueID, Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -219,7 +216,7 @@ func (client APIIssueClient) DeletePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -257,7 +254,8 @@ func (client APIIssueClient) DeleteResponder(resp *http.Response) (result autore // serviceName - the name of the API Management service. // apiid - API identifier. Must be unique in the current API Management service instance. // issueID - issue identifier. Must be unique in the current API Management service instance. -func (client APIIssueClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string) (result IssueContract, err error) { +// expandCommentsAttachments - expand the comment attachments. +func (client APIIssueClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, expandCommentsAttachments *bool) (result IssueContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APIIssueClient.Get") defer func() { @@ -275,8 +273,7 @@ func (client APIIssueClient) Get(ctx context.Context, resourceGroupName string, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: issueID, Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -284,7 +281,7 @@ func (client APIIssueClient) Get(ctx context.Context, resourceGroupName string, return result, validation.NewError("apimanagement.APIIssueClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, apiid, issueID) + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, apiid, issueID, expandCommentsAttachments) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.APIIssueClient", "Get", nil, "Failure preparing request") return @@ -306,7 +303,7 @@ func (client APIIssueClient) Get(ctx context.Context, resourceGroupName string, } // GetPreparer prepares the Get request. -func (client APIIssueClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string) (*http.Request, error) { +func (client APIIssueClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, expandCommentsAttachments *bool) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "issueId": autorest.Encode("path", issueID), @@ -315,10 +312,13 @@ func (client APIIssueClient) GetPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if expandCommentsAttachments != nil { + queryParameters["expandCommentsAttachments"] = autorest.Encode("query", *expandCommentsAttachments) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -371,8 +371,7 @@ func (client APIIssueClient) GetEntityTag(ctx context.Context, resourceGroupName {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: issueID, Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -411,7 +410,7 @@ func (client APIIssueClient) GetEntityTagPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -447,14 +446,14 @@ func (client APIIssueClient) GetEntityTagResponder(resp *http.Response) (result // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // apiid - API identifier. Must be unique in the current API Management service instance. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|-----------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | -// | state | eq | | -// | userId | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| userId | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| state | filter | eq | |
+// expandCommentsAttachments - expand the comment attachments. // top - number of records to return. // skip - number of records to skip. -func (client APIIssueClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result IssueCollectionPage, err error) { +func (client APIIssueClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, expandCommentsAttachments *bool, top *int32, skip *int32) (result IssueCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APIIssueClient.ListByService") defer func() { @@ -472,8 +471,7 @@ func (client APIIssueClient) ListByService(ctx context.Context, resourceGroupNam {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, @@ -484,7 +482,7 @@ func (client APIIssueClient) ListByService(ctx context.Context, resourceGroupNam } result.fn = client.listByServiceNextResults - req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, apiid, filter, expandCommentsAttachments, top, skip) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.APIIssueClient", "ListByService", nil, "Failure preparing request") return @@ -506,7 +504,7 @@ func (client APIIssueClient) ListByService(ctx context.Context, resourceGroupNam } // ListByServicePreparer prepares the ListByService request. -func (client APIIssueClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (*http.Request, error) { +func (client APIIssueClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, expandCommentsAttachments *bool, top *int32, skip *int32) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -514,13 +512,16 @@ func (client APIIssueClient) ListByServicePreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } if len(filter) > 0 { queryParameters["$filter"] = autorest.Encode("query", filter) } + if expandCommentsAttachments != nil { + queryParameters["expandCommentsAttachments"] = autorest.Encode("query", *expandCommentsAttachments) + } if top != nil { queryParameters["$top"] = autorest.Encode("query", *top) } @@ -577,7 +578,7 @@ func (client APIIssueClient) listByServiceNextResults(ctx context.Context, lastR } // ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. -func (client APIIssueClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result IssueCollectionIterator, err error) { +func (client APIIssueClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, expandCommentsAttachments *bool, top *int32, skip *int32) (result IssueCollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APIIssueClient.ListByService") defer func() { @@ -588,7 +589,7 @@ func (client APIIssueClient) ListByServiceComplete(ctx context.Context, resource tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, apiid, filter, expandCommentsAttachments, top, skip) return } @@ -599,8 +600,8 @@ func (client APIIssueClient) ListByServiceComplete(ctx context.Context, resource // apiid - API identifier. Must be unique in the current API Management service instance. // issueID - issue identifier. Must be unique in the current API Management service instance. // parameters - update parameters. -// ifMatch - eTag of the Issue Entity. ETag should match the current entity state from the header response of -// the GET request or it should be * for unconditional update. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. func (client APIIssueClient) Update(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, parameters IssueUpdateContract, ifMatch string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APIIssueClient.Update") @@ -619,8 +620,7 @@ func (client APIIssueClient) Update(ctx context.Context, resourceGroupName strin {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: issueID, Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -659,7 +659,7 @@ func (client APIIssueClient) UpdatePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -670,11 +670,8 @@ func (client APIIssueClient) UpdatePreparer(ctx context.Context, resourceGroupNa autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}", pathParameters), autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apiissueattachment.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apiissueattachment.go similarity index 95% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apiissueattachment.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apiissueattachment.go index 645b80bcfeef..ca88a7a53467 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apiissueattachment.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apiissueattachment.go @@ -51,8 +51,7 @@ func NewAPIIssueAttachmentClientWithBaseURI(baseURI string, subscriptionID strin // issueID - issue identifier. Must be unique in the current API Management service instance. // attachmentID - attachment identifier within an Issue. Must be unique in the current Issue. // parameters - create parameters. -// ifMatch - eTag of the Issue Entity. ETag should match the current entity state from the header response of -// the GET request or it should be * for unconditional update. +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. func (client APIIssueAttachmentClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, attachmentID string, parameters IssueAttachmentContract, ifMatch string) (result IssueAttachmentContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APIIssueAttachmentClient.CreateOrUpdate") @@ -71,8 +70,7 @@ func (client APIIssueAttachmentClient) CreateOrUpdate(ctx context.Context, resou {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: issueID, Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -122,7 +120,7 @@ func (client APIIssueAttachmentClient) CreateOrUpdatePreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -167,8 +165,8 @@ func (client APIIssueAttachmentClient) CreateOrUpdateResponder(resp *http.Respon // apiid - API identifier. Must be unique in the current API Management service instance. // issueID - issue identifier. Must be unique in the current API Management service instance. // attachmentID - attachment identifier within an Issue. Must be unique in the current Issue. -// ifMatch - eTag of the Issue Entity. ETag should match the current entity state from the header response of -// the GET request or it should be * for unconditional update. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. func (client APIIssueAttachmentClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, attachmentID string, ifMatch string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APIIssueAttachmentClient.Delete") @@ -187,8 +185,7 @@ func (client APIIssueAttachmentClient) Delete(ctx context.Context, resourceGroup {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: issueID, Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -232,7 +229,7 @@ func (client APIIssueAttachmentClient) DeletePreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -289,8 +286,7 @@ func (client APIIssueAttachmentClient) Get(ctx context.Context, resourceGroupNam {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: issueID, Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -334,7 +330,7 @@ func (client APIIssueAttachmentClient) GetPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -391,8 +387,7 @@ func (client APIIssueAttachmentClient) GetEntityTag(ctx context.Context, resourc {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: issueID, Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -436,7 +431,7 @@ func (client APIIssueAttachmentClient) GetEntityTagPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -467,16 +462,16 @@ func (client APIIssueAttachmentClient) GetEntityTagResponder(resp *http.Response return } -// ListByService lists all comments for the Issue associated with the specified API. +// ListByService lists all attachments for the Issue associated with the specified API. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // apiid - API identifier. Must be unique in the current API Management service instance. // issueID - issue identifier. Must be unique in the current API Management service instance. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|-----------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | -// | userId | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| userId | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. func (client APIIssueAttachmentClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, filter string, top *int32, skip *int32) (result IssueAttachmentCollectionPage, err error) { @@ -497,8 +492,7 @@ func (client APIIssueAttachmentClient) ListByService(ctx context.Context, resour {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: issueID, Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -544,7 +538,7 @@ func (client APIIssueAttachmentClient) ListByServicePreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apiissuecomment.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apiissuecomment.go similarity index 95% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apiissuecomment.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apiissuecomment.go index 126a11d74472..ff2891dba47b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apiissuecomment.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apiissuecomment.go @@ -50,8 +50,7 @@ func NewAPIIssueCommentClientWithBaseURI(baseURI string, subscriptionID string) // issueID - issue identifier. Must be unique in the current API Management service instance. // commentID - comment identifier within an Issue. Must be unique in the current Issue. // parameters - create parameters. -// ifMatch - eTag of the Issue Entity. ETag should match the current entity state from the header response of -// the GET request or it should be * for unconditional update. +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. func (client APIIssueCommentClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, commentID string, parameters IssueCommentContract, ifMatch string) (result IssueCommentContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APIIssueCommentClient.CreateOrUpdate") @@ -70,8 +69,7 @@ func (client APIIssueCommentClient) CreateOrUpdate(ctx context.Context, resource {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: issueID, Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -120,7 +118,7 @@ func (client APIIssueCommentClient) CreateOrUpdatePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -165,8 +163,8 @@ func (client APIIssueCommentClient) CreateOrUpdateResponder(resp *http.Response) // apiid - API identifier. Must be unique in the current API Management service instance. // issueID - issue identifier. Must be unique in the current API Management service instance. // commentID - comment identifier within an Issue. Must be unique in the current Issue. -// ifMatch - eTag of the Issue Entity. ETag should match the current entity state from the header response of -// the GET request or it should be * for unconditional update. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. func (client APIIssueCommentClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, commentID string, ifMatch string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APIIssueCommentClient.Delete") @@ -185,8 +183,7 @@ func (client APIIssueCommentClient) Delete(ctx context.Context, resourceGroupNam {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: issueID, Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -230,7 +227,7 @@ func (client APIIssueCommentClient) DeletePreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -287,8 +284,7 @@ func (client APIIssueCommentClient) Get(ctx context.Context, resourceGroupName s {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: issueID, Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -332,7 +328,7 @@ func (client APIIssueCommentClient) GetPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -389,8 +385,7 @@ func (client APIIssueCommentClient) GetEntityTag(ctx context.Context, resourceGr {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: issueID, Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -434,7 +429,7 @@ func (client APIIssueCommentClient) GetEntityTagPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -471,10 +466,10 @@ func (client APIIssueCommentClient) GetEntityTagResponder(resp *http.Response) ( // serviceName - the name of the API Management service. // apiid - API identifier. Must be unique in the current API Management service instance. // issueID - issue identifier. Must be unique in the current API Management service instance. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|-----------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | -// | userId | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| userId | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. func (client APIIssueCommentClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, filter string, top *int32, skip *int32) (result IssueCommentCollectionPage, err error) { @@ -495,8 +490,7 @@ func (client APIIssueCommentClient) ListByService(ctx context.Context, resourceG {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: issueID, Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -542,7 +536,7 @@ func (client APIIssueCommentClient) ListByServicePreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apioperation.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apioperation.go similarity index 95% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apioperation.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apioperation.go index 16dfd9f4890f..600a656a9a3f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apioperation.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apioperation.go @@ -74,8 +74,7 @@ func (client APIOperationClient) CreateOrUpdate(ctx context.Context, resourceGro {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: operationID, Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.OperationContractProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.OperationContractProperties.DisplayName", Name: validation.Null, Rule: true, @@ -122,7 +121,7 @@ func (client APIOperationClient) CreateOrUpdatePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -192,8 +191,7 @@ func (client APIOperationClient) Delete(ctx context.Context, resourceGroupName s {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: operationID, Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIOperationClient", "Delete", err.Error()) } @@ -228,7 +226,7 @@ func (client APIOperationClient) DeletePreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -290,8 +288,7 @@ func (client APIOperationClient) Get(ctx context.Context, resourceGroupName stri {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: operationID, Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIOperationClient", "Get", err.Error()) } @@ -326,7 +323,7 @@ func (client APIOperationClient) GetPreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -388,8 +385,7 @@ func (client APIOperationClient) GetEntityTag(ctx context.Context, resourceGroup {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: operationID, Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIOperationClient", "GetEntityTag", err.Error()) } @@ -424,7 +420,7 @@ func (client APIOperationClient) GetEntityTagPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -461,15 +457,17 @@ func (client APIOperationClient) GetEntityTagResponder(resp *http.Response) (res // serviceName - the name of the API Management service. // apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current // revision has ;rev=n as a suffix where n is the revision number. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|-----------------------------------| -// | name | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | -// | method | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | -// | description | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | -// | urlTemplate | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| method | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
| urlTemplate | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. -func (client APIOperationClient) ListByAPI(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result OperationCollectionPage, err error) { +// tags - include tags in the response. +func (client APIOperationClient) ListByAPI(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32, tags string) (result OperationCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APIOperationClient.ListByAPI") defer func() { @@ -499,7 +497,7 @@ func (client APIOperationClient) ListByAPI(ctx context.Context, resourceGroupNam } result.fn = client.listByAPINextResults - req, err := client.ListByAPIPreparer(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + req, err := client.ListByAPIPreparer(ctx, resourceGroupName, serviceName, apiid, filter, top, skip, tags) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.APIOperationClient", "ListByAPI", nil, "Failure preparing request") return @@ -521,7 +519,7 @@ func (client APIOperationClient) ListByAPI(ctx context.Context, resourceGroupNam } // ListByAPIPreparer prepares the ListByAPI request. -func (client APIOperationClient) ListByAPIPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (*http.Request, error) { +func (client APIOperationClient) ListByAPIPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32, tags string) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -529,7 +527,7 @@ func (client APIOperationClient) ListByAPIPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -542,6 +540,9 @@ func (client APIOperationClient) ListByAPIPreparer(ctx context.Context, resource if skip != nil { queryParameters["$skip"] = autorest.Encode("query", *skip) } + if len(tags) > 0 { + queryParameters["tags"] = autorest.Encode("query", tags) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -592,7 +593,7 @@ func (client APIOperationClient) listByAPINextResults(ctx context.Context, lastR } // ListByAPIComplete enumerates all values, automatically crossing page boundaries as required. -func (client APIOperationClient) ListByAPIComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result OperationCollectionIterator, err error) { +func (client APIOperationClient) ListByAPIComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32, tags string) (result OperationCollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APIOperationClient.ListByAPI") defer func() { @@ -603,7 +604,7 @@ func (client APIOperationClient) ListByAPIComplete(ctx context.Context, resource tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByAPI(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + result.page, err = client.ListByAPI(ctx, resourceGroupName, serviceName, apiid, filter, top, skip, tags) return } @@ -640,8 +641,7 @@ func (client APIOperationClient) Update(ctx context.Context, resourceGroupName s {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: operationID, Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIOperationClient", "Update", err.Error()) } @@ -676,7 +676,7 @@ func (client APIOperationClient) UpdatePreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apioperationpolicy.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apioperationpolicy.go similarity index 96% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apioperationpolicy.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apioperationpolicy.go index ca0203ff7f6c..218fa9515218 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apioperationpolicy.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apioperationpolicy.go @@ -75,11 +75,10 @@ func (client APIOperationPolicyClient) CreateOrUpdate(ctx context.Context, resou {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: operationID, Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.PolicyContractProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.PolicyContractProperties.PolicyContent", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + Chain: []validation.Constraint{{Target: "parameters.PolicyContractProperties.Value", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { return result, validation.NewError("apimanagement.APIOperationPolicyClient", "CreateOrUpdate", err.Error()) } @@ -115,7 +114,7 @@ func (client APIOperationPolicyClient) CreateOrUpdatePreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -185,8 +184,7 @@ func (client APIOperationPolicyClient) Delete(ctx context.Context, resourceGroup {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: operationID, Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIOperationPolicyClient", "Delete", err.Error()) } @@ -222,7 +220,7 @@ func (client APIOperationPolicyClient) DeletePreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -262,7 +260,8 @@ func (client APIOperationPolicyClient) DeleteResponder(resp *http.Response) (res // revision has ;rev=n as a suffix where n is the revision number. // operationID - operation identifier within an API. Must be unique in the current API Management service // instance. -func (client APIOperationPolicyClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string) (result PolicyContract, err error) { +// formatParameter - policy Export Format. +func (client APIOperationPolicyClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, formatParameter PolicyExportFormat) (result PolicyContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APIOperationPolicyClient.Get") defer func() { @@ -284,12 +283,11 @@ func (client APIOperationPolicyClient) Get(ctx context.Context, resourceGroupNam {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: operationID, Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIOperationPolicyClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, apiid, operationID) + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, apiid, operationID, formatParameter) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.APIOperationPolicyClient", "Get", nil, "Failure preparing request") return @@ -311,7 +309,7 @@ func (client APIOperationPolicyClient) Get(ctx context.Context, resourceGroupNam } // GetPreparer prepares the Get request. -func (client APIOperationPolicyClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string) (*http.Request, error) { +func (client APIOperationPolicyClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, formatParameter PolicyExportFormat) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "operationId": autorest.Encode("path", operationID), @@ -321,10 +319,15 @@ func (client APIOperationPolicyClient) GetPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if len(string(formatParameter)) > 0 { + queryParameters["format"] = autorest.Encode("query", formatParameter) + } else { + queryParameters["format"] = autorest.Encode("query", "xml") + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -383,8 +386,7 @@ func (client APIOperationPolicyClient) GetEntityTag(ctx context.Context, resourc {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: operationID, Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIOperationPolicyClient", "GetEntityTag", err.Error()) } @@ -420,7 +422,7 @@ func (client APIOperationPolicyClient) GetEntityTagPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -481,8 +483,7 @@ func (client APIOperationPolicyClient) ListByOperation(ctx context.Context, reso {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: operationID, Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIOperationPolicyClient", "ListByOperation", err.Error()) } @@ -517,7 +518,7 @@ func (client APIOperationPolicyClient) ListByOperationPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apipolicy.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apipolicy.go similarity index 96% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apipolicy.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apipolicy.go index f48c89b59621..3b7044fc0b1e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apipolicy.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apipolicy.go @@ -72,7 +72,7 @@ func (client APIPolicyClient) CreateOrUpdate(ctx context.Context, resourceGroupN {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.PolicyContractProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.PolicyContractProperties.PolicyContent", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + Chain: []validation.Constraint{{Target: "parameters.PolicyContractProperties.Value", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { return result, validation.NewError("apimanagement.APIPolicyClient", "CreateOrUpdate", err.Error()) } @@ -107,7 +107,7 @@ func (client APIPolicyClient) CreateOrUpdatePreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -207,7 +207,7 @@ func (client APIPolicyClient) DeletePreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -245,7 +245,8 @@ func (client APIPolicyClient) DeleteResponder(resp *http.Response) (result autor // serviceName - the name of the API Management service. // apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current // revision has ;rev=n as a suffix where n is the revision number. -func (client APIPolicyClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiid string) (result PolicyContract, err error) { +// formatParameter - policy Export Format. +func (client APIPolicyClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiid string, formatParameter PolicyExportFormat) (result PolicyContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APIPolicyClient.Get") defer func() { @@ -268,7 +269,7 @@ func (client APIPolicyClient) Get(ctx context.Context, resourceGroupName string, return result, validation.NewError("apimanagement.APIPolicyClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, apiid) + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, apiid, formatParameter) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.APIPolicyClient", "Get", nil, "Failure preparing request") return @@ -290,7 +291,7 @@ func (client APIPolicyClient) Get(ctx context.Context, resourceGroupName string, } // GetPreparer prepares the Get request. -func (client APIPolicyClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string) (*http.Request, error) { +func (client APIPolicyClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, formatParameter PolicyExportFormat) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "policyId": autorest.Encode("path", "policy"), @@ -299,10 +300,15 @@ func (client APIPolicyClient) GetPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if len(string(formatParameter)) > 0 { + queryParameters["format"] = autorest.Encode("query", formatParameter) + } else { + queryParameters["format"] = autorest.Encode("query", "xml") + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -391,7 +397,7 @@ func (client APIPolicyClient) GetEntityTagPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -481,7 +487,7 @@ func (client APIPolicyClient) ListByAPIPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apiproduct.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apiproduct.go similarity index 95% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apiproduct.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apiproduct.go index e96239f2ff35..eae723989954 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apiproduct.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apiproduct.go @@ -47,9 +47,9 @@ func NewAPIProductClientWithBaseURI(baseURI string, subscriptionID string) APIPr // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // apiid - API identifier. Must be unique in the current API Management service instance. -// filter - | Field | Supported operators | Supported functions | -// |-------|------------------------|---------------------------------------------| -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| displayName | filter | ge, le, eq, ne, +// gt, lt | substringof, contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. func (client APIProductClient) ListByApis(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result ProductCollectionPage, err error) { @@ -70,8 +70,7 @@ func (client APIProductClient) ListByApis(ctx context.Context, resourceGroupName {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, @@ -112,7 +111,7 @@ func (client APIProductClient) ListByApisPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apirelease.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apirelease.go similarity index 82% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apirelease.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apirelease.go index 8628f4fb0e53..a68c1eeeee91 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apirelease.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apirelease.go @@ -42,16 +42,17 @@ func NewAPIReleaseClientWithBaseURI(baseURI string, subscriptionID string) APIRe return APIReleaseClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Create creates a new Release for the API. +// CreateOrUpdate creates a new Release for the API. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // apiid - API identifier. Must be unique in the current API Management service instance. // releaseID - release identifier within an API. Must be unique in the current API Management service instance. // parameters - create parameters. -func (client APIReleaseClient) Create(ctx context.Context, resourceGroupName string, serviceName string, apiid string, releaseID string, parameters APIReleaseContract) (result APIReleaseContract, err error) { +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client APIReleaseClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiid string, releaseID string, parameters APIReleaseContract, ifMatch string) (result APIReleaseContract, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/APIReleaseClient.Create") + ctx = tracing.StartSpan(ctx, fqdn+"/APIReleaseClient.CreateOrUpdate") defer func() { sc := -1 if result.Response.Response != nil { @@ -67,38 +68,37 @@ func (client APIReleaseClient) Create(ctx context.Context, resourceGroupName str {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: releaseID, Constraints: []validation.Constraint{{Target: "releaseID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "releaseID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "releaseID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { - return result, validation.NewError("apimanagement.APIReleaseClient", "Create", err.Error()) + {Target: "releaseID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIReleaseClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreatePreparer(ctx, resourceGroupName, serviceName, apiid, releaseID, parameters) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, apiid, releaseID, parameters, ifMatch) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "Create", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "CreateOrUpdate", nil, "Failure preparing request") return } - resp, err := client.CreateSender(req) + resp, err := client.CreateOrUpdateSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "Create", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "CreateOrUpdate", resp, "Failure sending request") return } - result, err = client.CreateResponder(resp) + result, err = client.CreateOrUpdateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "Create", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "CreateOrUpdate", resp, "Failure responding to request") } return } -// CreatePreparer prepares the Create request. -func (client APIReleaseClient) CreatePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, releaseID string, parameters APIReleaseContract) (*http.Request, error) { +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client APIReleaseClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, releaseID string, parameters APIReleaseContract, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "releaseId": autorest.Encode("path", releaseID), @@ -107,7 +107,7 @@ func (client APIReleaseClient) CreatePreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -119,18 +119,22 @@ func (client APIReleaseClient) CreatePreparer(ctx context.Context, resourceGroup autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// CreateSender sends the Create request. The method will close the +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. -func (client APIReleaseClient) CreateSender(req *http.Request) (*http.Response, error) { +func (client APIReleaseClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } -// CreateResponder handles the response to the Create request. The method always +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. -func (client APIReleaseClient) CreateResponder(resp *http.Response) (result APIReleaseContract, err error) { +func (client APIReleaseClient) CreateOrUpdateResponder(resp *http.Response) (result APIReleaseContract, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -167,12 +171,11 @@ func (client APIReleaseClient) Delete(ctx context.Context, resourceGroupName str {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: releaseID, Constraints: []validation.Constraint{{Target: "releaseID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "releaseID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "releaseID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "releaseID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIReleaseClient", "Delete", err.Error()) } @@ -207,7 +210,7 @@ func (client APIReleaseClient) DeletePreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -263,12 +266,11 @@ func (client APIReleaseClient) Get(ctx context.Context, resourceGroupName string {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: releaseID, Constraints: []validation.Constraint{{Target: "releaseID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "releaseID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "releaseID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "releaseID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIReleaseClient", "Get", err.Error()) } @@ -303,7 +305,7 @@ func (client APIReleaseClient) GetPreparer(ctx context.Context, resourceGroupNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -359,12 +361,11 @@ func (client APIReleaseClient) GetEntityTag(ctx context.Context, resourceGroupNa {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: releaseID, Constraints: []validation.Constraint{{Target: "releaseID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "releaseID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "releaseID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "releaseID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIReleaseClient", "GetEntityTag", err.Error()) } @@ -399,7 +400,7 @@ func (client APIReleaseClient) GetEntityTagPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -430,22 +431,21 @@ func (client APIReleaseClient) GetEntityTagResponder(resp *http.Response) (resul return } -// List lists all releases of an API. An API release is created when making an API Revision current. Releases are also -// used to rollback to previous revisions. Results will be paged and can be constrained by the $top and $skip +// ListByService lists all releases of an API. An API release is created when making an API Revision current. Releases +// are also used to rollback to previous revisions. Results will be paged and can be constrained by the $top and $skip // parameters. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // apiid - API identifier. Must be unique in the current API Management service instance. -// filter - | Field | Supported operators | Supported functions | -// |-------|------------------------|---------------------------------------------| -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// |notes|ge le eq ne gt lt|substringof contains startswith endswith| +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| notes | filter | ge, le, eq, ne, gt, +// lt | substringof, contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. -func (client APIReleaseClient) List(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result APIReleaseCollectionPage, err error) { +func (client APIReleaseClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result APIReleaseCollectionPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/APIReleaseClient.List") + ctx = tracing.StartSpan(ctx, fqdn+"/APIReleaseClient.ListByService") defer func() { sc := -1 if result.arc.Response.Response != nil { @@ -461,41 +461,40 @@ func (client APIReleaseClient) List(ctx context.Context, resourceGroupName strin {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, {TargetValue: skip, Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil { - return result, validation.NewError("apimanagement.APIReleaseClient", "List", err.Error()) + return result, validation.NewError("apimanagement.APIReleaseClient", "ListByService", err.Error()) } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + result.fn = client.listByServiceNextResults + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "List", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "ListByService", nil, "Failure preparing request") return } - resp, err := client.ListSender(req) + resp, err := client.ListByServiceSender(req) if err != nil { result.arc.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "List", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "ListByService", resp, "Failure sending request") return } - result.arc, err = client.ListResponder(resp) + result.arc, err = client.ListByServiceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "List", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "ListByService", resp, "Failure responding to request") } return } -// ListPreparer prepares the List request. -func (client APIReleaseClient) ListPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (*http.Request, error) { +// ListByServicePreparer prepares the ListByService request. +func (client APIReleaseClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -503,7 +502,7 @@ func (client APIReleaseClient) ListPreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -525,15 +524,15 @@ func (client APIReleaseClient) ListPreparer(ctx context.Context, resourceGroupNa return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListSender sends the List request. The method will close the +// ListByServiceSender sends the ListByService request. The method will close the // http.Response Body if it receives an error. -func (client APIReleaseClient) ListSender(req *http.Request) (*http.Response, error) { +func (client APIReleaseClient) ListByServiceSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } -// ListResponder handles the response to the List request. The method always +// ListByServiceResponder handles the response to the ListByService request. The method always // closes the http.Response Body. -func (client APIReleaseClient) ListResponder(resp *http.Response) (result APIReleaseCollection, err error) { +func (client APIReleaseClient) ListByServiceResponder(resp *http.Response) (result APIReleaseCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -544,31 +543,31 @@ func (client APIReleaseClient) ListResponder(resp *http.Response) (result APIRel return } -// listNextResults retrieves the next set of results, if any. -func (client APIReleaseClient) listNextResults(ctx context.Context, lastResults APIReleaseCollection) (result APIReleaseCollection, err error) { +// listByServiceNextResults retrieves the next set of results, if any. +func (client APIReleaseClient) listByServiceNextResults(ctx context.Context, lastResults APIReleaseCollection) (result APIReleaseCollection, err error) { req, err := lastResults.aPIReleaseCollectionPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "listNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "listByServiceNextResults", nil, "Failure preparing next results request") } if req == nil { return } - resp, err := client.ListSender(req) + resp, err := client.ListByServiceSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "listNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "listByServiceNextResults", resp, "Failure sending next results request") } - result, err = client.ListResponder(resp) + result, err = client.ListByServiceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "listNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "listByServiceNextResults", resp, "Failure responding to next results request") } return } -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client APIReleaseClient) ListComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result APIReleaseCollectionIterator, err error) { +// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client APIReleaseClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result APIReleaseCollectionIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/APIReleaseClient.List") + ctx = tracing.StartSpan(ctx, fqdn+"/APIReleaseClient.ListByService") defer func() { sc := -1 if result.Response().Response.Response != nil { @@ -577,7 +576,7 @@ func (client APIReleaseClient) ListComplete(ctx context.Context, resourceGroupNa tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.List(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) return } @@ -608,12 +607,11 @@ func (client APIReleaseClient) Update(ctx context.Context, resourceGroupName str {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: releaseID, Constraints: []validation.Constraint{{Target: "releaseID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "releaseID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "releaseID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "releaseID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIReleaseClient", "Update", err.Error()) } @@ -648,7 +646,7 @@ func (client APIReleaseClient) UpdatePreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apirevisions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apirevision.go similarity index 60% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apirevisions.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apirevision.go index ef6335b07d1b..1365912bdf1a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apirevisions.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apirevision.go @@ -26,36 +26,35 @@ import ( "net/http" ) -// APIRevisionsClient is the apiManagement Client -type APIRevisionsClient struct { +// APIRevisionClient is the apiManagement Client +type APIRevisionClient struct { BaseClient } -// NewAPIRevisionsClient creates an instance of the APIRevisionsClient client. -func NewAPIRevisionsClient(subscriptionID string) APIRevisionsClient { - return NewAPIRevisionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewAPIRevisionClient creates an instance of the APIRevisionClient client. +func NewAPIRevisionClient(subscriptionID string) APIRevisionClient { + return NewAPIRevisionClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewAPIRevisionsClientWithBaseURI creates an instance of the APIRevisionsClient client using a custom endpoint. Use +// NewAPIRevisionClientWithBaseURI creates an instance of the APIRevisionClient client using a custom endpoint. Use // this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewAPIRevisionsClientWithBaseURI(baseURI string, subscriptionID string) APIRevisionsClient { - return APIRevisionsClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewAPIRevisionClientWithBaseURI(baseURI string, subscriptionID string) APIRevisionClient { + return APIRevisionClient{NewWithBaseURI(baseURI, subscriptionID)} } -// List lists all revisions of an API. +// ListByService lists all revisions of an API. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // apiid - API identifier. Must be unique in the current API Management service instance. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|-----------------------------------| -// -// |apiRevision | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith| +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| apiRevision | filter | ge, le, eq, ne, +// gt, lt | substringof, contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. -func (client APIRevisionsClient) List(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result APIRevisionCollectionPage, err error) { +func (client APIRevisionClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result APIRevisionCollectionPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/APIRevisionsClient.List") + ctx = tracing.StartSpan(ctx, fqdn+"/APIRevisionClient.ListByService") defer func() { sc := -1 if result.arc.Response.Response != nil { @@ -71,41 +70,40 @@ func (client APIRevisionsClient) List(ctx context.Context, resourceGroupName str {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, {TargetValue: skip, Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil { - return result, validation.NewError("apimanagement.APIRevisionsClient", "List", err.Error()) + return result, validation.NewError("apimanagement.APIRevisionClient", "ListByService", err.Error()) } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + result.fn = client.listByServiceNextResults + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.APIRevisionsClient", "List", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "apimanagement.APIRevisionClient", "ListByService", nil, "Failure preparing request") return } - resp, err := client.ListSender(req) + resp, err := client.ListByServiceSender(req) if err != nil { result.arc.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "apimanagement.APIRevisionsClient", "List", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "apimanagement.APIRevisionClient", "ListByService", resp, "Failure sending request") return } - result.arc, err = client.ListResponder(resp) + result.arc, err = client.ListByServiceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.APIRevisionsClient", "List", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "apimanagement.APIRevisionClient", "ListByService", resp, "Failure responding to request") } return } -// ListPreparer prepares the List request. -func (client APIRevisionsClient) ListPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (*http.Request, error) { +// ListByServicePreparer prepares the ListByService request. +func (client APIRevisionClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -113,7 +111,7 @@ func (client APIRevisionsClient) ListPreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -135,15 +133,15 @@ func (client APIRevisionsClient) ListPreparer(ctx context.Context, resourceGroup return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListSender sends the List request. The method will close the +// ListByServiceSender sends the ListByService request. The method will close the // http.Response Body if it receives an error. -func (client APIRevisionsClient) ListSender(req *http.Request) (*http.Response, error) { +func (client APIRevisionClient) ListByServiceSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } -// ListResponder handles the response to the List request. The method always +// ListByServiceResponder handles the response to the ListByService request. The method always // closes the http.Response Body. -func (client APIRevisionsClient) ListResponder(resp *http.Response) (result APIRevisionCollection, err error) { +func (client APIRevisionClient) ListByServiceResponder(resp *http.Response) (result APIRevisionCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -154,31 +152,31 @@ func (client APIRevisionsClient) ListResponder(resp *http.Response) (result APIR return } -// listNextResults retrieves the next set of results, if any. -func (client APIRevisionsClient) listNextResults(ctx context.Context, lastResults APIRevisionCollection) (result APIRevisionCollection, err error) { +// listByServiceNextResults retrieves the next set of results, if any. +func (client APIRevisionClient) listByServiceNextResults(ctx context.Context, lastResults APIRevisionCollection) (result APIRevisionCollection, err error) { req, err := lastResults.aPIRevisionCollectionPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "apimanagement.APIRevisionsClient", "listNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "apimanagement.APIRevisionClient", "listByServiceNextResults", nil, "Failure preparing next results request") } if req == nil { return } - resp, err := client.ListSender(req) + resp, err := client.ListByServiceSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "apimanagement.APIRevisionsClient", "listNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "apimanagement.APIRevisionClient", "listByServiceNextResults", resp, "Failure sending next results request") } - result, err = client.ListResponder(resp) + result, err = client.ListByServiceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.APIRevisionsClient", "listNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "apimanagement.APIRevisionClient", "listByServiceNextResults", resp, "Failure responding to next results request") } return } -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client APIRevisionsClient) ListComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result APIRevisionCollectionIterator, err error) { +// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client APIRevisionClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result APIRevisionCollectionIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/APIRevisionsClient.List") + ctx = tracing.StartSpan(ctx, fqdn+"/APIRevisionClient.ListByService") defer func() { sc := -1 if result.Response().Response.Response != nil { @@ -187,6 +185,6 @@ func (client APIRevisionsClient) ListComplete(ctx context.Context, resourceGroup tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.List(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apischema.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apischema.go similarity index 89% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apischema.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apischema.go index 08a4758d7b98..5527fb24fe63 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apischema.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apischema.go @@ -51,13 +51,13 @@ func NewAPISchemaClientWithBaseURI(baseURI string, subscriptionID string) APISch // schemaID - schema identifier within an API. Must be unique in the current API Management service instance. // parameters - the schema contents to apply. // ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. -func (client APISchemaClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiid string, schemaID string, parameters SchemaContract, ifMatch string) (result SchemaContract, err error) { +func (client APISchemaClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiid string, schemaID string, parameters SchemaContract, ifMatch string) (result APISchemaCreateOrUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APISchemaClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.Response() != nil { + sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -74,7 +74,7 @@ func (client APISchemaClient) CreateOrUpdate(ctx context.Context, resourceGroupN {TargetValue: schemaID, Constraints: []validation.Constraint{{Target: "schemaID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "schemaID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "schemaID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "schemaID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.SchemaContractProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.SchemaContractProperties.ContentType", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { @@ -87,18 +87,12 @@ func (client APISchemaClient) CreateOrUpdate(ctx context.Context, resourceGroupN return } - resp, err := client.CreateOrUpdateSender(req) + result, err = client.CreateOrUpdateSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "apimanagement.APISchemaClient", "CreateOrUpdate", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "apimanagement.APISchemaClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.APISchemaClient", "CreateOrUpdate", resp, "Failure responding to request") - } - return } @@ -112,7 +106,7 @@ func (client APISchemaClient) CreateOrUpdatePreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -133,8 +127,14 @@ func (client APISchemaClient) CreateOrUpdatePreparer(ctx context.Context, resour // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. -func (client APISchemaClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +func (client APISchemaClient) CreateOrUpdateSender(req *http.Request) (future APISchemaCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -143,7 +143,7 @@ func (client APISchemaClient) CreateOrUpdateResponder(resp *http.Response) (resu err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} @@ -159,7 +159,8 @@ func (client APISchemaClient) CreateOrUpdateResponder(resp *http.Response) (resu // schemaID - schema identifier within an API. Must be unique in the current API Management service instance. // ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET // request or it should be * for unconditional update. -func (client APISchemaClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, schemaID string, ifMatch string) (result autorest.Response, err error) { +// force - if true removes all references to the schema before deleting it. +func (client APISchemaClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, schemaID string, ifMatch string, force *bool) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APISchemaClient.Delete") defer func() { @@ -182,11 +183,11 @@ func (client APISchemaClient) Delete(ctx context.Context, resourceGroupName stri {TargetValue: schemaID, Constraints: []validation.Constraint{{Target: "schemaID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "schemaID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "schemaID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "schemaID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APISchemaClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, apiid, schemaID, ifMatch) + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, apiid, schemaID, ifMatch, force) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.APISchemaClient", "Delete", nil, "Failure preparing request") return @@ -208,7 +209,7 @@ func (client APISchemaClient) Delete(ctx context.Context, resourceGroupName stri } // DeletePreparer prepares the Delete request. -func (client APISchemaClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, schemaID string, ifMatch string) (*http.Request, error) { +func (client APISchemaClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, schemaID string, ifMatch string, force *bool) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -217,10 +218,13 @@ func (client APISchemaClient) DeletePreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if force != nil { + queryParameters["force"] = autorest.Encode("query", *force) + } preparer := autorest.CreatePreparer( autorest.AsDelete(), @@ -279,7 +283,7 @@ func (client APISchemaClient) Get(ctx context.Context, resourceGroupName string, {TargetValue: schemaID, Constraints: []validation.Constraint{{Target: "schemaID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "schemaID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "schemaID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "schemaID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APISchemaClient", "Get", err.Error()) } @@ -314,7 +318,7 @@ func (client APISchemaClient) GetPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -376,7 +380,7 @@ func (client APISchemaClient) GetEntityTag(ctx context.Context, resourceGroupNam {TargetValue: schemaID, Constraints: []validation.Constraint{{Target: "schemaID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "schemaID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "schemaID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "schemaID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APISchemaClient", "GetEntityTag", err.Error()) } @@ -411,7 +415,7 @@ func (client APISchemaClient) GetEntityTagPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -448,7 +452,12 @@ func (client APISchemaClient) GetEntityTagResponder(resp *http.Response) (result // serviceName - the name of the API Management service. // apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current // revision has ;rev=n as a suffix where n is the revision number. -func (client APISchemaClient) ListByAPI(ctx context.Context, resourceGroupName string, serviceName string, apiid string) (result SchemaCollectionPage, err error) { +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| contentType | filter | ge, le, eq, ne, +// gt, lt | substringof, contains, startswith, endswith |
+// top - number of records to return. +// skip - number of records to skip. +func (client APISchemaClient) ListByAPI(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result SchemaCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APISchemaClient.ListByAPI") defer func() { @@ -467,12 +476,18 @@ func (client APISchemaClient) ListByAPI(ctx context.Context, resourceGroupName s {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil { return result, validation.NewError("apimanagement.APISchemaClient", "ListByAPI", err.Error()) } result.fn = client.listByAPINextResults - req, err := client.ListByAPIPreparer(ctx, resourceGroupName, serviceName, apiid) + req, err := client.ListByAPIPreparer(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.APISchemaClient", "ListByAPI", nil, "Failure preparing request") return @@ -494,7 +509,7 @@ func (client APISchemaClient) ListByAPI(ctx context.Context, resourceGroupName s } // ListByAPIPreparer prepares the ListByAPI request. -func (client APISchemaClient) ListByAPIPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string) (*http.Request, error) { +func (client APISchemaClient) ListByAPIPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -502,10 +517,19 @@ func (client APISchemaClient) ListByAPIPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -556,7 +580,7 @@ func (client APISchemaClient) listByAPINextResults(ctx context.Context, lastResu } // ListByAPIComplete enumerates all values, automatically crossing page boundaries as required. -func (client APISchemaClient) ListByAPIComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string) (result SchemaCollectionIterator, err error) { +func (client APISchemaClient) ListByAPIComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result SchemaCollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APISchemaClient.ListByAPI") defer func() { @@ -567,6 +591,6 @@ func (client APISchemaClient) ListByAPIComplete(ctx context.Context, resourceGro tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByAPI(ctx, resourceGroupName, serviceName, apiid) + result.page, err = client.ListByAPI(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/tagdescription.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apitagdescription.go similarity index 58% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/tagdescription.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apitagdescription.go index 8c0a5e815844..fcfaa5b38809 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/tagdescription.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apitagdescription.go @@ -26,20 +26,21 @@ import ( "net/http" ) -// TagDescriptionClient is the apiManagement Client -type TagDescriptionClient struct { +// APITagDescriptionClient is the apiManagement Client +type APITagDescriptionClient struct { BaseClient } -// NewTagDescriptionClient creates an instance of the TagDescriptionClient client. -func NewTagDescriptionClient(subscriptionID string) TagDescriptionClient { - return NewTagDescriptionClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewAPITagDescriptionClient creates an instance of the APITagDescriptionClient client. +func NewAPITagDescriptionClient(subscriptionID string) APITagDescriptionClient { + return NewAPITagDescriptionClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewTagDescriptionClientWithBaseURI creates an instance of the TagDescriptionClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewTagDescriptionClientWithBaseURI(baseURI string, subscriptionID string) TagDescriptionClient { - return TagDescriptionClient{NewWithBaseURI(baseURI, subscriptionID)} +// NewAPITagDescriptionClientWithBaseURI creates an instance of the APITagDescriptionClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewAPITagDescriptionClientWithBaseURI(baseURI string, subscriptionID string) APITagDescriptionClient { + return APITagDescriptionClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate create/Update tag description in scope of the Api. @@ -48,12 +49,13 @@ func NewTagDescriptionClientWithBaseURI(baseURI string, subscriptionID string) T // serviceName - the name of the API Management service. // apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current // revision has ;rev=n as a suffix where n is the revision number. -// tagID - tag identifier. Must be unique in the current API Management service instance. +// tagDescriptionID - tag description identifier. Used when creating tagDescription for API/Tag association. +// Based on API and Tag names. // parameters - create parameters. // ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. -func (client TagDescriptionClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string, parameters TagDescriptionCreateParameters, ifMatch string) (result TagDescriptionContract, err error) { +func (client APITagDescriptionClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagDescriptionID string, parameters TagDescriptionCreateParameters, ifMatch string) (result TagDescriptionContract, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/TagDescriptionClient.CreateOrUpdate") + ctx = tracing.StartSpan(ctx, fqdn+"/APITagDescriptionClient.CreateOrUpdate") defer func() { sc := -1 if result.Response.Response != nil { @@ -71,50 +73,50 @@ func (client TagDescriptionClient) CreateOrUpdate(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, - {TargetValue: tagID, - Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: tagDescriptionID, + Constraints: []validation.Constraint{{Target: "tagDescriptionID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "tagDescriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "tagDescriptionID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.TagDescriptionBaseProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.TagDescriptionBaseProperties.ExternalDocsURL", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.TagDescriptionBaseProperties.ExternalDocsURL", Name: validation.MaxLength, Rule: 2000, Chain: nil}}}, }}}}}); err != nil { - return result, validation.NewError("apimanagement.TagDescriptionClient", "CreateOrUpdate", err.Error()) + return result, validation.NewError("apimanagement.APITagDescriptionClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, apiid, tagID, parameters, ifMatch) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, apiid, tagDescriptionID, parameters, ifMatch) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "CreateOrUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "apimanagement.APITagDescriptionClient", "CreateOrUpdate", nil, "Failure preparing request") return } resp, err := client.CreateOrUpdateSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "CreateOrUpdate", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "apimanagement.APITagDescriptionClient", "CreateOrUpdate", resp, "Failure sending request") return } result, err = client.CreateOrUpdateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "CreateOrUpdate", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "apimanagement.APITagDescriptionClient", "CreateOrUpdate", resp, "Failure responding to request") } return } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client TagDescriptionClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string, parameters TagDescriptionCreateParameters, ifMatch string) (*http.Request, error) { +func (client APITagDescriptionClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagDescriptionID string, parameters TagDescriptionCreateParameters, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "tagId": autorest.Encode("path", tagID), + "tagDescriptionId": autorest.Encode("path", tagDescriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -123,7 +125,7 @@ func (client TagDescriptionClient) CreateOrUpdatePreparer(ctx context.Context, r autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) if len(ifMatch) > 0 { @@ -135,13 +137,13 @@ func (client TagDescriptionClient) CreateOrUpdatePreparer(ctx context.Context, r // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. -func (client TagDescriptionClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { +func (client APITagDescriptionClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. -func (client TagDescriptionClient) CreateOrUpdateResponder(resp *http.Response) (result TagDescriptionContract, err error) { +func (client APITagDescriptionClient) CreateOrUpdateResponder(resp *http.Response) (result TagDescriptionContract, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -158,12 +160,13 @@ func (client TagDescriptionClient) CreateOrUpdateResponder(resp *http.Response) // serviceName - the name of the API Management service. // apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current // revision has ;rev=n as a suffix where n is the revision number. -// tagID - tag identifier. Must be unique in the current API Management service instance. +// tagDescriptionID - tag description identifier. Used when creating tagDescription for API/Tag association. +// Based on API and Tag names. // ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET // request or it should be * for unconditional update. -func (client TagDescriptionClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string, ifMatch string) (result autorest.Response, err error) { +func (client APITagDescriptionClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagDescriptionID string, ifMatch string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/TagDescriptionClient.Delete") + ctx = tracing.StartSpan(ctx, fqdn+"/APITagDescriptionClient.Delete") defer func() { sc := -1 if result.Response != nil { @@ -181,45 +184,45 @@ func (client TagDescriptionClient) Delete(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, - {TargetValue: tagID, - Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { - return result, validation.NewError("apimanagement.TagDescriptionClient", "Delete", err.Error()) + {TargetValue: tagDescriptionID, + Constraints: []validation.Constraint{{Target: "tagDescriptionID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "tagDescriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "tagDescriptionID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APITagDescriptionClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, apiid, tagID, ifMatch) + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, apiid, tagDescriptionID, ifMatch) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "Delete", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "apimanagement.APITagDescriptionClient", "Delete", nil, "Failure preparing request") return } resp, err := client.DeleteSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "Delete", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "apimanagement.APITagDescriptionClient", "Delete", resp, "Failure sending request") return } result, err = client.DeleteResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "Delete", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "apimanagement.APITagDescriptionClient", "Delete", resp, "Failure responding to request") } return } // DeletePreparer prepares the Delete request. -func (client TagDescriptionClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string, ifMatch string) (*http.Request, error) { +func (client APITagDescriptionClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagDescriptionID string, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "tagId": autorest.Encode("path", tagID), + "tagDescriptionId": autorest.Encode("path", tagDescriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -227,7 +230,7 @@ func (client TagDescriptionClient) DeletePreparer(ctx context.Context, resourceG preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}", pathParameters), autorest.WithQueryParameters(queryParameters), autorest.WithHeader("If-Match", autorest.String(ifMatch))) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -235,13 +238,13 @@ func (client TagDescriptionClient) DeletePreparer(ctx context.Context, resourceG // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. -func (client TagDescriptionClient) DeleteSender(req *http.Request) (*http.Response, error) { +func (client APITagDescriptionClient) DeleteSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // DeleteResponder handles the response to the Delete request. The method always // closes the http.Response Body. -func (client TagDescriptionClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { +func (client APITagDescriptionClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -251,16 +254,17 @@ func (client TagDescriptionClient) DeleteResponder(resp *http.Response) (result return } -// Get get tag associated with the API. +// Get get Tag description in scope of API // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current // revision has ;rev=n as a suffix where n is the revision number. -// tagID - tag identifier. Must be unique in the current API Management service instance. -func (client TagDescriptionClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string) (result TagDescriptionContract, err error) { +// tagDescriptionID - tag description identifier. Used when creating tagDescription for API/Tag association. +// Based on API and Tag names. +func (client APITagDescriptionClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagDescriptionID string) (result TagDescriptionContract, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/TagDescriptionClient.Get") + ctx = tracing.StartSpan(ctx, fqdn+"/APITagDescriptionClient.Get") defer func() { sc := -1 if result.Response.Response != nil { @@ -278,45 +282,45 @@ func (client TagDescriptionClient) Get(ctx context.Context, resourceGroupName st Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, - {TargetValue: tagID, - Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { - return result, validation.NewError("apimanagement.TagDescriptionClient", "Get", err.Error()) + {TargetValue: tagDescriptionID, + Constraints: []validation.Constraint{{Target: "tagDescriptionID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "tagDescriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "tagDescriptionID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APITagDescriptionClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, apiid, tagID) + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, apiid, tagDescriptionID) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "apimanagement.APITagDescriptionClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "apimanagement.APITagDescriptionClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "apimanagement.APITagDescriptionClient", "Get", resp, "Failure responding to request") } return } // GetPreparer prepares the Get request. -func (client TagDescriptionClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string) (*http.Request, error) { +func (client APITagDescriptionClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagDescriptionID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "tagId": autorest.Encode("path", tagID), + "tagDescriptionId": autorest.Encode("path", tagDescriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -324,20 +328,20 @@ func (client TagDescriptionClient) GetPreparer(ctx context.Context, resourceGrou preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. -func (client TagDescriptionClient) GetSender(req *http.Request) (*http.Response, error) { +func (client APITagDescriptionClient) GetSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client TagDescriptionClient) GetResponder(resp *http.Response) (result TagDescriptionContract, err error) { +func (client APITagDescriptionClient) GetResponder(resp *http.Response) (result TagDescriptionContract, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -348,16 +352,17 @@ func (client TagDescriptionClient) GetResponder(resp *http.Response) (result Tag return } -// GetEntityState gets the entity state version of the tag specified by its identifier. +// GetEntityTag gets the entity state version of the tag specified by its identifier. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current // revision has ;rev=n as a suffix where n is the revision number. -// tagID - tag identifier. Must be unique in the current API Management service instance. -func (client TagDescriptionClient) GetEntityState(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string) (result autorest.Response, err error) { +// tagDescriptionID - tag description identifier. Used when creating tagDescription for API/Tag association. +// Based on API and Tag names. +func (client APITagDescriptionClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagDescriptionID string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/TagDescriptionClient.GetEntityState") + ctx = tracing.StartSpan(ctx, fqdn+"/APITagDescriptionClient.GetEntityTag") defer func() { sc := -1 if result.Response != nil { @@ -375,45 +380,45 @@ func (client TagDescriptionClient) GetEntityState(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, - {TargetValue: tagID, - Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { - return result, validation.NewError("apimanagement.TagDescriptionClient", "GetEntityState", err.Error()) + {TargetValue: tagDescriptionID, + Constraints: []validation.Constraint{{Target: "tagDescriptionID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "tagDescriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "tagDescriptionID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APITagDescriptionClient", "GetEntityTag", err.Error()) } - req, err := client.GetEntityStatePreparer(ctx, resourceGroupName, serviceName, apiid, tagID) + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, apiid, tagDescriptionID) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "GetEntityState", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "apimanagement.APITagDescriptionClient", "GetEntityTag", nil, "Failure preparing request") return } - resp, err := client.GetEntityStateSender(req) + resp, err := client.GetEntityTagSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "GetEntityState", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "apimanagement.APITagDescriptionClient", "GetEntityTag", resp, "Failure sending request") return } - result, err = client.GetEntityStateResponder(resp) + result, err = client.GetEntityTagResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "GetEntityState", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "apimanagement.APITagDescriptionClient", "GetEntityTag", resp, "Failure responding to request") } return } -// GetEntityStatePreparer prepares the GetEntityState request. -func (client TagDescriptionClient) GetEntityStatePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string) (*http.Request, error) { +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client APITagDescriptionClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagDescriptionID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "tagId": autorest.Encode("path", tagID), + "tagDescriptionId": autorest.Encode("path", tagDescriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -421,20 +426,20 @@ func (client TagDescriptionClient) GetEntityStatePreparer(ctx context.Context, r preparer := autorest.CreatePreparer( autorest.AsHead(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetEntityStateSender sends the GetEntityState request. The method will close the +// GetEntityTagSender sends the GetEntityTag request. The method will close the // http.Response Body if it receives an error. -func (client TagDescriptionClient) GetEntityStateSender(req *http.Request) (*http.Response, error) { +func (client APITagDescriptionClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } -// GetEntityStateResponder handles the response to the GetEntityState request. The method always +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always // closes the http.Response Body. -func (client TagDescriptionClient) GetEntityStateResponder(resp *http.Response) (result autorest.Response, err error) { +func (client APITagDescriptionClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -444,22 +449,22 @@ func (client TagDescriptionClient) GetEntityStateResponder(resp *http.Response) return } -// ListByAPI lists all Tags descriptions in scope of API. Model similar to swagger - tagDescription is defined on API -// level but tag may be assigned to the Operations +// ListByService lists all Tags descriptions in scope of API. Model similar to swagger - tagDescription is defined on +// API level but tag may be assigned to the Operations // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current // revision has ;rev=n as a suffix where n is the revision number. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| displayName | filter | ge, le, eq, ne, +// gt, lt | substringof, contains, startswith, endswith |
| name | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. -func (client TagDescriptionClient) ListByAPI(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result TagDescriptionCollectionPage, err error) { +func (client APITagDescriptionClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result TagDescriptionCollectionPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/TagDescriptionClient.ListByAPI") + ctx = tracing.StartSpan(ctx, fqdn+"/APITagDescriptionClient.ListByService") defer func() { sc := -1 if result.tdc.Response.Response != nil { @@ -483,33 +488,33 @@ func (client TagDescriptionClient) ListByAPI(ctx context.Context, resourceGroupN {TargetValue: skip, Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil { - return result, validation.NewError("apimanagement.TagDescriptionClient", "ListByAPI", err.Error()) + return result, validation.NewError("apimanagement.APITagDescriptionClient", "ListByService", err.Error()) } - result.fn = client.listByAPINextResults - req, err := client.ListByAPIPreparer(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + result.fn = client.listByServiceNextResults + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "ListByAPI", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "apimanagement.APITagDescriptionClient", "ListByService", nil, "Failure preparing request") return } - resp, err := client.ListByAPISender(req) + resp, err := client.ListByServiceSender(req) if err != nil { result.tdc.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "ListByAPI", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "apimanagement.APITagDescriptionClient", "ListByService", resp, "Failure sending request") return } - result.tdc, err = client.ListByAPIResponder(resp) + result.tdc, err = client.ListByServiceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "ListByAPI", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "apimanagement.APITagDescriptionClient", "ListByService", resp, "Failure responding to request") } return } -// ListByAPIPreparer prepares the ListByAPI request. -func (client TagDescriptionClient) ListByAPIPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (*http.Request, error) { +// ListByServicePreparer prepares the ListByService request. +func (client APITagDescriptionClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -517,7 +522,7 @@ func (client TagDescriptionClient) ListByAPIPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -539,15 +544,15 @@ func (client TagDescriptionClient) ListByAPIPreparer(ctx context.Context, resour return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListByAPISender sends the ListByAPI request. The method will close the +// ListByServiceSender sends the ListByService request. The method will close the // http.Response Body if it receives an error. -func (client TagDescriptionClient) ListByAPISender(req *http.Request) (*http.Response, error) { +func (client APITagDescriptionClient) ListByServiceSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } -// ListByAPIResponder handles the response to the ListByAPI request. The method always +// ListByServiceResponder handles the response to the ListByService request. The method always // closes the http.Response Body. -func (client TagDescriptionClient) ListByAPIResponder(resp *http.Response) (result TagDescriptionCollection, err error) { +func (client APITagDescriptionClient) ListByServiceResponder(resp *http.Response) (result TagDescriptionCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -558,31 +563,31 @@ func (client TagDescriptionClient) ListByAPIResponder(resp *http.Response) (resu return } -// listByAPINextResults retrieves the next set of results, if any. -func (client TagDescriptionClient) listByAPINextResults(ctx context.Context, lastResults TagDescriptionCollection) (result TagDescriptionCollection, err error) { +// listByServiceNextResults retrieves the next set of results, if any. +func (client APITagDescriptionClient) listByServiceNextResults(ctx context.Context, lastResults TagDescriptionCollection) (result TagDescriptionCollection, err error) { req, err := lastResults.tagDescriptionCollectionPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "listByAPINextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "apimanagement.APITagDescriptionClient", "listByServiceNextResults", nil, "Failure preparing next results request") } if req == nil { return } - resp, err := client.ListByAPISender(req) + resp, err := client.ListByServiceSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "listByAPINextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "apimanagement.APITagDescriptionClient", "listByServiceNextResults", resp, "Failure sending next results request") } - result, err = client.ListByAPIResponder(resp) + result, err = client.ListByServiceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "listByAPINextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "apimanagement.APITagDescriptionClient", "listByServiceNextResults", resp, "Failure responding to next results request") } return } -// ListByAPIComplete enumerates all values, automatically crossing page boundaries as required. -func (client TagDescriptionClient) ListByAPIComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result TagDescriptionCollectionIterator, err error) { +// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client APITagDescriptionClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result TagDescriptionCollectionIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/TagDescriptionClient.ListByAPI") + ctx = tracing.StartSpan(ctx, fqdn+"/APITagDescriptionClient.ListByService") defer func() { sc := -1 if result.Response().Response.Response != nil { @@ -591,6 +596,6 @@ func (client TagDescriptionClient) ListByAPIComplete(ctx context.Context, resour tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByAPI(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apiversionset.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apiversionset.go similarity index 93% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apiversionset.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apiversionset.go index 5afde1fc2b99..8d23ba2ed0e3 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apiversionset.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apiversionset.go @@ -68,7 +68,7 @@ func (client APIVersionSetClient) CreateOrUpdate(ctx context.Context, resourceGr {TargetValue: versionSetID, Constraints: []validation.Constraint{{Target: "versionSetID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "versionSetID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "versionSetID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "versionSetID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.APIVersionSetContractProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.APIVersionSetContractProperties.DisplayName", Name: validation.Null, Rule: true, @@ -109,7 +109,7 @@ func (client APIVersionSetClient) CreateOrUpdatePreparer(ctx context.Context, re "versionSetId": autorest.Encode("path", versionSetID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -118,7 +118,7 @@ func (client APIVersionSetClient) CreateOrUpdatePreparer(ctx context.Context, re autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/api-version-sets/{versionSetId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) if len(ifMatch) > 0 { @@ -173,7 +173,7 @@ func (client APIVersionSetClient) Delete(ctx context.Context, resourceGroupName {TargetValue: versionSetID, Constraints: []validation.Constraint{{Target: "versionSetID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "versionSetID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "versionSetID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "versionSetID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIVersionSetClient", "Delete", err.Error()) } @@ -207,7 +207,7 @@ func (client APIVersionSetClient) DeletePreparer(ctx context.Context, resourceGr "versionSetId": autorest.Encode("path", versionSetID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -215,7 +215,7 @@ func (client APIVersionSetClient) DeletePreparer(ctx context.Context, resourceGr preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/api-version-sets/{versionSetId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}", pathParameters), autorest.WithQueryParameters(queryParameters), autorest.WithHeader("If-Match", autorest.String(ifMatch))) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -263,7 +263,7 @@ func (client APIVersionSetClient) Get(ctx context.Context, resourceGroupName str {TargetValue: versionSetID, Constraints: []validation.Constraint{{Target: "versionSetID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "versionSetID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "versionSetID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "versionSetID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIVersionSetClient", "Get", err.Error()) } @@ -297,7 +297,7 @@ func (client APIVersionSetClient) GetPreparer(ctx context.Context, resourceGroup "versionSetId": autorest.Encode("path", versionSetID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -305,7 +305,7 @@ func (client APIVersionSetClient) GetPreparer(ctx context.Context, resourceGroup preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/api-version-sets/{versionSetId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -353,7 +353,7 @@ func (client APIVersionSetClient) GetEntityTag(ctx context.Context, resourceGrou {TargetValue: versionSetID, Constraints: []validation.Constraint{{Target: "versionSetID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "versionSetID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "versionSetID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "versionSetID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIVersionSetClient", "GetEntityTag", err.Error()) } @@ -387,7 +387,7 @@ func (client APIVersionSetClient) GetEntityTagPreparer(ctx context.Context, reso "versionSetId": autorest.Encode("path", versionSetID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -395,7 +395,7 @@ func (client APIVersionSetClient) GetEntityTagPreparer(ctx context.Context, reso preparer := autorest.CreatePreparer( autorest.AsHead(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/api-version-sets/{versionSetId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -422,15 +422,8 @@ func (client APIVersionSetClient) GetEntityTagResponder(resp *http.Response) (re // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - | Field | Supported operators | Supported functions | -// |------------------|------------------------|-----------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | firstName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | lastName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | email | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | state | eq | N/A | -// | registrationDate | ge, le, eq, ne, gt, lt | N/A | -// | note | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
// top - number of records to return. // skip - number of records to skip. func (client APIVersionSetClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result APIVersionSetCollectionPage, err error) { @@ -488,7 +481,7 @@ func (client APIVersionSetClient) ListByServicePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -505,7 +498,7 @@ func (client APIVersionSetClient) ListByServicePreparer(ctx context.Context, res preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/api-version-sets", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -593,7 +586,7 @@ func (client APIVersionSetClient) Update(ctx context.Context, resourceGroupName {TargetValue: versionSetID, Constraints: []validation.Constraint{{Target: "versionSetID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "versionSetID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "versionSetID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "versionSetID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIVersionSetClient", "Update", err.Error()) } @@ -627,7 +620,7 @@ func (client APIVersionSetClient) UpdatePreparer(ctx context.Context, resourceGr "versionSetId": autorest.Encode("path", versionSetID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -636,7 +629,7 @@ func (client APIVersionSetClient) UpdatePreparer(ctx context.Context, resourceGr autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/api-version-sets/{versionSetId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters), autorest.WithHeader("If-Match", autorest.String(ifMatch))) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/authorizationserver.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/authorizationserver.go similarity index 85% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/authorizationserver.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/authorizationserver.go index 26ed84a7f589..a540e7f823c5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/authorizationserver.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/authorizationserver.go @@ -69,7 +69,7 @@ func (client AuthorizationServerClient) CreateOrUpdate(ctx context.Context, reso {TargetValue: authsid, Constraints: []validation.Constraint{{Target: "authsid", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "authsid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "authsid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "authsid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.AuthorizationServerContractProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.AuthorizationServerContractProperties.DisplayName", Name: validation.Null, Rule: true, @@ -114,7 +114,7 @@ func (client AuthorizationServerClient) CreateOrUpdatePreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -178,7 +178,7 @@ func (client AuthorizationServerClient) Delete(ctx context.Context, resourceGrou {TargetValue: authsid, Constraints: []validation.Constraint{{Target: "authsid", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "authsid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "authsid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "authsid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.AuthorizationServerClient", "Delete", err.Error()) } @@ -212,7 +212,7 @@ func (client AuthorizationServerClient) DeletePreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -268,7 +268,7 @@ func (client AuthorizationServerClient) Get(ctx context.Context, resourceGroupNa {TargetValue: authsid, Constraints: []validation.Constraint{{Target: "authsid", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "authsid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "authsid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "authsid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.AuthorizationServerClient", "Get", err.Error()) } @@ -302,7 +302,7 @@ func (client AuthorizationServerClient) GetPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -358,7 +358,7 @@ func (client AuthorizationServerClient) GetEntityTag(ctx context.Context, resour {TargetValue: authsid, Constraints: []validation.Constraint{{Target: "authsid", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "authsid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "authsid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "authsid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.AuthorizationServerClient", "GetEntityTag", err.Error()) } @@ -392,7 +392,7 @@ func (client AuthorizationServerClient) GetEntityTagPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -427,10 +427,10 @@ func (client AuthorizationServerClient) GetEntityTagResponder(resp *http.Respons // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - | Field | Supported operators | Supported functions | -// |-------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. func (client AuthorizationServerClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result AuthorizationServerCollectionPage, err error) { @@ -488,7 +488,7 @@ func (client AuthorizationServerClient) ListByServicePreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -566,6 +566,96 @@ func (client AuthorizationServerClient) ListByServiceComplete(ctx context.Contex return } +// ListSecrets gets the client secret details of the authorization server. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// authsid - identifier of the authorization server. +func (client AuthorizationServerClient) ListSecrets(ctx context.Context, resourceGroupName string, serviceName string, authsid string) (result ClientSecretContract, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationServerClient.ListSecrets") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: authsid, + Constraints: []validation.Constraint{{Target: "authsid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "authsid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "authsid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.AuthorizationServerClient", "ListSecrets", err.Error()) + } + + req, err := client.ListSecretsPreparer(ctx, resourceGroupName, serviceName, authsid) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.AuthorizationServerClient", "ListSecrets", nil, "Failure preparing request") + return + } + + resp, err := client.ListSecretsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.AuthorizationServerClient", "ListSecrets", resp, "Failure sending request") + return + } + + result, err = client.ListSecretsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.AuthorizationServerClient", "ListSecrets", resp, "Failure responding to request") + } + + return +} + +// ListSecretsPreparer prepares the ListSecrets request. +func (client AuthorizationServerClient) ListSecretsPreparer(ctx context.Context, resourceGroupName string, serviceName string, authsid string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "authsid": autorest.Encode("path", authsid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}/listSecrets", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSecretsSender sends the ListSecrets request. The method will close the +// http.Response Body if it receives an error. +func (client AuthorizationServerClient) ListSecretsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSecretsResponder handles the response to the ListSecrets request. The method always +// closes the http.Response Body. +func (client AuthorizationServerClient) ListSecretsResponder(resp *http.Response) (result ClientSecretContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // Update updates the details of the authorization server specified by its identifier. // Parameters: // resourceGroupName - the name of the resource group. @@ -593,7 +683,7 @@ func (client AuthorizationServerClient) Update(ctx context.Context, resourceGrou {TargetValue: authsid, Constraints: []validation.Constraint{{Target: "authsid", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "authsid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "authsid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "authsid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.AuthorizationServerClient", "Update", err.Error()) } @@ -627,7 +717,7 @@ func (client AuthorizationServerClient) UpdatePreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/backend.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/backend.go similarity index 87% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/backend.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/backend.go index d9ed0c518d54..29a9e9516674 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/backend.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/backend.go @@ -46,10 +46,10 @@ func NewBackendClientWithBaseURI(baseURI string, subscriptionID string) BackendC // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// backendid - identifier of the Backend entity. Must be unique in the current API Management service instance. +// backendID - identifier of the Backend entity. Must be unique in the current API Management service instance. // parameters - create parameters. // ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. -func (client BackendClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, backendid string, parameters BackendContract, ifMatch string) (result BackendContract, err error) { +func (client BackendClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, backendID string, parameters BackendContract, ifMatch string) (result BackendContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/BackendClient.CreateOrUpdate") defer func() { @@ -65,10 +65,9 @@ func (client BackendClient) CreateOrUpdate(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: backendid, - Constraints: []validation.Constraint{{Target: "backendid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "backendid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "backendid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: backendID, + Constraints: []validation.Constraint{{Target: "backendID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "backendID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.BackendContractProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.BackendContractProperties.URL", Name: validation.Null, Rule: true, @@ -79,7 +78,7 @@ func (client BackendClient) CreateOrUpdate(ctx context.Context, resourceGroupNam return result, validation.NewError("apimanagement.BackendClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, backendid, parameters, ifMatch) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, backendID, parameters, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.BackendClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -101,15 +100,15 @@ func (client BackendClient) CreateOrUpdate(ctx context.Context, resourceGroupNam } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client BackendClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, backendid string, parameters BackendContract, ifMatch string) (*http.Request, error) { +func (client BackendClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, backendID string, parameters BackendContract, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "backendid": autorest.Encode("path", backendid), + "backendId": autorest.Encode("path", backendID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -118,7 +117,7 @@ func (client BackendClient) CreateOrUpdatePreparer(ctx context.Context, resource autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) if len(ifMatch) > 0 { @@ -151,10 +150,10 @@ func (client BackendClient) CreateOrUpdateResponder(resp *http.Response) (result // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// backendid - identifier of the Backend entity. Must be unique in the current API Management service instance. +// backendID - identifier of the Backend entity. Must be unique in the current API Management service instance. // ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET // request or it should be * for unconditional update. -func (client BackendClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, backendid string, ifMatch string) (result autorest.Response, err error) { +func (client BackendClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, backendID string, ifMatch string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/BackendClient.Delete") defer func() { @@ -170,14 +169,13 @@ func (client BackendClient) Delete(ctx context.Context, resourceGroupName string Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: backendid, - Constraints: []validation.Constraint{{Target: "backendid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "backendid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "backendid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {TargetValue: backendID, + Constraints: []validation.Constraint{{Target: "backendID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "backendID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.BackendClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, backendid, ifMatch) + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, backendID, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.BackendClient", "Delete", nil, "Failure preparing request") return @@ -199,15 +197,15 @@ func (client BackendClient) Delete(ctx context.Context, resourceGroupName string } // DeletePreparer prepares the Delete request. -func (client BackendClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, backendid string, ifMatch string) (*http.Request, error) { +func (client BackendClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, backendID string, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "backendid": autorest.Encode("path", backendid), + "backendId": autorest.Encode("path", backendID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -215,7 +213,7 @@ func (client BackendClient) DeletePreparer(ctx context.Context, resourceGroupNam preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}", pathParameters), autorest.WithQueryParameters(queryParameters), autorest.WithHeader("If-Match", autorest.String(ifMatch))) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -243,8 +241,8 @@ func (client BackendClient) DeleteResponder(resp *http.Response) (result autores // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// backendid - identifier of the Backend entity. Must be unique in the current API Management service instance. -func (client BackendClient) Get(ctx context.Context, resourceGroupName string, serviceName string, backendid string) (result BackendContract, err error) { +// backendID - identifier of the Backend entity. Must be unique in the current API Management service instance. +func (client BackendClient) Get(ctx context.Context, resourceGroupName string, serviceName string, backendID string) (result BackendContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/BackendClient.Get") defer func() { @@ -260,14 +258,13 @@ func (client BackendClient) Get(ctx context.Context, resourceGroupName string, s Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: backendid, - Constraints: []validation.Constraint{{Target: "backendid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "backendid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "backendid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {TargetValue: backendID, + Constraints: []validation.Constraint{{Target: "backendID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "backendID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.BackendClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, backendid) + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, backendID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.BackendClient", "Get", nil, "Failure preparing request") return @@ -289,15 +286,15 @@ func (client BackendClient) Get(ctx context.Context, resourceGroupName string, s } // GetPreparer prepares the Get request. -func (client BackendClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, backendid string) (*http.Request, error) { +func (client BackendClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, backendID string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "backendid": autorest.Encode("path", backendid), + "backendId": autorest.Encode("path", backendID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -305,7 +302,7 @@ func (client BackendClient) GetPreparer(ctx context.Context, resourceGroupName s preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -333,8 +330,8 @@ func (client BackendClient) GetResponder(resp *http.Response) (result BackendCon // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// backendid - identifier of the Backend entity. Must be unique in the current API Management service instance. -func (client BackendClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, backendid string) (result autorest.Response, err error) { +// backendID - identifier of the Backend entity. Must be unique in the current API Management service instance. +func (client BackendClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, backendID string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/BackendClient.GetEntityTag") defer func() { @@ -350,14 +347,13 @@ func (client BackendClient) GetEntityTag(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: backendid, - Constraints: []validation.Constraint{{Target: "backendid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "backendid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "backendid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {TargetValue: backendID, + Constraints: []validation.Constraint{{Target: "backendID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "backendID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.BackendClient", "GetEntityTag", err.Error()) } - req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, backendid) + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, backendID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.BackendClient", "GetEntityTag", nil, "Failure preparing request") return @@ -379,15 +375,15 @@ func (client BackendClient) GetEntityTag(ctx context.Context, resourceGroupName } // GetEntityTagPreparer prepares the GetEntityTag request. -func (client BackendClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, backendid string) (*http.Request, error) { +func (client BackendClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, backendID string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "backendid": autorest.Encode("path", backendid), + "backendId": autorest.Encode("path", backendID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -395,7 +391,7 @@ func (client BackendClient) GetEntityTagPreparer(ctx context.Context, resourceGr preparer := autorest.CreatePreparer( autorest.AsHead(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -422,10 +418,11 @@ func (client BackendClient) GetEntityTagResponder(resp *http.Response) (result a // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - | Field | Supported operators | Supported functions | -// |-------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | host | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| title | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| url | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. func (client BackendClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result BackendCollectionPage, err error) { @@ -483,7 +480,7 @@ func (client BackendClient) ListByServicePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -566,9 +563,9 @@ func (client BackendClient) ListByServiceComplete(ctx context.Context, resourceG // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// backendid - identifier of the Backend entity. Must be unique in the current API Management service instance. +// backendID - identifier of the Backend entity. Must be unique in the current API Management service instance. // parameters - reconnect request parameters. -func (client BackendClient) Reconnect(ctx context.Context, resourceGroupName string, serviceName string, backendid string, parameters *BackendReconnectContract) (result autorest.Response, err error) { +func (client BackendClient) Reconnect(ctx context.Context, resourceGroupName string, serviceName string, backendID string, parameters *BackendReconnectContract) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/BackendClient.Reconnect") defer func() { @@ -584,14 +581,13 @@ func (client BackendClient) Reconnect(ctx context.Context, resourceGroupName str Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: backendid, - Constraints: []validation.Constraint{{Target: "backendid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "backendid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "backendid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {TargetValue: backendID, + Constraints: []validation.Constraint{{Target: "backendID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "backendID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.BackendClient", "Reconnect", err.Error()) } - req, err := client.ReconnectPreparer(ctx, resourceGroupName, serviceName, backendid, parameters) + req, err := client.ReconnectPreparer(ctx, resourceGroupName, serviceName, backendID, parameters) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.BackendClient", "Reconnect", nil, "Failure preparing request") return @@ -613,15 +609,15 @@ func (client BackendClient) Reconnect(ctx context.Context, resourceGroupName str } // ReconnectPreparer prepares the Reconnect request. -func (client BackendClient) ReconnectPreparer(ctx context.Context, resourceGroupName string, serviceName string, backendid string, parameters *BackendReconnectContract) (*http.Request, error) { +func (client BackendClient) ReconnectPreparer(ctx context.Context, resourceGroupName string, serviceName string, backendID string, parameters *BackendReconnectContract) (*http.Request, error) { pathParameters := map[string]interface{}{ - "backendid": autorest.Encode("path", backendid), + "backendId": autorest.Encode("path", backendID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -630,7 +626,7 @@ func (client BackendClient) ReconnectPreparer(ctx context.Context, resourceGroup autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendid}/reconnect", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}/reconnect", pathParameters), autorest.WithQueryParameters(queryParameters)) if parameters != nil { preparer = autorest.DecoratePreparer(preparer, @@ -661,11 +657,11 @@ func (client BackendClient) ReconnectResponder(resp *http.Response) (result auto // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// backendid - identifier of the Backend entity. Must be unique in the current API Management service instance. +// backendID - identifier of the Backend entity. Must be unique in the current API Management service instance. // parameters - update parameters. // ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET // request or it should be * for unconditional update. -func (client BackendClient) Update(ctx context.Context, resourceGroupName string, serviceName string, backendid string, parameters BackendUpdateParameters, ifMatch string) (result autorest.Response, err error) { +func (client BackendClient) Update(ctx context.Context, resourceGroupName string, serviceName string, backendID string, parameters BackendUpdateParameters, ifMatch string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/BackendClient.Update") defer func() { @@ -681,14 +677,13 @@ func (client BackendClient) Update(ctx context.Context, resourceGroupName string Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: backendid, - Constraints: []validation.Constraint{{Target: "backendid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "backendid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "backendid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {TargetValue: backendID, + Constraints: []validation.Constraint{{Target: "backendID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "backendID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.BackendClient", "Update", err.Error()) } - req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, backendid, parameters, ifMatch) + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, backendID, parameters, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.BackendClient", "Update", nil, "Failure preparing request") return @@ -710,15 +705,15 @@ func (client BackendClient) Update(ctx context.Context, resourceGroupName string } // UpdatePreparer prepares the Update request. -func (client BackendClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, backendid string, parameters BackendUpdateParameters, ifMatch string) (*http.Request, error) { +func (client BackendClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, backendID string, parameters BackendUpdateParameters, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "backendid": autorest.Encode("path", backendid), + "backendId": autorest.Encode("path", backendID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -727,7 +722,7 @@ func (client BackendClient) UpdatePreparer(ctx context.Context, resourceGroupNam autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters), autorest.WithHeader("If-Match", autorest.String(ifMatch))) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/property.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/cache.go similarity index 57% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/property.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/cache.go index a8a07ce20791..f35d07a154ab 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/property.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/cache.go @@ -26,32 +26,33 @@ import ( "net/http" ) -// PropertyClient is the apiManagement Client -type PropertyClient struct { +// CacheClient is the apiManagement Client +type CacheClient struct { BaseClient } -// NewPropertyClient creates an instance of the PropertyClient client. -func NewPropertyClient(subscriptionID string) PropertyClient { - return NewPropertyClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewCacheClient creates an instance of the CacheClient client. +func NewCacheClient(subscriptionID string) CacheClient { + return NewCacheClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewPropertyClientWithBaseURI creates an instance of the PropertyClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewPropertyClientWithBaseURI(baseURI string, subscriptionID string) PropertyClient { - return PropertyClient{NewWithBaseURI(baseURI, subscriptionID)} +// NewCacheClientWithBaseURI creates an instance of the CacheClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewCacheClientWithBaseURI(baseURI string, subscriptionID string) CacheClient { + return CacheClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate creates or updates a property. +// CreateOrUpdate creates or updates an External Cache to be used in Api Management instance. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// propID - identifier of the property. -// parameters - create parameters. +// cacheID - identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region +// identifier). +// parameters - create or Update parameters. // ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. -func (client PropertyClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, propID string, parameters PropertyContract, ifMatch string) (result PropertyContract, err error) { +func (client CacheClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, cacheID string, parameters CacheContract, ifMatch string) (result CacheContract, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PropertyClient.CreateOrUpdate") + ctx = tracing.StartSpan(ctx, fqdn+"/CacheClient.CreateOrUpdate") defer func() { sc := -1 if result.Response.Response != nil { @@ -65,55 +66,53 @@ func (client PropertyClient) CreateOrUpdate(ctx context.Context, resourceGroupNa Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: propID, - Constraints: []validation.Constraint{{Target: "propID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "propID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: cacheID, + Constraints: []validation.Constraint{{Target: "cacheID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "cacheID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "cacheID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.PropertyContractProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.PropertyContractProperties.DisplayName", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.PropertyContractProperties.DisplayName", Name: validation.MaxLength, Rule: 256, Chain: nil}, - {Target: "parameters.PropertyContractProperties.DisplayName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "parameters.PropertyContractProperties.DisplayName", Name: validation.Pattern, Rule: `^[A-Za-z0-9-._]+$`, Chain: nil}, - }}, - {Target: "parameters.PropertyContractProperties.Value", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.PropertyContractProperties.Value", Name: validation.MaxLength, Rule: 4096, Chain: nil}, - {Target: "parameters.PropertyContractProperties.Value", Name: validation.MinLength, Rule: 1, Chain: nil}, - }}, + Constraints: []validation.Constraint{{Target: "parameters.CacheContractProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.CacheContractProperties.Description", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.CacheContractProperties.Description", Name: validation.MaxLength, Rule: 2000, Chain: nil}}}, + {Target: "parameters.CacheContractProperties.ConnectionString", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.CacheContractProperties.ConnectionString", Name: validation.MaxLength, Rule: 300, Chain: nil}}}, + {Target: "parameters.CacheContractProperties.ResourceID", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.CacheContractProperties.ResourceID", Name: validation.MaxLength, Rule: 2000, Chain: nil}}}, }}}}}); err != nil { - return result, validation.NewError("apimanagement.PropertyClient", "CreateOrUpdate", err.Error()) + return result, validation.NewError("apimanagement.CacheClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, propID, parameters, ifMatch) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, cacheID, parameters, ifMatch) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "CreateOrUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "apimanagement.CacheClient", "CreateOrUpdate", nil, "Failure preparing request") return } resp, err := client.CreateOrUpdateSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "CreateOrUpdate", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "apimanagement.CacheClient", "CreateOrUpdate", resp, "Failure sending request") return } result, err = client.CreateOrUpdateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "CreateOrUpdate", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "apimanagement.CacheClient", "CreateOrUpdate", resp, "Failure responding to request") } return } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client PropertyClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, propID string, parameters PropertyContract, ifMatch string) (*http.Request, error) { +func (client CacheClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, cacheID string, parameters CacheContract, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "propId": autorest.Encode("path", propID), + "cacheId": autorest.Encode("path", cacheID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -122,7 +121,7 @@ func (client PropertyClient) CreateOrUpdatePreparer(ctx context.Context, resourc autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties/{propId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) if len(ifMatch) > 0 { @@ -134,13 +133,13 @@ func (client PropertyClient) CreateOrUpdatePreparer(ctx context.Context, resourc // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. -func (client PropertyClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { +func (client CacheClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. -func (client PropertyClient) CreateOrUpdateResponder(resp *http.Response) (result PropertyContract, err error) { +func (client CacheClient) CreateOrUpdateResponder(resp *http.Response) (result CacheContract, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -151,16 +150,17 @@ func (client PropertyClient) CreateOrUpdateResponder(resp *http.Response) (resul return } -// Delete deletes specific property from the API Management service instance. +// Delete deletes specific Cache. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// propID - identifier of the property. +// cacheID - identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region +// identifier). // ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET // request or it should be * for unconditional update. -func (client PropertyClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, propID string, ifMatch string) (result autorest.Response, err error) { +func (client CacheClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, cacheID string, ifMatch string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PropertyClient.Delete") + ctx = tracing.StartSpan(ctx, fqdn+"/CacheClient.Delete") defer func() { sc := -1 if result.Response != nil { @@ -174,43 +174,44 @@ func (client PropertyClient) Delete(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: propID, - Constraints: []validation.Constraint{{Target: "propID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "propID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { - return result, validation.NewError("apimanagement.PropertyClient", "Delete", err.Error()) + {TargetValue: cacheID, + Constraints: []validation.Constraint{{Target: "cacheID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "cacheID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "cacheID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.CacheClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, propID, ifMatch) + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, cacheID, ifMatch) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "Delete", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "apimanagement.CacheClient", "Delete", nil, "Failure preparing request") return } resp, err := client.DeleteSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "Delete", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "apimanagement.CacheClient", "Delete", resp, "Failure sending request") return } result, err = client.DeleteResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "Delete", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "apimanagement.CacheClient", "Delete", resp, "Failure responding to request") } return } // DeletePreparer prepares the Delete request. -func (client PropertyClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, propID string, ifMatch string) (*http.Request, error) { +func (client CacheClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, cacheID string, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "propId": autorest.Encode("path", propID), + "cacheId": autorest.Encode("path", cacheID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -218,7 +219,7 @@ func (client PropertyClient) DeletePreparer(ctx context.Context, resourceGroupNa preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties/{propId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}", pathParameters), autorest.WithQueryParameters(queryParameters), autorest.WithHeader("If-Match", autorest.String(ifMatch))) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -226,13 +227,13 @@ func (client PropertyClient) DeletePreparer(ctx context.Context, resourceGroupNa // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. -func (client PropertyClient) DeleteSender(req *http.Request) (*http.Response, error) { +func (client CacheClient) DeleteSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // DeleteResponder handles the response to the Delete request. The method always // closes the http.Response Body. -func (client PropertyClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { +func (client CacheClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -242,14 +243,15 @@ func (client PropertyClient) DeleteResponder(resp *http.Response) (result autore return } -// Get gets the details of the property specified by its identifier. +// Get gets the details of the Cache specified by its identifier. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// propID - identifier of the property. -func (client PropertyClient) Get(ctx context.Context, resourceGroupName string, serviceName string, propID string) (result PropertyContract, err error) { +// cacheID - identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region +// identifier). +func (client CacheClient) Get(ctx context.Context, resourceGroupName string, serviceName string, cacheID string) (result CacheContract, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PropertyClient.Get") + ctx = tracing.StartSpan(ctx, fqdn+"/CacheClient.Get") defer func() { sc := -1 if result.Response.Response != nil { @@ -263,43 +265,44 @@ func (client PropertyClient) Get(ctx context.Context, resourceGroupName string, Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: propID, - Constraints: []validation.Constraint{{Target: "propID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "propID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { - return result, validation.NewError("apimanagement.PropertyClient", "Get", err.Error()) + {TargetValue: cacheID, + Constraints: []validation.Constraint{{Target: "cacheID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "cacheID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "cacheID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.CacheClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, propID) + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, cacheID) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "apimanagement.CacheClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "apimanagement.CacheClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "apimanagement.CacheClient", "Get", resp, "Failure responding to request") } return } // GetPreparer prepares the Get request. -func (client PropertyClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, propID string) (*http.Request, error) { +func (client CacheClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, cacheID string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "propId": autorest.Encode("path", propID), + "cacheId": autorest.Encode("path", cacheID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -307,20 +310,20 @@ func (client PropertyClient) GetPreparer(ctx context.Context, resourceGroupName preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties/{propId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. -func (client PropertyClient) GetSender(req *http.Request) (*http.Response, error) { +func (client CacheClient) GetSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client PropertyClient) GetResponder(resp *http.Response) (result PropertyContract, err error) { +func (client CacheClient) GetResponder(resp *http.Response) (result CacheContract, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -331,14 +334,15 @@ func (client PropertyClient) GetResponder(resp *http.Response) (result PropertyC return } -// GetEntityTag gets the entity state (Etag) version of the property specified by its identifier. +// GetEntityTag gets the entity state (Etag) version of the Cache specified by its identifier. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// propID - identifier of the property. -func (client PropertyClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, propID string) (result autorest.Response, err error) { +// cacheID - identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region +// identifier). +func (client CacheClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, cacheID string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PropertyClient.GetEntityTag") + ctx = tracing.StartSpan(ctx, fqdn+"/CacheClient.GetEntityTag") defer func() { sc := -1 if result.Response != nil { @@ -352,43 +356,44 @@ func (client PropertyClient) GetEntityTag(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: propID, - Constraints: []validation.Constraint{{Target: "propID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "propID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { - return result, validation.NewError("apimanagement.PropertyClient", "GetEntityTag", err.Error()) + {TargetValue: cacheID, + Constraints: []validation.Constraint{{Target: "cacheID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "cacheID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "cacheID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.CacheClient", "GetEntityTag", err.Error()) } - req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, propID) + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, cacheID) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "GetEntityTag", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "apimanagement.CacheClient", "GetEntityTag", nil, "Failure preparing request") return } resp, err := client.GetEntityTagSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "GetEntityTag", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "apimanagement.CacheClient", "GetEntityTag", resp, "Failure sending request") return } result, err = client.GetEntityTagResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "GetEntityTag", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "apimanagement.CacheClient", "GetEntityTag", resp, "Failure responding to request") } return } // GetEntityTagPreparer prepares the GetEntityTag request. -func (client PropertyClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, propID string) (*http.Request, error) { +func (client CacheClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, cacheID string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "propId": autorest.Encode("path", propID), + "cacheId": autorest.Encode("path", cacheID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -396,20 +401,20 @@ func (client PropertyClient) GetEntityTagPreparer(ctx context.Context, resourceG preparer := autorest.CreatePreparer( autorest.AsHead(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties/{propId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // GetEntityTagSender sends the GetEntityTag request. The method will close the // http.Response Body if it receives an error. -func (client PropertyClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { +func (client CacheClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetEntityTagResponder handles the response to the GetEntityTag request. The method always // closes the http.Response Body. -func (client PropertyClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { +func (client CacheClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -419,23 +424,19 @@ func (client PropertyClient) GetEntityTagResponder(resp *http.Response) (result return } -// ListByService lists a collection of properties defined within a service instance. +// ListByService lists a collection of all external Caches in the specified service instance. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - | Field | Supported operators | Supported functions | -// |-------|------------------------|-------------------------------------------------------| -// | tags | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith, any, all | -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | // top - number of records to return. // skip - number of records to skip. -func (client PropertyClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result PropertyCollectionPage, err error) { +func (client CacheClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, top *int32, skip *int32) (result CacheCollectionPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PropertyClient.ListByService") + ctx = tracing.StartSpan(ctx, fqdn+"/CacheClient.ListByService") defer func() { sc := -1 - if result.pc.Response.Response != nil { - sc = result.pc.Response.Response.StatusCode + if result.cc.Response.Response != nil { + sc = result.cc.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -451,46 +452,43 @@ func (client PropertyClient) ListByService(ctx context.Context, resourceGroupNam {TargetValue: skip, Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil { - return result, validation.NewError("apimanagement.PropertyClient", "ListByService", err.Error()) + return result, validation.NewError("apimanagement.CacheClient", "ListByService", err.Error()) } result.fn = client.listByServiceNextResults - req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, top, skip) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "ListByService", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "apimanagement.CacheClient", "ListByService", nil, "Failure preparing request") return } resp, err := client.ListByServiceSender(req) if err != nil { - result.pc.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "ListByService", resp, "Failure sending request") + result.cc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.CacheClient", "ListByService", resp, "Failure sending request") return } - result.pc, err = client.ListByServiceResponder(resp) + result.cc, err = client.ListByServiceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "ListByService", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "apimanagement.CacheClient", "ListByService", resp, "Failure responding to request") } return } // ListByServicePreparer prepares the ListByService request. -func (client PropertyClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { +func (client CacheClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, top *int32, skip *int32) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } if top != nil { queryParameters["$top"] = autorest.Encode("query", *top) } @@ -501,20 +499,20 @@ func (client PropertyClient) ListByServicePreparer(ctx context.Context, resource preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // ListByServiceSender sends the ListByService request. The method will close the // http.Response Body if it receives an error. -func (client PropertyClient) ListByServiceSender(req *http.Request) (*http.Response, error) { +func (client CacheClient) ListByServiceSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByServiceResponder handles the response to the ListByService request. The method always // closes the http.Response Body. -func (client PropertyClient) ListByServiceResponder(resp *http.Response) (result PropertyCollection, err error) { +func (client CacheClient) ListByServiceResponder(resp *http.Response) (result CacheCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -526,10 +524,10 @@ func (client PropertyClient) ListByServiceResponder(resp *http.Response) (result } // listByServiceNextResults retrieves the next set of results, if any. -func (client PropertyClient) listByServiceNextResults(ctx context.Context, lastResults PropertyCollection) (result PropertyCollection, err error) { - req, err := lastResults.propertyCollectionPreparer(ctx) +func (client CacheClient) listByServiceNextResults(ctx context.Context, lastResults CacheCollection) (result CacheCollection, err error) { + req, err := lastResults.cacheCollectionPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "listByServiceNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "apimanagement.CacheClient", "listByServiceNextResults", nil, "Failure preparing next results request") } if req == nil { return @@ -537,19 +535,19 @@ func (client PropertyClient) listByServiceNextResults(ctx context.Context, lastR resp, err := client.ListByServiceSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "listByServiceNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "apimanagement.CacheClient", "listByServiceNextResults", resp, "Failure sending next results request") } result, err = client.ListByServiceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "listByServiceNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "apimanagement.CacheClient", "listByServiceNextResults", resp, "Failure responding to next results request") } return } // ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. -func (client PropertyClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result PropertyCollectionIterator, err error) { +func (client CacheClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, top *int32, skip *int32) (result CacheCollectionIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PropertyClient.ListByService") + ctx = tracing.StartSpan(ctx, fqdn+"/CacheClient.ListByService") defer func() { sc := -1 if result.Response().Response.Response != nil { @@ -558,21 +556,22 @@ func (client PropertyClient) ListByServiceComplete(ctx context.Context, resource tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip) + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, top, skip) return } -// Update updates the specific property. +// Update updates the details of the cache specified by its identifier. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// propID - identifier of the property. +// cacheID - identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region +// identifier). // parameters - update parameters. // ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET // request or it should be * for unconditional update. -func (client PropertyClient) Update(ctx context.Context, resourceGroupName string, serviceName string, propID string, parameters PropertyUpdateParameters, ifMatch string) (result autorest.Response, err error) { +func (client CacheClient) Update(ctx context.Context, resourceGroupName string, serviceName string, cacheID string, parameters CacheUpdateParameters, ifMatch string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PropertyClient.Update") + ctx = tracing.StartSpan(ctx, fqdn+"/CacheClient.Update") defer func() { sc := -1 if result.Response != nil { @@ -586,43 +585,44 @@ func (client PropertyClient) Update(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: propID, - Constraints: []validation.Constraint{{Target: "propID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "propID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { - return result, validation.NewError("apimanagement.PropertyClient", "Update", err.Error()) + {TargetValue: cacheID, + Constraints: []validation.Constraint{{Target: "cacheID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "cacheID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "cacheID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.CacheClient", "Update", err.Error()) } - req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, propID, parameters, ifMatch) + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, cacheID, parameters, ifMatch) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "Update", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "apimanagement.CacheClient", "Update", nil, "Failure preparing request") return } resp, err := client.UpdateSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "Update", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "apimanagement.CacheClient", "Update", resp, "Failure sending request") return } result, err = client.UpdateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "Update", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "apimanagement.CacheClient", "Update", resp, "Failure responding to request") } return } // UpdatePreparer prepares the Update request. -func (client PropertyClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, propID string, parameters PropertyUpdateParameters, ifMatch string) (*http.Request, error) { +func (client CacheClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, cacheID string, parameters CacheUpdateParameters, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "propId": autorest.Encode("path", propID), + "cacheId": autorest.Encode("path", cacheID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -631,7 +631,7 @@ func (client PropertyClient) UpdatePreparer(ctx context.Context, resourceGroupNa autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties/{propId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters), autorest.WithHeader("If-Match", autorest.String(ifMatch))) @@ -640,13 +640,13 @@ func (client PropertyClient) UpdatePreparer(ctx context.Context, resourceGroupNa // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. -func (client PropertyClient) UpdateSender(req *http.Request) (*http.Response, error) { +func (client CacheClient) UpdateSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // UpdateResponder handles the response to the Update request. The method always // closes the http.Response Body. -func (client PropertyClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { +func (client CacheClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/certificate.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/certificate.go similarity index 95% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/certificate.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/certificate.go index d5be196ed836..ff7d01fa16b1 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/certificate.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/certificate.go @@ -69,7 +69,7 @@ func (client CertificateClient) CreateOrUpdate(ctx context.Context, resourceGrou {TargetValue: certificateID, Constraints: []validation.Constraint{{Target: "certificateID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "certificateID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "certificateID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "certificateID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.CertificateCreateOrUpdateProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.CertificateCreateOrUpdateProperties.Data", Name: validation.Null, Rule: true, Chain: nil}, @@ -108,7 +108,7 @@ func (client CertificateClient) CreateOrUpdatePreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -173,7 +173,7 @@ func (client CertificateClient) Delete(ctx context.Context, resourceGroupName st {TargetValue: certificateID, Constraints: []validation.Constraint{{Target: "certificateID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "certificateID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "certificateID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "certificateID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.CertificateClient", "Delete", err.Error()) } @@ -207,7 +207,7 @@ func (client CertificateClient) DeletePreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -264,7 +264,7 @@ func (client CertificateClient) Get(ctx context.Context, resourceGroupName strin {TargetValue: certificateID, Constraints: []validation.Constraint{{Target: "certificateID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "certificateID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "certificateID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "certificateID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.CertificateClient", "Get", err.Error()) } @@ -298,7 +298,7 @@ func (client CertificateClient) GetPreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -355,7 +355,7 @@ func (client CertificateClient) GetEntityTag(ctx context.Context, resourceGroupN {TargetValue: certificateID, Constraints: []validation.Constraint{{Target: "certificateID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "certificateID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "certificateID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "certificateID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.CertificateClient", "GetEntityTag", err.Error()) } @@ -389,7 +389,7 @@ func (client CertificateClient) GetEntityTagPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -424,12 +424,12 @@ func (client CertificateClient) GetEntityTagResponder(resp *http.Response) (resu // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - | Field | Supported operators | Supported functions | -// |----------------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | subject | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | thumbprint | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | expirationDate | ge, le, eq, ne, gt, lt | N/A | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| subject | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| thumbprint | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| expirationDate | filter | ge, le, eq, ne, gt, lt | +// |
// top - number of records to return. // skip - number of records to skip. func (client CertificateClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result CertificateCollectionPage, err error) { @@ -487,7 +487,7 @@ func (client CertificateClient) ListByServicePreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/client.go similarity index 98% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/client.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/client.go index cf2bd32aeeec..cbbdf246465b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/client.go @@ -1,4 +1,4 @@ -// Package apimanagement implements the Azure ARM Apimanagement service API version 2018-01-01. +// Package apimanagement implements the Azure ARM Apimanagement service API version 2019-12-01. // // ApiManagement Client package apimanagement diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/delegationsettings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/delegationsettings.go similarity index 79% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/delegationsettings.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/delegationsettings.go index b1dae8116b9d..ab2b8d844c64 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/delegationsettings.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/delegationsettings.go @@ -48,7 +48,8 @@ func NewDelegationSettingsClientWithBaseURI(baseURI string, subscriptionID strin // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // parameters - create or update parameters. -func (client DelegationSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalDelegationSettings) (result PortalDelegationSettings, err error) { +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client DelegationSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalDelegationSettings, ifMatch string) (result PortalDelegationSettings, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DelegationSettingsClient.CreateOrUpdate") defer func() { @@ -67,7 +68,7 @@ func (client DelegationSettingsClient) CreateOrUpdate(ctx context.Context, resou return result, validation.NewError("apimanagement.DelegationSettingsClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, parameters) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, parameters, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.DelegationSettingsClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -89,14 +90,14 @@ func (client DelegationSettingsClient) CreateOrUpdate(ctx context.Context, resou } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DelegationSettingsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalDelegationSettings) (*http.Request, error) { +func (client DelegationSettingsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalDelegationSettings, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -108,6 +109,10 @@ func (client DelegationSettingsClient) CreateOrUpdatePreparer(ctx context.Contex autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -130,7 +135,7 @@ func (client DelegationSettingsClient) CreateOrUpdateResponder(resp *http.Respon return } -// Get get Delegation settings. +// Get get Delegation Settings for the Portal. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. @@ -182,7 +187,7 @@ func (client DelegationSettingsClient) GetPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -266,7 +271,7 @@ func (client DelegationSettingsClient) GetEntityTagPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -297,6 +302,90 @@ func (client DelegationSettingsClient) GetEntityTagResponder(resp *http.Response return } +// ListSecrets gets the secret validation key of the DelegationSettings. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +func (client DelegationSettingsClient) ListSecrets(ctx context.Context, resourceGroupName string, serviceName string) (result PortalSettingValidationKeyContract, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DelegationSettingsClient.ListSecrets") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.DelegationSettingsClient", "ListSecrets", err.Error()) + } + + req, err := client.ListSecretsPreparer(ctx, resourceGroupName, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.DelegationSettingsClient", "ListSecrets", nil, "Failure preparing request") + return + } + + resp, err := client.ListSecretsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.DelegationSettingsClient", "ListSecrets", resp, "Failure sending request") + return + } + + result, err = client.ListSecretsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.DelegationSettingsClient", "ListSecrets", resp, "Failure responding to request") + } + + return +} + +// ListSecretsPreparer prepares the ListSecrets request. +func (client DelegationSettingsClient) ListSecretsPreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation/listSecrets", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSecretsSender sends the ListSecrets request. The method will close the +// http.Response Body if it receives an error. +func (client DelegationSettingsClient) ListSecretsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSecretsResponder handles the response to the ListSecrets request. The method always +// closes the http.Response Body. +func (client DelegationSettingsClient) ListSecretsResponder(resp *http.Response) (result PortalSettingValidationKeyContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // Update update Delegation settings. // Parameters: // resourceGroupName - the name of the resource group. @@ -352,7 +441,7 @@ func (client DelegationSettingsClient) UpdatePreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/diagnostic.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/diagnostic.go similarity index 86% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/diagnostic.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/diagnostic.go index a6b1fa54d2a7..261e3cd2b2eb 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/diagnostic.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/diagnostic.go @@ -68,10 +68,45 @@ func (client DiagnosticClient) CreateOrUpdate(ctx context.Context, resourceGroup {TargetValue: diagnosticID, Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "diagnosticID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Enabled", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.LoggerID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.DiagnosticContractProperties.Sampling", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Sampling.Percentage", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Sampling.Percentage", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, + {Target: "parameters.DiagnosticContractProperties.Sampling.Percentage", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, + }}, + }}, + {Target: "parameters.DiagnosticContractProperties.Frontend", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Request", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Request.Body", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Request.Body.Bytes", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Request.Body.Bytes", Name: validation.InclusiveMaximum, Rule: int64(8192), Chain: nil}}}, + }}, + }}, + {Target: "parameters.DiagnosticContractProperties.Frontend.Response", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Response.Body", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Response.Body.Bytes", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Response.Body.Bytes", Name: validation.InclusiveMaximum, Rule: int64(8192), Chain: nil}}}, + }}, + }}, + }}, + {Target: "parameters.DiagnosticContractProperties.Backend", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Request", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Request.Body", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Request.Body.Bytes", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Request.Body.Bytes", Name: validation.InclusiveMaximum, Rule: int64(8192), Chain: nil}}}, + }}, + }}, + {Target: "parameters.DiagnosticContractProperties.Backend.Response", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Response.Body", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Response.Body.Bytes", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Response.Body.Bytes", Name: validation.InclusiveMaximum, Rule: int64(8192), Chain: nil}}}, + }}, + }}, + }}, + }}}}}); err != nil { return result, validation.NewError("apimanagement.DiagnosticClient", "CreateOrUpdate", err.Error()) } @@ -105,7 +140,7 @@ func (client DiagnosticClient) CreateOrUpdatePreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -169,7 +204,7 @@ func (client DiagnosticClient) Delete(ctx context.Context, resourceGroupName str {TargetValue: diagnosticID, Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "diagnosticID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.DiagnosticClient", "Delete", err.Error()) } @@ -203,7 +238,7 @@ func (client DiagnosticClient) DeletePreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -259,7 +294,7 @@ func (client DiagnosticClient) Get(ctx context.Context, resourceGroupName string {TargetValue: diagnosticID, Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "diagnosticID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.DiagnosticClient", "Get", err.Error()) } @@ -293,7 +328,7 @@ func (client DiagnosticClient) GetPreparer(ctx context.Context, resourceGroupNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -349,7 +384,7 @@ func (client DiagnosticClient) GetEntityTag(ctx context.Context, resourceGroupNa {TargetValue: diagnosticID, Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "diagnosticID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.DiagnosticClient", "GetEntityTag", err.Error()) } @@ -383,7 +418,7 @@ func (client DiagnosticClient) GetEntityTagPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -418,9 +453,9 @@ func (client DiagnosticClient) GetEntityTagResponder(resp *http.Response) (resul // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|-----------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. func (client DiagnosticClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result DiagnosticCollectionPage, err error) { @@ -478,7 +513,7 @@ func (client DiagnosticClient) ListByServicePreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -583,7 +618,7 @@ func (client DiagnosticClient) Update(ctx context.Context, resourceGroupName str {TargetValue: diagnosticID, Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "diagnosticID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.DiagnosticClient", "Update", err.Error()) } @@ -617,7 +652,7 @@ func (client DiagnosticClient) UpdatePreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/emailtemplate.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/emailtemplate.go similarity index 94% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/emailtemplate.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/emailtemplate.go index a8b320afd02b..f8c001cec5af 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/emailtemplate.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/emailtemplate.go @@ -107,7 +107,7 @@ func (client EmailTemplateClient) CreateOrUpdatePreparer(ctx context.Context, re "templateName": autorest.Encode("path", templateName), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -201,7 +201,7 @@ func (client EmailTemplateClient) DeletePreparer(ctx context.Context, resourceGr "templateName": autorest.Encode("path", templateName), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -287,7 +287,7 @@ func (client EmailTemplateClient) GetPreparer(ctx context.Context, resourceGroup "templateName": autorest.Encode("path", templateName), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -373,7 +373,7 @@ func (client EmailTemplateClient) GetEntityTagPreparer(ctx context.Context, reso "templateName": autorest.Encode("path", templateName), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -408,9 +408,12 @@ func (client EmailTemplateClient) GetEntityTagResponder(resp *http.Response) (re // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. -func (client EmailTemplateClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, top *int32, skip *int32) (result EmailTemplateCollectionPage, err error) { +func (client EmailTemplateClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result EmailTemplateCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/EmailTemplateClient.ListByService") defer func() { @@ -436,7 +439,7 @@ func (client EmailTemplateClient) ListByService(ctx context.Context, resourceGro } result.fn = client.listByServiceNextResults - req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, top, skip) + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.EmailTemplateClient", "ListByService", nil, "Failure preparing request") return @@ -458,17 +461,20 @@ func (client EmailTemplateClient) ListByService(ctx context.Context, resourceGro } // ListByServicePreparer prepares the ListByService request. -func (client EmailTemplateClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, top *int32, skip *int32) (*http.Request, error) { +func (client EmailTemplateClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } if top != nil { queryParameters["$top"] = autorest.Encode("query", *top) } @@ -525,7 +531,7 @@ func (client EmailTemplateClient) listByServiceNextResults(ctx context.Context, } // ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. -func (client EmailTemplateClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, top *int32, skip *int32) (result EmailTemplateCollectionIterator, err error) { +func (client EmailTemplateClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result EmailTemplateCollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/EmailTemplateClient.ListByService") defer func() { @@ -536,7 +542,7 @@ func (client EmailTemplateClient) ListByServiceComplete(ctx context.Context, res tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, top, skip) + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip) return } @@ -546,7 +552,9 @@ func (client EmailTemplateClient) ListByServiceComplete(ctx context.Context, res // serviceName - the name of the API Management service. // templateName - email Template Name Identifier. // parameters - update parameters. -func (client EmailTemplateClient) Update(ctx context.Context, resourceGroupName string, serviceName string, templateName TemplateName, parameters EmailTemplateUpdateParameters) (result autorest.Response, err error) { +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client EmailTemplateClient) Update(ctx context.Context, resourceGroupName string, serviceName string, templateName TemplateName, parameters EmailTemplateUpdateParameters, ifMatch string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/EmailTemplateClient.Update") defer func() { @@ -565,7 +573,7 @@ func (client EmailTemplateClient) Update(ctx context.Context, resourceGroupName return result, validation.NewError("apimanagement.EmailTemplateClient", "Update", err.Error()) } - req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, templateName, parameters) + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, templateName, parameters, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.EmailTemplateClient", "Update", nil, "Failure preparing request") return @@ -587,7 +595,7 @@ func (client EmailTemplateClient) Update(ctx context.Context, resourceGroupName } // UpdatePreparer prepares the Update request. -func (client EmailTemplateClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, templateName TemplateName, parameters EmailTemplateUpdateParameters) (*http.Request, error) { +func (client EmailTemplateClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, templateName TemplateName, parameters EmailTemplateUpdateParameters, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), @@ -595,7 +603,7 @@ func (client EmailTemplateClient) UpdatePreparer(ctx context.Context, resourceGr "templateName": autorest.Encode("path", templateName), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -606,7 +614,8 @@ func (client EmailTemplateClient) UpdatePreparer(ctx context.Context, resourceGr autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}", pathParameters), autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/gateway.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/gateway.go new file mode 100644 index 000000000000..0f3387758eb5 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/gateway.go @@ -0,0 +1,931 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// GatewayClient is the apiManagement Client +type GatewayClient struct { + BaseClient +} + +// NewGatewayClient creates an instance of the GatewayClient client. +func NewGatewayClient(subscriptionID string) GatewayClient { + return NewGatewayClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewGatewayClientWithBaseURI creates an instance of the GatewayClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewGatewayClientWithBaseURI(baseURI string, subscriptionID string) GatewayClient { + return GatewayClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a Gateway to be used in Api Management instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// gatewayID - gateway entity identifier. Must be unique in the current API Management service instance. Must +// not have value 'managed' +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client GatewayClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, parameters GatewayContract, ifMatch string) (result GatewayContract, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: gatewayID, + Constraints: []validation.Constraint{{Target: "gatewayID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "gatewayID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.GatewayContractProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.GatewayContractProperties.LocationData", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.GatewayContractProperties.LocationData.Name", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.GatewayContractProperties.LocationData.Name", Name: validation.MaxLength, Rule: 256, Chain: nil}}}, + {Target: "parameters.GatewayContractProperties.LocationData.City", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.GatewayContractProperties.LocationData.City", Name: validation.MaxLength, Rule: 256, Chain: nil}}}, + {Target: "parameters.GatewayContractProperties.LocationData.District", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.GatewayContractProperties.LocationData.District", Name: validation.MaxLength, Rule: 256, Chain: nil}}}, + {Target: "parameters.GatewayContractProperties.LocationData.CountryOrRegion", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.GatewayContractProperties.LocationData.CountryOrRegion", Name: validation.MaxLength, Rule: 256, Chain: nil}}}, + }}, + {Target: "parameters.GatewayContractProperties.Description", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.GatewayContractProperties.Description", Name: validation.MaxLength, Rule: 1000, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("apimanagement.GatewayClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, gatewayID, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client GatewayClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, parameters GatewayContract, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayId": autorest.Encode("path", gatewayID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client GatewayClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client GatewayClient) CreateOrUpdateResponder(resp *http.Response) (result GatewayContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes specific Gateway. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// gatewayID - gateway entity identifier. Must be unique in the current API Management service instance. Must +// not have value 'managed' +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client GatewayClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, ifMatch string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: gatewayID, + Constraints: []validation.Constraint{{Target: "gatewayID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "gatewayID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.GatewayClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, gatewayID, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client GatewayClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayId": autorest.Encode("path", gatewayID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client GatewayClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client GatewayClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// GenerateToken gets the Shared Access Authorization Token for the gateway. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// gatewayID - gateway entity identifier. Must be unique in the current API Management service instance. Must +// not have value 'managed' +func (client GatewayClient) GenerateToken(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, parameters GatewayTokenRequestContract) (result GatewayTokenContract, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayClient.GenerateToken") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: gatewayID, + Constraints: []validation.Constraint{{Target: "gatewayID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "gatewayID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Expiry", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.GatewayClient", "GenerateToken", err.Error()) + } + + req, err := client.GenerateTokenPreparer(ctx, resourceGroupName, serviceName, gatewayID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "GenerateToken", nil, "Failure preparing request") + return + } + + resp, err := client.GenerateTokenSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "GenerateToken", resp, "Failure sending request") + return + } + + result, err = client.GenerateTokenResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "GenerateToken", resp, "Failure responding to request") + } + + return +} + +// GenerateTokenPreparer prepares the GenerateToken request. +func (client GatewayClient) GenerateTokenPreparer(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, parameters GatewayTokenRequestContract) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayId": autorest.Encode("path", gatewayID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/generateToken", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GenerateTokenSender sends the GenerateToken request. The method will close the +// http.Response Body if it receives an error. +func (client GatewayClient) GenerateTokenSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GenerateTokenResponder handles the response to the GenerateToken request. The method always +// closes the http.Response Body. +func (client GatewayClient) GenerateTokenResponder(resp *http.Response) (result GatewayTokenContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of the Gateway specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// gatewayID - gateway entity identifier. Must be unique in the current API Management service instance. Must +// not have value 'managed' +func (client GatewayClient) Get(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string) (result GatewayContract, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: gatewayID, + Constraints: []validation.Constraint{{Target: "gatewayID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "gatewayID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.GatewayClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, gatewayID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client GatewayClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayId": autorest.Encode("path", gatewayID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client GatewayClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client GatewayClient) GetResponder(resp *http.Response) (result GatewayContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEntityTag gets the entity state (Etag) version of the Gateway specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// gatewayID - gateway entity identifier. Must be unique in the current API Management service instance. Must +// not have value 'managed' +func (client GatewayClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayClient.GetEntityTag") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: gatewayID, + Constraints: []validation.Constraint{{Target: "gatewayID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "gatewayID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.GatewayClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, gatewayID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client GatewayClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayId": autorest.Encode("path", gatewayID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client GatewayClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client GatewayClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListByService lists a collection of gateways registered with service instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// top - number of records to return. +// skip - number of records to skip. +func (client GatewayClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, top *int32, skip *int32) (result GatewayCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayClient.ListByService") + defer func() { + sc := -1 + if result.gc.Response.Response != nil { + sc = result.gc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.GatewayClient", "ListByService", err.Error()) + } + + result.fn = client.listByServiceNextResults + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "ListByService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServiceSender(req) + if err != nil { + result.gc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "ListByService", resp, "Failure sending request") + return + } + + result.gc, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "ListByService", resp, "Failure responding to request") + } + + return +} + +// ListByServicePreparer prepares the ListByService request. +func (client GatewayClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServiceSender sends the ListByService request. The method will close the +// http.Response Body if it receives an error. +func (client GatewayClient) ListByServiceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServiceResponder handles the response to the ListByService request. The method always +// closes the http.Response Body. +func (client GatewayClient) ListByServiceResponder(resp *http.Response) (result GatewayCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByServiceNextResults retrieves the next set of results, if any. +func (client GatewayClient) listByServiceNextResults(ctx context.Context, lastResults GatewayCollection) (result GatewayCollection, err error) { + req, err := lastResults.gatewayCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "listByServiceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "listByServiceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "listByServiceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client GatewayClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, top *int32, skip *int32) (result GatewayCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayClient.ListByService") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, top, skip) + return +} + +// ListKeys retrieves gateway keys. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// gatewayID - gateway entity identifier. Must be unique in the current API Management service instance. Must +// not have value 'managed' +func (client GatewayClient) ListKeys(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string) (result GatewayKeysContract, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayClient.ListKeys") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: gatewayID, + Constraints: []validation.Constraint{{Target: "gatewayID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "gatewayID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.GatewayClient", "ListKeys", err.Error()) + } + + req, err := client.ListKeysPreparer(ctx, resourceGroupName, serviceName, gatewayID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "ListKeys", nil, "Failure preparing request") + return + } + + resp, err := client.ListKeysSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "ListKeys", resp, "Failure sending request") + return + } + + result, err = client.ListKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "ListKeys", resp, "Failure responding to request") + } + + return +} + +// ListKeysPreparer prepares the ListKeys request. +func (client GatewayClient) ListKeysPreparer(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayId": autorest.Encode("path", gatewayID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/listKeys", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListKeysSender sends the ListKeys request. The method will close the +// http.Response Body if it receives an error. +func (client GatewayClient) ListKeysSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListKeysResponder handles the response to the ListKeys request. The method always +// closes the http.Response Body. +func (client GatewayClient) ListKeysResponder(resp *http.Response) (result GatewayKeysContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RegenerateKey regenerates specified gateway key invalidating any tokens created with it. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// gatewayID - gateway entity identifier. Must be unique in the current API Management service instance. Must +// not have value 'managed' +func (client GatewayClient) RegenerateKey(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, parameters GatewayKeyRegenerationRequestContract) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayClient.RegenerateKey") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: gatewayID, + Constraints: []validation.Constraint{{Target: "gatewayID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "gatewayID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.GatewayClient", "RegenerateKey", err.Error()) + } + + req, err := client.RegenerateKeyPreparer(ctx, resourceGroupName, serviceName, gatewayID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "RegenerateKey", nil, "Failure preparing request") + return + } + + resp, err := client.RegenerateKeySender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "RegenerateKey", resp, "Failure sending request") + return + } + + result, err = client.RegenerateKeyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "RegenerateKey", resp, "Failure responding to request") + } + + return +} + +// RegenerateKeyPreparer prepares the RegenerateKey request. +func (client GatewayClient) RegenerateKeyPreparer(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, parameters GatewayKeyRegenerationRequestContract) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayId": autorest.Encode("path", gatewayID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/regenerateKey", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RegenerateKeySender sends the RegenerateKey request. The method will close the +// http.Response Body if it receives an error. +func (client GatewayClient) RegenerateKeySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// RegenerateKeyResponder handles the response to the RegenerateKey request. The method always +// closes the http.Response Body. +func (client GatewayClient) RegenerateKeyResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update updates the details of the gateway specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// gatewayID - gateway entity identifier. Must be unique in the current API Management service instance. Must +// not have value 'managed' +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client GatewayClient) Update(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, parameters GatewayContract, ifMatch string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayClient.Update") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: gatewayID, + Constraints: []validation.Constraint{{Target: "gatewayID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "gatewayID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.GatewayClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, gatewayID, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client GatewayClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, parameters GatewayContract, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayId": autorest.Encode("path", gatewayID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client GatewayClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client GatewayClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/gatewayapi.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/gatewayapi.go new file mode 100644 index 000000000000..90d8f99565f3 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/gatewayapi.go @@ -0,0 +1,473 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// GatewayAPIClient is the apiManagement Client +type GatewayAPIClient struct { + BaseClient +} + +// NewGatewayAPIClient creates an instance of the GatewayAPIClient client. +func NewGatewayAPIClient(subscriptionID string) GatewayAPIClient { + return NewGatewayAPIClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewGatewayAPIClientWithBaseURI creates an instance of the GatewayAPIClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewGatewayAPIClientWithBaseURI(baseURI string, subscriptionID string) GatewayAPIClient { + return GatewayAPIClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate adds an API to the specified Gateway. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// gatewayID - gateway entity identifier. Must be unique in the current API Management service instance. Must +// not have value 'managed' +// apiid - API identifier. Must be unique in the current API Management service instance. +func (client GatewayAPIClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, apiid string, parameters *AssociationContract) (result APIContract, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayAPIClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: gatewayID, + Constraints: []validation.Constraint{{Target: "gatewayID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "gatewayID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.GatewayAPIClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, gatewayID, apiid, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayAPIClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.GatewayAPIClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayAPIClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client GatewayAPIClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, apiid string, parameters *AssociationContract) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "gatewayId": autorest.Encode("path", gatewayID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/apis/{apiId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if parameters != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(parameters)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client GatewayAPIClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client GatewayAPIClient) CreateOrUpdateResponder(resp *http.Response) (result APIContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the specified API from the specified Gateway. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// gatewayID - gateway entity identifier. Must be unique in the current API Management service instance. Must +// not have value 'managed' +// apiid - API identifier. Must be unique in the current API Management service instance. +func (client GatewayAPIClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, apiid string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayAPIClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: gatewayID, + Constraints: []validation.Constraint{{Target: "gatewayID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "gatewayID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.GatewayAPIClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, gatewayID, apiid) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayAPIClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.GatewayAPIClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayAPIClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client GatewayAPIClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, apiid string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "gatewayId": autorest.Encode("path", gatewayID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/apis/{apiId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client GatewayAPIClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client GatewayAPIClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// GetEntityTag checks that API entity specified by identifier is associated with the Gateway entity. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// gatewayID - gateway entity identifier. Must be unique in the current API Management service instance. Must +// not have value 'managed' +// apiid - API identifier. Must be unique in the current API Management service instance. +func (client GatewayAPIClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, apiid string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayAPIClient.GetEntityTag") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: gatewayID, + Constraints: []validation.Constraint{{Target: "gatewayID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "gatewayID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.GatewayAPIClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, gatewayID, apiid) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayAPIClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.GatewayAPIClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayAPIClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client GatewayAPIClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, apiid string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "gatewayId": autorest.Encode("path", gatewayID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/apis/{apiId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client GatewayAPIClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client GatewayAPIClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListByService lists a collection of the APIs associated with a gateway. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// gatewayID - gateway entity identifier. Must be unique in the current API Management service instance. Must +// not have value 'managed' +// top - number of records to return. +// skip - number of records to skip. +func (client GatewayAPIClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, top *int32, skip *int32) (result APICollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayAPIClient.ListByService") + defer func() { + sc := -1 + if result.ac.Response.Response != nil { + sc = result.ac.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: gatewayID, + Constraints: []validation.Constraint{{Target: "gatewayID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "gatewayID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.GatewayAPIClient", "ListByService", err.Error()) + } + + result.fn = client.listByServiceNextResults + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, gatewayID, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayAPIClient", "ListByService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServiceSender(req) + if err != nil { + result.ac.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.GatewayAPIClient", "ListByService", resp, "Failure sending request") + return + } + + result.ac, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayAPIClient", "ListByService", resp, "Failure responding to request") + } + + return +} + +// ListByServicePreparer prepares the ListByService request. +func (client GatewayAPIClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayId": autorest.Encode("path", gatewayID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/apis", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServiceSender sends the ListByService request. The method will close the +// http.Response Body if it receives an error. +func (client GatewayAPIClient) ListByServiceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServiceResponder handles the response to the ListByService request. The method always +// closes the http.Response Body. +func (client GatewayAPIClient) ListByServiceResponder(resp *http.Response) (result APICollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByServiceNextResults retrieves the next set of results, if any. +func (client GatewayAPIClient) listByServiceNextResults(ctx context.Context, lastResults APICollection) (result APICollection, err error) { + req, err := lastResults.aPICollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.GatewayAPIClient", "listByServiceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.GatewayAPIClient", "listByServiceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayAPIClient", "listByServiceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client GatewayAPIClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, top *int32, skip *int32) (result APICollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayAPIClient.ListByService") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, gatewayID, top, skip) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/gatewayhostnameconfiguration.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/gatewayhostnameconfiguration.go new file mode 100644 index 000000000000..9918fef1ccf8 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/gatewayhostnameconfiguration.go @@ -0,0 +1,566 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// GatewayHostnameConfigurationClient is the apiManagement Client +type GatewayHostnameConfigurationClient struct { + BaseClient +} + +// NewGatewayHostnameConfigurationClient creates an instance of the GatewayHostnameConfigurationClient client. +func NewGatewayHostnameConfigurationClient(subscriptionID string) GatewayHostnameConfigurationClient { + return NewGatewayHostnameConfigurationClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewGatewayHostnameConfigurationClientWithBaseURI creates an instance of the GatewayHostnameConfigurationClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewGatewayHostnameConfigurationClientWithBaseURI(baseURI string, subscriptionID string) GatewayHostnameConfigurationClient { + return GatewayHostnameConfigurationClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates of updates hostname configuration for a Gateway. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// gatewayID - gateway entity identifier. Must be unique in the current API Management service instance. Must +// not have value 'managed' +// hcID - gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. +func (client GatewayHostnameConfigurationClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, hcID string, parameters GatewayHostnameConfigurationContract) (result GatewayHostnameConfigurationContract, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayHostnameConfigurationClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: gatewayID, + Constraints: []validation.Constraint{{Target: "gatewayID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "gatewayID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: hcID, + Constraints: []validation.Constraint{{Target: "hcID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "hcID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.GatewayHostnameConfigurationClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, gatewayID, hcID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayHostnameConfigurationClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.GatewayHostnameConfigurationClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayHostnameConfigurationClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client GatewayHostnameConfigurationClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, hcID string, parameters GatewayHostnameConfigurationContract) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayId": autorest.Encode("path", gatewayID), + "hcId": autorest.Encode("path", hcID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client GatewayHostnameConfigurationClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client GatewayHostnameConfigurationClient) CreateOrUpdateResponder(resp *http.Response) (result GatewayHostnameConfigurationContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the specified hostname configuration from the specified Gateway. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// gatewayID - gateway entity identifier. Must be unique in the current API Management service instance. Must +// not have value 'managed' +// hcID - gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. +func (client GatewayHostnameConfigurationClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, hcID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayHostnameConfigurationClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: gatewayID, + Constraints: []validation.Constraint{{Target: "gatewayID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "gatewayID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: hcID, + Constraints: []validation.Constraint{{Target: "hcID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "hcID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.GatewayHostnameConfigurationClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, gatewayID, hcID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayHostnameConfigurationClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.GatewayHostnameConfigurationClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayHostnameConfigurationClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client GatewayHostnameConfigurationClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, hcID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayId": autorest.Encode("path", gatewayID), + "hcId": autorest.Encode("path", hcID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client GatewayHostnameConfigurationClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client GatewayHostnameConfigurationClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the Gateway hostname configuration specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// gatewayID - gateway entity identifier. Must be unique in the current API Management service instance. Must +// not have value 'managed' +// hcID - gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. +func (client GatewayHostnameConfigurationClient) Get(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, hcID string) (result GatewayHostnameConfigurationContract, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayHostnameConfigurationClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: gatewayID, + Constraints: []validation.Constraint{{Target: "gatewayID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "gatewayID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: hcID, + Constraints: []validation.Constraint{{Target: "hcID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "hcID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.GatewayHostnameConfigurationClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, gatewayID, hcID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayHostnameConfigurationClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.GatewayHostnameConfigurationClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayHostnameConfigurationClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client GatewayHostnameConfigurationClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, hcID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayId": autorest.Encode("path", gatewayID), + "hcId": autorest.Encode("path", hcID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client GatewayHostnameConfigurationClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client GatewayHostnameConfigurationClient) GetResponder(resp *http.Response) (result GatewayHostnameConfigurationContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEntityTag checks that hostname configuration entity specified by identifier exists for specified Gateway entity. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// gatewayID - gateway entity identifier. Must be unique in the current API Management service instance. Must +// not have value 'managed' +// hcID - gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. +func (client GatewayHostnameConfigurationClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, hcID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayHostnameConfigurationClient.GetEntityTag") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: gatewayID, + Constraints: []validation.Constraint{{Target: "gatewayID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "gatewayID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: hcID, + Constraints: []validation.Constraint{{Target: "hcID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "hcID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.GatewayHostnameConfigurationClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, gatewayID, hcID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayHostnameConfigurationClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.GatewayHostnameConfigurationClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayHostnameConfigurationClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client GatewayHostnameConfigurationClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, hcID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayId": autorest.Encode("path", gatewayID), + "hcId": autorest.Encode("path", hcID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client GatewayHostnameConfigurationClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client GatewayHostnameConfigurationClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListByService lists the collection of hostname configurations for the specified gateway. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// gatewayID - gateway entity identifier. Must be unique in the current API Management service instance. Must +// not have value 'managed' +// top - number of records to return. +// skip - number of records to skip. +func (client GatewayHostnameConfigurationClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, top *int32, skip *int32) (result GatewayHostnameConfigurationCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayHostnameConfigurationClient.ListByService") + defer func() { + sc := -1 + if result.ghcc.Response.Response != nil { + sc = result.ghcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: gatewayID, + Constraints: []validation.Constraint{{Target: "gatewayID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "gatewayID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.GatewayHostnameConfigurationClient", "ListByService", err.Error()) + } + + result.fn = client.listByServiceNextResults + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, gatewayID, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayHostnameConfigurationClient", "ListByService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServiceSender(req) + if err != nil { + result.ghcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.GatewayHostnameConfigurationClient", "ListByService", resp, "Failure sending request") + return + } + + result.ghcc, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayHostnameConfigurationClient", "ListByService", resp, "Failure responding to request") + } + + return +} + +// ListByServicePreparer prepares the ListByService request. +func (client GatewayHostnameConfigurationClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayId": autorest.Encode("path", gatewayID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServiceSender sends the ListByService request. The method will close the +// http.Response Body if it receives an error. +func (client GatewayHostnameConfigurationClient) ListByServiceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServiceResponder handles the response to the ListByService request. The method always +// closes the http.Response Body. +func (client GatewayHostnameConfigurationClient) ListByServiceResponder(resp *http.Response) (result GatewayHostnameConfigurationCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByServiceNextResults retrieves the next set of results, if any. +func (client GatewayHostnameConfigurationClient) listByServiceNextResults(ctx context.Context, lastResults GatewayHostnameConfigurationCollection) (result GatewayHostnameConfigurationCollection, err error) { + req, err := lastResults.gatewayHostnameConfigurationCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.GatewayHostnameConfigurationClient", "listByServiceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.GatewayHostnameConfigurationClient", "listByServiceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayHostnameConfigurationClient", "listByServiceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client GatewayHostnameConfigurationClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, top *int32, skip *int32) (result GatewayHostnameConfigurationCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayHostnameConfigurationClient.ListByService") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, gatewayID, top, skip) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/group.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/group.go similarity index 94% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/group.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/group.go index 52e09301e764..70daa0d041a9 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/group.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/group.go @@ -66,9 +66,8 @@ func (client GroupClient) CreateOrUpdate(ctx context.Context, resourceGroupName {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: groupID, - Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "groupID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.GroupCreateParametersProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.GroupCreateParametersProperties.DisplayName", Name: validation.Null, Rule: true, @@ -109,7 +108,7 @@ func (client GroupClient) CreateOrUpdatePreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -171,9 +170,8 @@ func (client GroupClient) Delete(ctx context.Context, resourceGroupName string, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: groupID, - Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "groupID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.GroupClient", "Delete", err.Error()) } @@ -207,7 +205,7 @@ func (client GroupClient) DeletePreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -261,9 +259,8 @@ func (client GroupClient) Get(ctx context.Context, resourceGroupName string, ser {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: groupID, - Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "groupID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.GroupClient", "Get", err.Error()) } @@ -297,7 +294,7 @@ func (client GroupClient) GetPreparer(ctx context.Context, resourceGroupName str "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -351,9 +348,8 @@ func (client GroupClient) GetEntityTag(ctx context.Context, resourceGroupName st {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: groupID, - Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "groupID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.GroupClient", "GetEntityTag", err.Error()) } @@ -387,7 +383,7 @@ func (client GroupClient) GetEntityTagPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -422,12 +418,11 @@ func (client GroupClient) GetEntityTagResponder(resp *http.Response) (result aut // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | type | eq, ne | N/A | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| aadObjectId | filter | eq | |
// top - number of records to return. // skip - number of records to skip. func (client GroupClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result GroupCollectionPage, err error) { @@ -485,7 +480,7 @@ func (client GroupClient) ListByServicePreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -588,9 +583,8 @@ func (client GroupClient) Update(ctx context.Context, resourceGroupName string, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: groupID, - Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "groupID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.GroupClient", "Update", err.Error()) } @@ -624,7 +618,7 @@ func (client GroupClient) UpdatePreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/groupuser.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/groupuser.go similarity index 83% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/groupuser.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/groupuser.go index a1a3bc42fa32..89595eb920da 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/groupuser.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/groupuser.go @@ -47,8 +47,8 @@ func NewGroupUserClientWithBaseURI(baseURI string, subscriptionID string) GroupU // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // groupID - group identifier. Must be unique in the current API Management service instance. -// UID - user identifier. Must be unique in the current API Management service instance. -func (client GroupUserClient) CheckEntityExists(ctx context.Context, resourceGroupName string, serviceName string, groupID string, UID string) (result autorest.Response, err error) { +// userID - user identifier. Must be unique in the current API Management service instance. +func (client GroupUserClient) CheckEntityExists(ctx context.Context, resourceGroupName string, serviceName string, groupID string, userID string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/GroupUserClient.CheckEntityExists") defer func() { @@ -65,17 +65,15 @@ func (client GroupUserClient) CheckEntityExists(ctx context.Context, resourceGro {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: groupID, - Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "groupID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, - {TargetValue: UID, - Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: userID, + Constraints: []validation.Constraint{{Target: "userID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "userID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.GroupUserClient", "CheckEntityExists", err.Error()) } - req, err := client.CheckEntityExistsPreparer(ctx, resourceGroupName, serviceName, groupID, UID) + req, err := client.CheckEntityExistsPreparer(ctx, resourceGroupName, serviceName, groupID, userID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.GroupUserClient", "CheckEntityExists", nil, "Failure preparing request") return @@ -97,16 +95,16 @@ func (client GroupUserClient) CheckEntityExists(ctx context.Context, resourceGro } // CheckEntityExistsPreparer prepares the CheckEntityExists request. -func (client GroupUserClient) CheckEntityExistsPreparer(ctx context.Context, resourceGroupName string, serviceName string, groupID string, UID string) (*http.Request, error) { +func (client GroupUserClient) CheckEntityExistsPreparer(ctx context.Context, resourceGroupName string, serviceName string, groupID string, userID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "groupId": autorest.Encode("path", groupID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "uid": autorest.Encode("path", UID), + "userId": autorest.Encode("path", userID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -114,7 +112,7 @@ func (client GroupUserClient) CheckEntityExistsPreparer(ctx context.Context, res preparer := autorest.CreatePreparer( autorest.AsHead(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{uid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{userId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -137,13 +135,13 @@ func (client GroupUserClient) CheckEntityExistsResponder(resp *http.Response) (r return } -// Create adds a user to the specified group. +// Create add existing user to existing group // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // groupID - group identifier. Must be unique in the current API Management service instance. -// UID - user identifier. Must be unique in the current API Management service instance. -func (client GroupUserClient) Create(ctx context.Context, resourceGroupName string, serviceName string, groupID string, UID string) (result UserContract, err error) { +// userID - user identifier. Must be unique in the current API Management service instance. +func (client GroupUserClient) Create(ctx context.Context, resourceGroupName string, serviceName string, groupID string, userID string) (result UserContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/GroupUserClient.Create") defer func() { @@ -160,17 +158,15 @@ func (client GroupUserClient) Create(ctx context.Context, resourceGroupName stri {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: groupID, - Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "groupID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, - {TargetValue: UID, - Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: userID, + Constraints: []validation.Constraint{{Target: "userID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "userID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.GroupUserClient", "Create", err.Error()) } - req, err := client.CreatePreparer(ctx, resourceGroupName, serviceName, groupID, UID) + req, err := client.CreatePreparer(ctx, resourceGroupName, serviceName, groupID, userID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.GroupUserClient", "Create", nil, "Failure preparing request") return @@ -192,16 +188,16 @@ func (client GroupUserClient) Create(ctx context.Context, resourceGroupName stri } // CreatePreparer prepares the Create request. -func (client GroupUserClient) CreatePreparer(ctx context.Context, resourceGroupName string, serviceName string, groupID string, UID string) (*http.Request, error) { +func (client GroupUserClient) CreatePreparer(ctx context.Context, resourceGroupName string, serviceName string, groupID string, userID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "groupId": autorest.Encode("path", groupID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "uid": autorest.Encode("path", UID), + "userId": autorest.Encode("path", userID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -209,7 +205,7 @@ func (client GroupUserClient) CreatePreparer(ctx context.Context, resourceGroupN preparer := autorest.CreatePreparer( autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{uid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{userId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -238,8 +234,8 @@ func (client GroupUserClient) CreateResponder(resp *http.Response) (result UserC // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // groupID - group identifier. Must be unique in the current API Management service instance. -// UID - user identifier. Must be unique in the current API Management service instance. -func (client GroupUserClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, groupID string, UID string) (result autorest.Response, err error) { +// userID - user identifier. Must be unique in the current API Management service instance. +func (client GroupUserClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, groupID string, userID string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/GroupUserClient.Delete") defer func() { @@ -256,17 +252,15 @@ func (client GroupUserClient) Delete(ctx context.Context, resourceGroupName stri {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: groupID, - Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "groupID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, - {TargetValue: UID, - Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: userID, + Constraints: []validation.Constraint{{Target: "userID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "userID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.GroupUserClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, groupID, UID) + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, groupID, userID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.GroupUserClient", "Delete", nil, "Failure preparing request") return @@ -288,16 +282,16 @@ func (client GroupUserClient) Delete(ctx context.Context, resourceGroupName stri } // DeletePreparer prepares the Delete request. -func (client GroupUserClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, groupID string, UID string) (*http.Request, error) { +func (client GroupUserClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, groupID string, userID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "groupId": autorest.Encode("path", groupID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "uid": autorest.Encode("path", UID), + "userId": autorest.Encode("path", userID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -305,7 +299,7 @@ func (client GroupUserClient) DeletePreparer(ctx context.Context, resourceGroupN preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{uid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{userId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -328,20 +322,18 @@ func (client GroupUserClient) DeleteResponder(resp *http.Response) (result autor return } -// List lists a collection of the members of the group, specified by its identifier. +// List lists a collection of user entities associated with the group. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // groupID - group identifier. Must be unique in the current API Management service instance. -// filter - | Field | Supported operators | Supported functions | -// |------------------|------------------------|-----------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | firstName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | lastName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | email | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | state | eq | N/A | -// | registrationDate | ge, le, eq, ne, gt, lt | N/A | -// | note | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| firstName | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| lastName | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| email | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
| registrationDate | filter | ge, le, eq, ne, gt, lt | |
| +// note | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. func (client GroupUserClient) List(ctx context.Context, resourceGroupName string, serviceName string, groupID string, filter string, top *int32, skip *int32) (result UserCollectionPage, err error) { @@ -361,9 +353,8 @@ func (client GroupUserClient) List(ctx context.Context, resourceGroupName string {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: groupID, - Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "groupID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, @@ -404,7 +395,7 @@ func (client GroupUserClient) ListPreparer(ctx context.Context, resourceGroupNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/identityprovider.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/identityprovider.go similarity index 85% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/identityprovider.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/identityprovider.go index a0ce1761a349..7ab7277941ac 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/identityprovider.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/identityprovider.go @@ -50,7 +50,7 @@ func NewIdentityProviderClientWithBaseURI(baseURI string, subscriptionID string) // identityProviderName - identity Provider Type identifier. // parameters - create parameters. // ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. -func (client IdentityProviderClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType, parameters IdentityProviderContract, ifMatch string) (result IdentityProviderContract, err error) { +func (client IdentityProviderClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType, parameters IdentityProviderCreateContract, ifMatch string) (result IdentityProviderContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/IdentityProviderClient.CreateOrUpdate") defer func() { @@ -67,11 +67,11 @@ func (client IdentityProviderClient) CreateOrUpdate(ctx context.Context, resourc {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.IdentityProviderContractProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.IdentityProviderContractProperties.ClientID", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.IdentityProviderContractProperties.ClientID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {Target: "parameters.IdentityProviderContractProperties.ClientSecret", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.IdentityProviderContractProperties.ClientSecret", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "parameters.IdentityProviderCreateContractProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.IdentityProviderCreateContractProperties.ClientID", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.IdentityProviderCreateContractProperties.ClientID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {Target: "parameters.IdentityProviderCreateContractProperties.ClientSecret", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.IdentityProviderCreateContractProperties.ClientSecret", Name: validation.MinLength, Rule: 1, Chain: nil}}}, }}}}}); err != nil { return result, validation.NewError("apimanagement.IdentityProviderClient", "CreateOrUpdate", err.Error()) } @@ -98,7 +98,7 @@ func (client IdentityProviderClient) CreateOrUpdate(ctx context.Context, resourc } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client IdentityProviderClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType, parameters IdentityProviderContract, ifMatch string) (*http.Request, error) { +func (client IdentityProviderClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType, parameters IdentityProviderCreateContract, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ "identityProviderName": autorest.Encode("path", identityProviderName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -106,7 +106,7 @@ func (client IdentityProviderClient) CreateOrUpdatePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -200,7 +200,7 @@ func (client IdentityProviderClient) DeletePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -286,7 +286,7 @@ func (client IdentityProviderClient) GetPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -372,7 +372,7 @@ func (client IdentityProviderClient) GetEntityTagPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -456,7 +456,7 @@ func (client IdentityProviderClient) ListByServicePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -525,6 +525,92 @@ func (client IdentityProviderClient) ListByServiceComplete(ctx context.Context, return } +// ListSecrets gets the client secret details of the Identity Provider. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// identityProviderName - identity Provider Type identifier. +func (client IdentityProviderClient) ListSecrets(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType) (result ClientSecretContract, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IdentityProviderClient.ListSecrets") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.IdentityProviderClient", "ListSecrets", err.Error()) + } + + req, err := client.ListSecretsPreparer(ctx, resourceGroupName, serviceName, identityProviderName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.IdentityProviderClient", "ListSecrets", nil, "Failure preparing request") + return + } + + resp, err := client.ListSecretsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.IdentityProviderClient", "ListSecrets", resp, "Failure sending request") + return + } + + result, err = client.ListSecretsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.IdentityProviderClient", "ListSecrets", resp, "Failure responding to request") + } + + return +} + +// ListSecretsPreparer prepares the ListSecrets request. +func (client IdentityProviderClient) ListSecretsPreparer(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "identityProviderName": autorest.Encode("path", identityProviderName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}/listSecrets", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSecretsSender sends the ListSecrets request. The method will close the +// http.Response Body if it receives an error. +func (client IdentityProviderClient) ListSecretsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSecretsResponder handles the response to the ListSecrets request. The method always +// closes the http.Response Body. +func (client IdentityProviderClient) ListSecretsResponder(resp *http.Response) (result ClientSecretContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // Update updates an existing IdentityProvider configuration. // Parameters: // resourceGroupName - the name of the resource group. @@ -582,7 +668,7 @@ func (client IdentityProviderClient) UpdatePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/issue.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/issue.go new file mode 100644 index 000000000000..3409671f02f1 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/issue.go @@ -0,0 +1,279 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// IssueClient is the apiManagement Client +type IssueClient struct { + BaseClient +} + +// NewIssueClient creates an instance of the IssueClient client. +func NewIssueClient(subscriptionID string) IssueClient { + return NewIssueClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewIssueClientWithBaseURI creates an instance of the IssueClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewIssueClientWithBaseURI(baseURI string, subscriptionID string) IssueClient { + return IssueClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets API Management issue details +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// issueID - issue identifier. Must be unique in the current API Management service instance. +func (client IssueClient) Get(ctx context.Context, resourceGroupName string, serviceName string, issueID string) (result IssueContract, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IssueClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: issueID, + Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "issueID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.IssueClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, issueID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.IssueClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.IssueClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.IssueClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client IssueClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, issueID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "issueId": autorest.Encode("path", issueID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/issues/{issueId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client IssueClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client IssueClient) GetResponder(resp *http.Response) (result IssueContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByService lists a collection of issues in the specified service instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| apiId | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| title | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
| authorName | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
| state | filter | eq | |
+// top - number of records to return. +// skip - number of records to skip. +func (client IssueClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result IssueCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IssueClient.ListByService") + defer func() { + sc := -1 + if result.ic.Response.Response != nil { + sc = result.ic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.IssueClient", "ListByService", err.Error()) + } + + result.fn = client.listByServiceNextResults + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.IssueClient", "ListByService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServiceSender(req) + if err != nil { + result.ic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.IssueClient", "ListByService", resp, "Failure sending request") + return + } + + result.ic, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.IssueClient", "ListByService", resp, "Failure responding to request") + } + + return +} + +// ListByServicePreparer prepares the ListByService request. +func (client IssueClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/issues", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServiceSender sends the ListByService request. The method will close the +// http.Response Body if it receives an error. +func (client IssueClient) ListByServiceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServiceResponder handles the response to the ListByService request. The method always +// closes the http.Response Body. +func (client IssueClient) ListByServiceResponder(resp *http.Response) (result IssueCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByServiceNextResults retrieves the next set of results, if any. +func (client IssueClient) listByServiceNextResults(ctx context.Context, lastResults IssueCollection) (result IssueCollection, err error) { + req, err := lastResults.issueCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.IssueClient", "listByServiceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.IssueClient", "listByServiceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.IssueClient", "listByServiceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client IssueClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result IssueCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IssueClient.ListByService") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/logger.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/logger.go similarity index 86% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/logger.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/logger.go index 1ee32fda0fd7..ac33606669d2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/logger.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/logger.go @@ -46,10 +46,10 @@ func NewLoggerClientWithBaseURI(baseURI string, subscriptionID string) LoggerCli // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// loggerid - logger identifier. Must be unique in the API Management service instance. +// loggerID - logger identifier. Must be unique in the API Management service instance. // parameters - create parameters. // ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. -func (client LoggerClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, loggerid string, parameters LoggerContract, ifMatch string) (result LoggerContract, err error) { +func (client LoggerClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, loggerID string, parameters LoggerContract, ifMatch string) (result LoggerContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LoggerClient.CreateOrUpdate") defer func() { @@ -65,9 +65,9 @@ func (client LoggerClient) CreateOrUpdate(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: loggerid, - Constraints: []validation.Constraint{{Target: "loggerid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "loggerid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: loggerID, + Constraints: []validation.Constraint{{Target: "loggerID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "loggerID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.LoggerContractProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.LoggerContractProperties.Description", Name: validation.Null, Rule: false, @@ -77,7 +77,7 @@ func (client LoggerClient) CreateOrUpdate(ctx context.Context, resourceGroupName return result, validation.NewError("apimanagement.LoggerClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, loggerid, parameters, ifMatch) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, loggerID, parameters, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.LoggerClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -99,15 +99,15 @@ func (client LoggerClient) CreateOrUpdate(ctx context.Context, resourceGroupName } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client LoggerClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, loggerid string, parameters LoggerContract, ifMatch string) (*http.Request, error) { +func (client LoggerClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, loggerID string, parameters LoggerContract, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "loggerid": autorest.Encode("path", loggerid), + "loggerId": autorest.Encode("path", loggerID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -116,7 +116,7 @@ func (client LoggerClient) CreateOrUpdatePreparer(ctx context.Context, resourceG autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) if len(ifMatch) > 0 { @@ -149,10 +149,11 @@ func (client LoggerClient) CreateOrUpdateResponder(resp *http.Response) (result // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// loggerid - logger identifier. Must be unique in the API Management service instance. +// loggerID - logger identifier. Must be unique in the API Management service instance. // ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET // request or it should be * for unconditional update. -func (client LoggerClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, loggerid string, ifMatch string) (result autorest.Response, err error) { +// force - force deletion even if diagnostic is attached. +func (client LoggerClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, loggerID string, ifMatch string, force *bool) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LoggerClient.Delete") defer func() { @@ -168,13 +169,13 @@ func (client LoggerClient) Delete(ctx context.Context, resourceGroupName string, Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: loggerid, - Constraints: []validation.Constraint{{Target: "loggerid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "loggerid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {TargetValue: loggerID, + Constraints: []validation.Constraint{{Target: "loggerID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "loggerID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.LoggerClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, loggerid, ifMatch) + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, loggerID, ifMatch, force) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.LoggerClient", "Delete", nil, "Failure preparing request") return @@ -196,23 +197,26 @@ func (client LoggerClient) Delete(ctx context.Context, resourceGroupName string, } // DeletePreparer prepares the Delete request. -func (client LoggerClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, loggerid string, ifMatch string) (*http.Request, error) { +func (client LoggerClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, loggerID string, ifMatch string, force *bool) (*http.Request, error) { pathParameters := map[string]interface{}{ - "loggerid": autorest.Encode("path", loggerid), + "loggerId": autorest.Encode("path", loggerID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if force != nil { + queryParameters["force"] = autorest.Encode("query", *force) + } preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}", pathParameters), autorest.WithQueryParameters(queryParameters), autorest.WithHeader("If-Match", autorest.String(ifMatch))) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -240,8 +244,8 @@ func (client LoggerClient) DeleteResponder(resp *http.Response) (result autorest // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// loggerid - logger identifier. Must be unique in the API Management service instance. -func (client LoggerClient) Get(ctx context.Context, resourceGroupName string, serviceName string, loggerid string) (result LoggerContract, err error) { +// loggerID - logger identifier. Must be unique in the API Management service instance. +func (client LoggerClient) Get(ctx context.Context, resourceGroupName string, serviceName string, loggerID string) (result LoggerContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LoggerClient.Get") defer func() { @@ -257,13 +261,13 @@ func (client LoggerClient) Get(ctx context.Context, resourceGroupName string, se Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: loggerid, - Constraints: []validation.Constraint{{Target: "loggerid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "loggerid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {TargetValue: loggerID, + Constraints: []validation.Constraint{{Target: "loggerID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "loggerID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.LoggerClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, loggerid) + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, loggerID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.LoggerClient", "Get", nil, "Failure preparing request") return @@ -285,15 +289,15 @@ func (client LoggerClient) Get(ctx context.Context, resourceGroupName string, se } // GetPreparer prepares the Get request. -func (client LoggerClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, loggerid string) (*http.Request, error) { +func (client LoggerClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, loggerID string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "loggerid": autorest.Encode("path", loggerid), + "loggerId": autorest.Encode("path", loggerID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -301,7 +305,7 @@ func (client LoggerClient) GetPreparer(ctx context.Context, resourceGroupName st preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -329,8 +333,8 @@ func (client LoggerClient) GetResponder(resp *http.Response) (result LoggerContr // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// loggerid - logger identifier. Must be unique in the API Management service instance. -func (client LoggerClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, loggerid string) (result autorest.Response, err error) { +// loggerID - logger identifier. Must be unique in the API Management service instance. +func (client LoggerClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, loggerID string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LoggerClient.GetEntityTag") defer func() { @@ -346,13 +350,13 @@ func (client LoggerClient) GetEntityTag(ctx context.Context, resourceGroupName s Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: loggerid, - Constraints: []validation.Constraint{{Target: "loggerid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "loggerid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {TargetValue: loggerID, + Constraints: []validation.Constraint{{Target: "loggerID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "loggerID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.LoggerClient", "GetEntityTag", err.Error()) } - req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, loggerid) + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, loggerID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.LoggerClient", "GetEntityTag", nil, "Failure preparing request") return @@ -374,15 +378,15 @@ func (client LoggerClient) GetEntityTag(ctx context.Context, resourceGroupName s } // GetEntityTagPreparer prepares the GetEntityTag request. -func (client LoggerClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, loggerid string) (*http.Request, error) { +func (client LoggerClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, loggerID string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "loggerid": autorest.Encode("path", loggerid), + "loggerId": autorest.Encode("path", loggerID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -390,7 +394,7 @@ func (client LoggerClient) GetEntityTagPreparer(ctx context.Context, resourceGro preparer := autorest.CreatePreparer( autorest.AsHead(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -417,10 +421,11 @@ func (client LoggerClient) GetEntityTagResponder(resp *http.Response) (result au // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - | Field | Supported operators | Supported functions | -// |-------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | type | eq | | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| loggerType | filter | eq | |
| resourceId | +// filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. func (client LoggerClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result LoggerCollectionPage, err error) { @@ -478,7 +483,7 @@ func (client LoggerClient) ListByServicePreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -560,11 +565,11 @@ func (client LoggerClient) ListByServiceComplete(ctx context.Context, resourceGr // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// loggerid - logger identifier. Must be unique in the API Management service instance. +// loggerID - logger identifier. Must be unique in the API Management service instance. // parameters - update parameters. // ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET // request or it should be * for unconditional update. -func (client LoggerClient) Update(ctx context.Context, resourceGroupName string, serviceName string, loggerid string, parameters LoggerUpdateContract, ifMatch string) (result autorest.Response, err error) { +func (client LoggerClient) Update(ctx context.Context, resourceGroupName string, serviceName string, loggerID string, parameters LoggerUpdateContract, ifMatch string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LoggerClient.Update") defer func() { @@ -580,13 +585,13 @@ func (client LoggerClient) Update(ctx context.Context, resourceGroupName string, Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: loggerid, - Constraints: []validation.Constraint{{Target: "loggerid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "loggerid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {TargetValue: loggerID, + Constraints: []validation.Constraint{{Target: "loggerID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "loggerID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.LoggerClient", "Update", err.Error()) } - req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, loggerid, parameters, ifMatch) + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, loggerID, parameters, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.LoggerClient", "Update", nil, "Failure preparing request") return @@ -608,15 +613,15 @@ func (client LoggerClient) Update(ctx context.Context, resourceGroupName string, } // UpdatePreparer prepares the Update request. -func (client LoggerClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, loggerid string, parameters LoggerUpdateContract, ifMatch string) (*http.Request, error) { +func (client LoggerClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, loggerID string, parameters LoggerUpdateContract, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "loggerid": autorest.Encode("path", loggerid), + "loggerId": autorest.Encode("path", loggerID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -625,7 +630,7 @@ func (client LoggerClient) UpdatePreparer(ctx context.Context, resourceGroupName autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters), autorest.WithHeader("If-Match", autorest.String(ifMatch))) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/models.go similarity index 82% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/models.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/models.go index 66cc9d44cc66..e72abf72834d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/models.go @@ -30,7 +30,39 @@ import ( ) // The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" +const fqdn = "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" + +// AlwaysLog enumerates the values for always log. +type AlwaysLog string + +const ( + // AllErrors Always log all erroneous request regardless of sampling settings. + AllErrors AlwaysLog = "allErrors" +) + +// PossibleAlwaysLogValues returns an array of possible values for the AlwaysLog const type. +func PossibleAlwaysLogValues() []AlwaysLog { + return []AlwaysLog{AllErrors} +} + +// ApimIdentityType enumerates the values for apim identity type. +type ApimIdentityType string + +const ( + // None ... + None ApimIdentityType = "None" + // SystemAssigned ... + SystemAssigned ApimIdentityType = "SystemAssigned" + // SystemAssignedUserAssigned ... + SystemAssignedUserAssigned ApimIdentityType = "SystemAssigned, UserAssigned" + // UserAssigned ... + UserAssigned ApimIdentityType = "UserAssigned" +) + +// PossibleApimIdentityTypeValues returns an array of possible values for the ApimIdentityType const type. +func PossibleApimIdentityTypeValues() []ApimIdentityType { + return []ApimIdentityType{None, SystemAssigned, SystemAssignedUserAssigned, UserAssigned} +} // APIType enumerates the values for api type. type APIType string @@ -47,6 +79,19 @@ func PossibleAPITypeValues() []APIType { return []APIType{HTTP, Soap} } +// AppType enumerates the values for app type. +type AppType string + +const ( + // DeveloperPortal User create request was sent by new developer portal. + DeveloperPortal AppType = "developerPortal" +) + +// PossibleAppTypeValues returns an array of possible values for the AppType const type. +func PossibleAppTypeValues() []AppType { + return []AppType{DeveloperPortal} +} + // AsyncOperationStatus enumerates the values for async operation status. type AsyncOperationStatus string @@ -190,6 +235,14 @@ func PossibleConnectivityStatusTypeValues() []ConnectivityStatusType { type ContentFormat string const ( + // Openapi The contents are inline and Content Type is a OpenApi 3.0 Document in YAML format. + Openapi ContentFormat = "openapi" + // Openapijson The contents are inline and Content Type is a OpenApi 3.0 Document in JSON format. + Openapijson ContentFormat = "openapi+json" + // OpenapijsonLink The Open Api 3.0 Json document is hosted on a publicly accessible internet address. + OpenapijsonLink ContentFormat = "openapi+json-link" + // OpenapiLink The Open Api 3.0 document is hosted on a publicly accessible internet address. + OpenapiLink ContentFormat = "openapi-link" // SwaggerJSON The contents are inline and Content Type is a OpenApi 2.0 Document. SwaggerJSON ContentFormat = "swagger-json" // SwaggerLinkJSON The Open Api 2.0 document is hosted on a publicly accessible internet address. @@ -206,13 +259,18 @@ const ( // PossibleContentFormatValues returns an array of possible values for the ContentFormat const type. func PossibleContentFormatValues() []ContentFormat { - return []ContentFormat{SwaggerJSON, SwaggerLinkJSON, WadlLinkJSON, WadlXML, Wsdl, WsdlLink} + return []ContentFormat{Openapi, Openapijson, OpenapijsonLink, OpenapiLink, SwaggerJSON, SwaggerLinkJSON, WadlLinkJSON, WadlXML, Wsdl, WsdlLink} } // ExportFormat enumerates the values for export format. type ExportFormat string const ( + // ExportFormatOpenapi Export the Api Definition in OpenApi Specification 3.0 to Storage Blob. + ExportFormatOpenapi ExportFormat = "openapi-link" + // ExportFormatOpenapiJSON Export the Api Definition in OpenApi Specification 3.0 as JSON document to + // Storage Blob. + ExportFormatOpenapiJSON ExportFormat = "openapi+json-link" // ExportFormatSwagger Export the Api Definition in OpenApi Specification 2.0 format to the Storage Blob. ExportFormatSwagger ExportFormat = "swagger-link" // ExportFormatWadl Export the Api Definition in WADL Schema to Storage Blob. @@ -224,7 +282,28 @@ const ( // PossibleExportFormatValues returns an array of possible values for the ExportFormat const type. func PossibleExportFormatValues() []ExportFormat { - return []ExportFormat{ExportFormatSwagger, ExportFormatWadl, ExportFormatWsdl} + return []ExportFormat{ExportFormatOpenapi, ExportFormatOpenapiJSON, ExportFormatSwagger, ExportFormatWadl, ExportFormatWsdl} +} + +// ExportResultFormat enumerates the values for export result format. +type ExportResultFormat string + +const ( + // ExportResultFormatOpenAPI Export the Api Definition in OpenApi Specification 3.0 to Storage Blob. + ExportResultFormatOpenAPI ExportResultFormat = "openapi-link" + // ExportResultFormatSwagger The Api Definition is exported in OpenApi Specification 2.0 format to the + // Storage Blob. + ExportResultFormatSwagger ExportResultFormat = "swagger-link-json" + // ExportResultFormatWadl Export the Api Definition in WADL Schema to Storage Blob. + ExportResultFormatWadl ExportResultFormat = "wadl-link-json" + // ExportResultFormatWsdl The Api Definition is exported in WSDL Schema to Storage Blob. This is only + // supported for APIs of Type `soap` + ExportResultFormatWsdl ExportResultFormat = "wsdl-link+xml" +) + +// PossibleExportResultFormatValues returns an array of possible values for the ExportResultFormat const type. +func PossibleExportResultFormatValues() []ExportResultFormat { + return []ExportResultFormat{ExportResultFormatOpenAPI, ExportResultFormatSwagger, ExportResultFormatWadl, ExportResultFormatWsdl} } // GrantType enumerates the values for grant type. @@ -270,19 +349,40 @@ func PossibleGroupTypeValues() []GroupType { type HostnameType string const ( - // Management ... - Management HostnameType = "Management" - // Portal ... - Portal HostnameType = "Portal" - // Proxy ... - Proxy HostnameType = "Proxy" - // Scm ... - Scm HostnameType = "Scm" + // HostnameTypeDeveloperPortal ... + HostnameTypeDeveloperPortal HostnameType = "DeveloperPortal" + // HostnameTypeManagement ... + HostnameTypeManagement HostnameType = "Management" + // HostnameTypePortal ... + HostnameTypePortal HostnameType = "Portal" + // HostnameTypeProxy ... + HostnameTypeProxy HostnameType = "Proxy" + // HostnameTypeScm ... + HostnameTypeScm HostnameType = "Scm" ) // PossibleHostnameTypeValues returns an array of possible values for the HostnameType const type. func PossibleHostnameTypeValues() []HostnameType { - return []HostnameType{Management, Portal, Proxy, Scm} + return []HostnameType{HostnameTypeDeveloperPortal, HostnameTypeManagement, HostnameTypePortal, HostnameTypeProxy, HostnameTypeScm} +} + +// HTTPCorrelationProtocol enumerates the values for http correlation protocol. +type HTTPCorrelationProtocol string + +const ( + // HTTPCorrelationProtocolLegacy Inject Request-Id and Request-Context headers with request correlation + // data. See + // https://github.com/dotnet/corefx/blob/master/src/System.Diagnostics.DiagnosticSource/src/HttpCorrelationProtocol.md. + HTTPCorrelationProtocolLegacy HTTPCorrelationProtocol = "Legacy" + // HTTPCorrelationProtocolNone Do not read and inject correlation headers. + HTTPCorrelationProtocolNone HTTPCorrelationProtocol = "None" + // HTTPCorrelationProtocolW3C Inject Trace Context headers. See https://w3c.github.io/trace-context. + HTTPCorrelationProtocolW3C HTTPCorrelationProtocol = "W3C" +) + +// PossibleHTTPCorrelationProtocolValues returns an array of possible values for the HTTPCorrelationProtocol const type. +func PossibleHTTPCorrelationProtocolValues() []HTTPCorrelationProtocol { + return []HTTPCorrelationProtocol{HTTPCorrelationProtocolLegacy, HTTPCorrelationProtocolNone, HTTPCorrelationProtocolW3C} } // IdentityProviderType enumerates the values for identity provider type. @@ -406,6 +506,21 @@ func PossiblePolicyContentFormatValues() []PolicyContentFormat { return []PolicyContentFormat{Rawxml, RawxmlLink, XML, XMLLink} } +// PolicyExportFormat enumerates the values for policy export format. +type PolicyExportFormat string + +const ( + // PolicyExportFormatRawxml The contents are inline and Content type is a non XML encoded policy document. + PolicyExportFormatRawxml PolicyExportFormat = "rawxml" + // PolicyExportFormatXML The contents are inline and Content type is an XML document. + PolicyExportFormatXML PolicyExportFormat = "xml" +) + +// PossiblePolicyExportFormatValues returns an array of possible values for the PolicyExportFormat const type. +func PossiblePolicyExportFormatValues() []PolicyExportFormat { + return []PolicyExportFormat{PolicyExportFormatRawxml, PolicyExportFormatXML} +} + // PolicyScopeContract enumerates the values for policy scope contract. type PolicyScopeContract string @@ -457,21 +572,47 @@ func PossibleProtocolValues() []Protocol { return []Protocol{ProtocolHTTP, ProtocolHTTPS} } +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // Created ... + Created ProvisioningState = "created" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{Created} +} + // ResourceSkuCapacityScaleType enumerates the values for resource sku capacity scale type. type ResourceSkuCapacityScaleType string const ( - // Automatic ... - Automatic ResourceSkuCapacityScaleType = "automatic" - // Manual ... - Manual ResourceSkuCapacityScaleType = "manual" - // None ... - None ResourceSkuCapacityScaleType = "none" + // ResourceSkuCapacityScaleTypeAutomatic Supported scale type automatic. + ResourceSkuCapacityScaleTypeAutomatic ResourceSkuCapacityScaleType = "automatic" + // ResourceSkuCapacityScaleTypeManual Supported scale type manual. + ResourceSkuCapacityScaleTypeManual ResourceSkuCapacityScaleType = "manual" + // ResourceSkuCapacityScaleTypeNone Scaling not supported. + ResourceSkuCapacityScaleTypeNone ResourceSkuCapacityScaleType = "none" ) // PossibleResourceSkuCapacityScaleTypeValues returns an array of possible values for the ResourceSkuCapacityScaleType const type. func PossibleResourceSkuCapacityScaleTypeValues() []ResourceSkuCapacityScaleType { - return []ResourceSkuCapacityScaleType{Automatic, Manual, None} + return []ResourceSkuCapacityScaleType{ResourceSkuCapacityScaleTypeAutomatic, ResourceSkuCapacityScaleTypeManual, ResourceSkuCapacityScaleTypeNone} +} + +// SamplingType enumerates the values for sampling type. +type SamplingType string + +const ( + // Fixed Fixed-rate sampling. + Fixed SamplingType = "fixed" +) + +// PossibleSamplingTypeValues returns an array of possible values for the SamplingType const type. +func PossibleSamplingTypeValues() []SamplingType { + return []SamplingType{Fixed} } // SkuType enumerates the values for sku type. @@ -480,6 +621,8 @@ type SkuType string const ( // SkuTypeBasic Basic SKU of Api Management. SkuTypeBasic SkuType = "Basic" + // SkuTypeConsumption Consumption SKU of Api Management. + SkuTypeConsumption SkuType = "Consumption" // SkuTypeDeveloper Developer SKU of Api Management. SkuTypeDeveloper SkuType = "Developer" // SkuTypePremium Premium SKU of Api Management. @@ -490,7 +633,7 @@ const ( // PossibleSkuTypeValues returns an array of possible values for the SkuType const type. func PossibleSkuTypeValues() []SkuType { - return []SkuType{SkuTypeBasic, SkuTypeDeveloper, SkuTypePremium, SkuTypeStandard} + return []SkuType{SkuTypeBasic, SkuTypeConsumption, SkuTypeDeveloper, SkuTypePremium, SkuTypeStandard} } // SoapAPIType enumerates the values for soap api type. @@ -625,6 +768,26 @@ func PossibleUserStateValues() []UserState { return []UserState{UserStateActive, UserStateBlocked, UserStateDeleted, UserStatePending} } +// Verbosity enumerates the values for verbosity. +type Verbosity string + +const ( + // Error Only traces with 'severity' set to 'error' will be sent to the logger attached to this diagnostic + // instance. + Error Verbosity = "error" + // Information Traces with 'severity' set to 'information' and 'error' will be sent to the logger attached + // to this diagnostic instance. + Information Verbosity = "information" + // Verbose All the traces emitted by trace policies will be sent to the logger attached to this diagnostic + // instance. + Verbose Verbosity = "verbose" +) + +// PossibleVerbosityValues returns an array of possible values for the Verbosity const type. +func PossibleVerbosityValues() []Verbosity { + return []Verbosity{Error, Information, Verbose} +} + // VersioningScheme enumerates the values for versioning scheme. type VersioningScheme string @@ -682,21 +845,60 @@ type AccessInformationContract struct { autorest.Response `json:"-"` // ID - Identifier. ID *string `json:"id,omitempty"` - // PrimaryKey - Primary access key. + // PrimaryKey - Primary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. PrimaryKey *string `json:"primaryKey,omitempty"` - // SecondaryKey - Secondary access key. + // SecondaryKey - Secondary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. SecondaryKey *string `json:"secondaryKey,omitempty"` - // Enabled - Tenant access information of the API Management service. + // Enabled - Determines whether direct access is enabled. Enabled *bool `json:"enabled,omitempty"` } -// AccessInformationUpdateParameters tenant access information update parameters of the API Management -// service. -type AccessInformationUpdateParameters struct { - // Enabled - Tenant access information of the API Management service. +// AccessInformationUpdateParameterProperties tenant access information update parameters of the API +// Management service +type AccessInformationUpdateParameterProperties struct { + // Enabled - Determines whether direct access is enabled. Enabled *bool `json:"enabled,omitempty"` } +// AccessInformationUpdateParameters tenant access information update parameters. +type AccessInformationUpdateParameters struct { + // AccessInformationUpdateParameterProperties - Tenant access information update parameter properties. + *AccessInformationUpdateParameterProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for AccessInformationUpdateParameters. +func (aiup AccessInformationUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if aiup.AccessInformationUpdateParameterProperties != nil { + objectMap["properties"] = aiup.AccessInformationUpdateParameterProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AccessInformationUpdateParameters struct. +func (aiup *AccessInformationUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var accessInformationUpdateParameterProperties AccessInformationUpdateParameterProperties + err = json.Unmarshal(*v, &accessInformationUpdateParameterProperties) + if err != nil { + return err + } + aiup.AccessInformationUpdateParameterProperties = &accessInformationUpdateParameterProperties + } + } + } + + return nil +} + // AdditionalLocation description of an additional API Management resource location. type AdditionalLocation struct { // Location - The location name of the additional region among Azure Data center regions. @@ -711,6 +913,8 @@ type AdditionalLocation struct { VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` // GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Region. GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` + // DisableGateway - Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway in this additional location. + DisableGateway *bool `json:"disableGateway,omitempty"` } // APICollection paged Api list representation. @@ -859,7 +1063,7 @@ func NewAPICollectionPage(getNextPage func(context.Context, APICollection) (APIC return APICollectionPage{fn: getNextPage} } -// APIContract API details. +// APIContract api details. type APIContract struct { autorest.Response `json:"-"` // APIContractProperties - Api entity contract properties. @@ -934,14 +1138,17 @@ func (ac *APIContract) UnmarshalJSON(body []byte) error { // APIContractProperties api Entity Properties type APIContractProperties struct { - // DisplayName - API name. + // SourceAPIID - API identifier of the source API. + SourceAPIID *string `json:"sourceApiId,omitempty"` + // DisplayName - API name. Must be 1 to 300 characters long. DisplayName *string `json:"displayName,omitempty"` - // ServiceURL - Absolute URL of the backend service implementing this API. + // ServiceURL - Absolute URL of the backend service implementing this API. Cannot be more than 2000 characters long. ServiceURL *string `json:"serviceUrl,omitempty"` // 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. Path *string `json:"path,omitempty"` // Protocols - Describes on which protocols the operations in this API can be invoked. - Protocols *[]Protocol `json:"protocols,omitempty"` + Protocols *[]Protocol `json:"protocols,omitempty"` + // APIVersionSet - Version set details APIVersionSet *APIVersionSetContractDetails `json:"apiVersionSet,omitempty"` // Description - Description of the API. May include HTML formatting tags. Description *string `json:"description,omitempty"` @@ -955,7 +1162,7 @@ type APIContractProperties struct { APIRevision *string `json:"apiRevision,omitempty"` // APIVersion - Indicates the Version identifier of the API if the API is versioned APIVersion *string `json:"apiVersion,omitempty"` - // IsCurrent - READ-ONLY; Indicates if API revision is current api revision. + // IsCurrent - Indicates if API revision is current api revision. IsCurrent *bool `json:"isCurrent,omitempty"` // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. IsOnline *bool `json:"isOnline,omitempty"` @@ -965,6 +1172,8 @@ type APIContractProperties struct { APIVersionDescription *string `json:"apiVersionDescription,omitempty"` // APIVersionSetID - A resource identifier for the related ApiVersionSet. APIVersionSetID *string `json:"apiVersionSetId,omitempty"` + // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. + SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` } // APIContractUpdateProperties API update contract properties. @@ -989,7 +1198,7 @@ type APIContractUpdateProperties struct { APIRevision *string `json:"apiRevision,omitempty"` // APIVersion - Indicates the Version identifier of the API if the API is versioned APIVersion *string `json:"apiVersion,omitempty"` - // IsCurrent - READ-ONLY; Indicates if API revision is current api revision. + // IsCurrent - Indicates if API revision is current api revision. IsCurrent *bool `json:"isCurrent,omitempty"` // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. IsOnline *bool `json:"isOnline,omitempty"` @@ -999,6 +1208,37 @@ type APIContractUpdateProperties struct { APIVersionDescription *string `json:"apiVersionDescription,omitempty"` // APIVersionSetID - A resource identifier for the related ApiVersionSet. APIVersionSetID *string `json:"apiVersionSetId,omitempty"` + // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. + SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` +} + +// APICreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type APICreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *APICreateOrUpdateFuture) Result(client APIClient) (ac APIContract, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APICreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("apimanagement.APICreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ac.Response.Response, err = future.GetResult(sender); err == nil && ac.Response.Response.StatusCode != http.StatusNoContent { + ac, err = client.CreateOrUpdateResponder(ac.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APICreateOrUpdateFuture", "Result", ac.Response.Response, "Failure responding to request") + } + } + return } // APICreateOrUpdateParameter API Create or Update Parameters. @@ -1042,24 +1282,27 @@ func (acoup *APICreateOrUpdateParameter) UnmarshalJSON(body []byte) error { // APICreateOrUpdateProperties api Create or Update Properties. type APICreateOrUpdateProperties struct { - // ContentValue - Content value when Importing an API. - ContentValue *string `json:"contentValue,omitempty"` - // ContentFormat - Format of the Content in which the API is getting imported. Possible values include: 'WadlXML', 'WadlLinkJSON', 'SwaggerJSON', 'SwaggerLinkJSON', 'Wsdl', 'WsdlLink' - ContentFormat ContentFormat `json:"contentFormat,omitempty"` + // Value - Content value when Importing an API. + Value *string `json:"value,omitempty"` + // Format - Format of the Content in which the API is getting imported. Possible values include: 'WadlXML', 'WadlLinkJSON', 'SwaggerJSON', 'SwaggerLinkJSON', 'Wsdl', 'WsdlLink', 'Openapi', 'Openapijson', 'OpenapiLink', 'OpenapijsonLink' + Format ContentFormat `json:"format,omitempty"` // WsdlSelector - Criteria to limit import of WSDL to a subset of the document. WsdlSelector *APICreateOrUpdatePropertiesWsdlSelector `json:"wsdlSelector,omitempty"` // SoapAPIType - Type of Api to create. // * `http` creates a SOAP to REST API // * `soap` creates a SOAP pass-through API. Possible values include: 'SoapToRest', 'SoapPassThrough' SoapAPIType SoapAPIType `json:"apiType,omitempty"` - // DisplayName - API name. + // SourceAPIID - API identifier of the source API. + SourceAPIID *string `json:"sourceApiId,omitempty"` + // DisplayName - API name. Must be 1 to 300 characters long. DisplayName *string `json:"displayName,omitempty"` - // ServiceURL - Absolute URL of the backend service implementing this API. + // ServiceURL - Absolute URL of the backend service implementing this API. Cannot be more than 2000 characters long. ServiceURL *string `json:"serviceUrl,omitempty"` // 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. Path *string `json:"path,omitempty"` // Protocols - Describes on which protocols the operations in this API can be invoked. - Protocols *[]Protocol `json:"protocols,omitempty"` + Protocols *[]Protocol `json:"protocols,omitempty"` + // APIVersionSet - Version set details APIVersionSet *APIVersionSetContractDetails `json:"apiVersionSet,omitempty"` // Description - Description of the API. May include HTML formatting tags. Description *string `json:"description,omitempty"` @@ -1073,7 +1316,7 @@ type APICreateOrUpdateProperties struct { APIRevision *string `json:"apiRevision,omitempty"` // APIVersion - Indicates the Version identifier of the API if the API is versioned APIVersion *string `json:"apiVersion,omitempty"` - // IsCurrent - READ-ONLY; Indicates if API revision is current api revision. + // IsCurrent - Indicates if API revision is current api revision. IsCurrent *bool `json:"isCurrent,omitempty"` // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. IsOnline *bool `json:"isOnline,omitempty"` @@ -1083,6 +1326,8 @@ type APICreateOrUpdateProperties struct { APIVersionDescription *string `json:"apiVersionDescription,omitempty"` // APIVersionSetID - A resource identifier for the related ApiVersionSet. APIVersionSetID *string `json:"apiVersionSetId,omitempty"` + // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. + SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` } // APICreateOrUpdatePropertiesWsdlSelector criteria to limit import of WSDL to a subset of the document. @@ -1107,7 +1352,7 @@ type APIEntityBaseContract struct { APIRevision *string `json:"apiRevision,omitempty"` // APIVersion - Indicates the Version identifier of the API if the API is versioned APIVersion *string `json:"apiVersion,omitempty"` - // IsCurrent - READ-ONLY; Indicates if API revision is current api revision. + // IsCurrent - Indicates if API revision is current api revision. IsCurrent *bool `json:"isCurrent,omitempty"` // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. IsOnline *bool `json:"isOnline,omitempty"` @@ -1117,11 +1362,23 @@ type APIEntityBaseContract struct { APIVersionDescription *string `json:"apiVersionDescription,omitempty"` // APIVersionSetID - A resource identifier for the related ApiVersionSet. APIVersionSetID *string `json:"apiVersionSetId,omitempty"` + // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. + SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` } -// APIExportResult API Export result Blob Uri. +// APIExportResult API Export result. type APIExportResult struct { autorest.Response `json:"-"` + // ID - ResourceId of the API which was exported. + ID *string `json:"id,omitempty"` + // ExportResultFormat - Format in which the Api Details are exported to the Storage Blob with Sas Key valid for 5 minutes. Possible values include: 'ExportResultFormatSwagger', 'ExportResultFormatWsdl', 'ExportResultFormatWadl', 'ExportResultFormatOpenAPI' + ExportResultFormat ExportResultFormat `json:"format,omitempty"` + // Value - The object defining the schema of the exported Api Detail + Value *APIExportResultValue `json:"value,omitempty"` +} + +// APIExportResultValue the object defining the schema of the exported Api Detail +type APIExportResultValue struct { // Link - Link to the Storage Blob containing the result of the export operation. The Blob Uri is only valid for 5 minutes. Link *string `json:"link,omitempty"` } @@ -1147,7 +1404,7 @@ func (ar ApimResource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// APIReleaseCollection paged Api Revision list representation. +// APIReleaseCollection paged ApiRelease list representation. type APIReleaseCollection struct { autorest.Response `json:"-"` // Value - READ-ONLY; Page values. @@ -1293,10 +1550,10 @@ func NewAPIReleaseCollectionPage(getNextPage func(context.Context, APIReleaseCol return APIReleaseCollectionPage{fn: getNextPage} } -// APIReleaseContract api Release details. +// APIReleaseContract apiRelease details. type APIReleaseContract struct { autorest.Response `json:"-"` - // APIReleaseContractProperties - Properties of the Api Release Contract. + // APIReleaseContractProperties - ApiRelease entity contract properties. *APIReleaseContractProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` @@ -1557,6 +1814,35 @@ type APIRevisionInfoContract struct { APIVersionSet *APIVersionSetContractDetails `json:"apiVersionSet,omitempty"` } +// APISchemaCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type APISchemaCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *APISchemaCreateOrUpdateFuture) Result(client APISchemaClient) (sc SchemaContract, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APISchemaCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("apimanagement.APISchemaCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sc.Response.Response, err = future.GetResult(sender); err == nil && sc.Response.Response.StatusCode != http.StatusNoContent { + sc, err = client.CreateOrUpdateResponder(sc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APISchemaCreateOrUpdateFuture", "Result", sc.Response.Response, "Failure responding to request") + } + } + return +} + // APITagResourceContractProperties API contract properties for the Tag Resources. type APITagResourceContractProperties struct { // ID - API identifier in the form /apis/{apiId}. @@ -1581,7 +1867,7 @@ type APITagResourceContractProperties struct { APIRevision *string `json:"apiRevision,omitempty"` // APIVersion - Indicates the Version identifier of the API if the API is versioned APIVersion *string `json:"apiVersion,omitempty"` - // IsCurrent - READ-ONLY; Indicates if API revision is current api revision. + // IsCurrent - Indicates if API revision is current api revision. IsCurrent *bool `json:"isCurrent,omitempty"` // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. IsOnline *bool `json:"isOnline,omitempty"` @@ -1591,6 +1877,8 @@ type APITagResourceContractProperties struct { APIVersionDescription *string `json:"apiVersionDescription,omitempty"` // APIVersionSetID - A resource identifier for the related ApiVersionSet. APIVersionSetID *string `json:"apiVersionSetId,omitempty"` + // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. + SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` } // APIUpdateContract API update contract details. @@ -1632,6 +1920,12 @@ func (auc *APIUpdateContract) UnmarshalJSON(body []byte) error { return nil } +// APIVersionConstraint control Plane Apis version constraint for the API Management service. +type APIVersionConstraint struct { + // MinAPIVersion - Limit control plane API calls to API Management service with version equal to or newer than this value. + MinAPIVersion *string `json:"minApiVersion,omitempty"` +} + // APIVersionSetCollection paged Api Version Set list representation. type APIVersionSetCollection struct { autorest.Response `json:"-"` @@ -1856,6 +2150,8 @@ func (avsc *APIVersionSetContract) UnmarshalJSON(body []byte) error { type APIVersionSetContractDetails struct { // ID - Identifier for existing API Version Set. Omit this value to create a new Version Set. ID *string `json:"id,omitempty"` + // Name - The display Name of the API Version Set. + Name *string `json:"name,omitempty"` // Description - Description of API Version Set. Description *string `json:"description,omitempty"` // VersioningScheme - An value that determines where the API Version identifer will be located in a HTTP request. Possible values include: 'VersioningScheme1Segment', 'VersioningScheme1Query', 'VersioningScheme1Header' @@ -1943,14 +2239,90 @@ type APIVersionSetUpdateParametersProperties struct { VersionHeaderName *string `json:"versionHeaderName,omitempty"` } +// AssociationContract association entity details. +type AssociationContract struct { + // AssociationContractProperties - Association entity contract properties. + *AssociationContractProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AssociationContract. +func (ac AssociationContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ac.AssociationContractProperties != nil { + objectMap["properties"] = ac.AssociationContractProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AssociationContract struct. +func (ac *AssociationContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var associationContractProperties AssociationContractProperties + err = json.Unmarshal(*v, &associationContractProperties) + if err != nil { + return err + } + ac.AssociationContractProperties = &associationContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ac.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ac.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ac.Type = &typeVar + } + } + } + + return nil +} + +// AssociationContractProperties association entity contract properties. +type AssociationContractProperties struct { + // ProvisioningState - Provisioning state. Possible values include: 'Created' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + // AuthenticationSettingsContract API Authentication Settings. type AuthenticationSettingsContract struct { // OAuth2 - OAuth2 Authentication settings OAuth2 *OAuth2AuthenticationSettingsContract `json:"oAuth2,omitempty"` // Openid - OpenID Connect Authentication Settings Openid *OpenIDAuthenticationSettingsContract `json:"openid,omitempty"` - // SubscriptionKeyRequired - Specifies whether subscription key is required during call to this API, true - API is included into closed products only, false - API is included into open products alone, null - there is a mix of products. - SubscriptionKeyRequired *bool `json:"subscriptionKeyRequired,omitempty"` } // AuthorizationServerCollection paged OAuth2 Authorization Servers list representation. @@ -2193,8 +2565,6 @@ type AuthorizationServerContractBaseProperties struct { DefaultScope *string `json:"defaultScope,omitempty"` // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"` - // ClientSecret - Client or app secret registered with this authorization server. - ClientSecret *string `json:"clientSecret,omitempty"` // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. @@ -2213,6 +2583,8 @@ type AuthorizationServerContractProperties struct { GrantTypes *[]GrantType `json:"grantTypes,omitempty"` // ClientID - Client or app id registered with this authorization server. ClientID *string `json:"clientId,omitempty"` + // ClientSecret - Client or app secret registered with this authorization server. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + ClientSecret *string `json:"clientSecret,omitempty"` // Description - Description of the authorization server. Can contain HTML formatting tags. Description *string `json:"description,omitempty"` // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. @@ -2229,8 +2601,6 @@ type AuthorizationServerContractProperties struct { DefaultScope *string `json:"defaultScope,omitempty"` // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"` - // ClientSecret - Client or app secret registered with this authorization server. - ClientSecret *string `json:"clientSecret,omitempty"` // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. @@ -2322,6 +2692,8 @@ type AuthorizationServerUpdateContractProperties struct { GrantTypes *[]GrantType `json:"grantTypes,omitempty"` // ClientID - Client or app id registered with this authorization server. ClientID *string `json:"clientId,omitempty"` + // ClientSecret - Client or app secret registered with this authorization server. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + ClientSecret *string `json:"clientSecret,omitempty"` // Description - Description of the authorization server. Can contain HTML formatting tags. Description *string `json:"description,omitempty"` // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. @@ -2338,8 +2710,6 @@ type AuthorizationServerUpdateContractProperties struct { DefaultScope *string `json:"defaultScope,omitempty"` // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"` - // ClientSecret - Client or app secret registered with this authorization server. - ClientSecret *string `json:"clientSecret,omitempty"` // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. @@ -2820,26 +3190,32 @@ func (bup *BackendUpdateParameters) UnmarshalJSON(body []byte) error { return nil } -// CertificateCollection paged Certificates list representation. -type CertificateCollection struct { +// BodyDiagnosticSettings body logging settings. +type BodyDiagnosticSettings struct { + // Bytes - Number of request body bytes to log. + Bytes *int32 `json:"bytes,omitempty"` +} + +// CacheCollection paged Caches list representation. +type CacheCollection struct { autorest.Response `json:"-"` // Value - Page values. - Value *[]CertificateContract `json:"value,omitempty"` + Value *[]CacheContract `json:"value,omitempty"` // NextLink - Next page link if any. NextLink *string `json:"nextLink,omitempty"` } -// CertificateCollectionIterator provides access to a complete listing of CertificateContract values. -type CertificateCollectionIterator struct { +// CacheCollectionIterator provides access to a complete listing of CacheContract values. +type CacheCollectionIterator struct { i int - page CertificateCollectionPage + page CacheCollectionPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *CertificateCollectionIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *CacheCollectionIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CertificateCollectionIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/CacheCollectionIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -2864,42 +3240,42 @@ func (iter *CertificateCollectionIterator) NextWithContext(ctx context.Context) // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *CertificateCollectionIterator) Next() error { +func (iter *CacheCollectionIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CertificateCollectionIterator) NotDone() bool { +func (iter CacheCollectionIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. -func (iter CertificateCollectionIterator) Response() CertificateCollection { +func (iter CacheCollectionIterator) Response() CacheCollection { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter CertificateCollectionIterator) Value() CertificateContract { +func (iter CacheCollectionIterator) Value() CacheContract { if !iter.page.NotDone() { - return CertificateContract{} + return CacheContract{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the CertificateCollectionIterator type. -func NewCertificateCollectionIterator(page CertificateCollectionPage) CertificateCollectionIterator { - return CertificateCollectionIterator{page: page} +// Creates a new instance of the CacheCollectionIterator type. +func NewCacheCollectionIterator(page CacheCollectionPage) CacheCollectionIterator { + return CacheCollectionIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (cc CertificateCollection) IsEmpty() bool { +func (cc CacheCollection) IsEmpty() bool { return cc.Value == nil || len(*cc.Value) == 0 } -// certificateCollectionPreparer prepares a request to retrieve the next set of results. +// cacheCollectionPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (cc CertificateCollection) certificateCollectionPreparer(ctx context.Context) (*http.Request, error) { +func (cc CacheCollection) cacheCollectionPreparer(ctx context.Context) (*http.Request, error) { if cc.NextLink == nil || len(to.String(cc.NextLink)) < 1 { return nil, nil } @@ -2909,17 +3285,17 @@ func (cc CertificateCollection) certificateCollectionPreparer(ctx context.Contex autorest.WithBaseURL(to.String(cc.NextLink))) } -// CertificateCollectionPage contains a page of CertificateContract values. -type CertificateCollectionPage struct { - fn func(context.Context, CertificateCollection) (CertificateCollection, error) - cc CertificateCollection +// CacheCollectionPage contains a page of CacheContract values. +type CacheCollectionPage struct { + fn func(context.Context, CacheCollection) (CacheCollection, error) + cc CacheCollection } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *CertificateCollectionPage) NextWithContext(ctx context.Context) (err error) { +func (page *CacheCollectionPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CertificateCollectionPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/CacheCollectionPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -2939,51 +3315,38 @@ func (page *CertificateCollectionPage) NextWithContext(ctx context.Context) (err // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (page *CertificateCollectionPage) Next() error { +func (page *CacheCollectionPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CertificateCollectionPage) NotDone() bool { +func (page CacheCollectionPage) NotDone() bool { return !page.cc.IsEmpty() } // Response returns the raw server response from the last page request. -func (page CertificateCollectionPage) Response() CertificateCollection { +func (page CacheCollectionPage) Response() CacheCollection { return page.cc } // Values returns the slice of values for the current page or nil if there are no values. -func (page CertificateCollectionPage) Values() []CertificateContract { +func (page CacheCollectionPage) Values() []CacheContract { if page.cc.IsEmpty() { return nil } return *page.cc.Value } -// Creates a new instance of the CertificateCollectionPage type. -func NewCertificateCollectionPage(getNextPage func(context.Context, CertificateCollection) (CertificateCollection, error)) CertificateCollectionPage { - return CertificateCollectionPage{fn: getNextPage} +// Creates a new instance of the CacheCollectionPage type. +func NewCacheCollectionPage(getNextPage func(context.Context, CacheCollection) (CacheCollection, error)) CacheCollectionPage { + return CacheCollectionPage{fn: getNextPage} } -// CertificateConfiguration certificate configuration which consist of non-trusted intermediates and root -// certificates. -type CertificateConfiguration struct { - // EncodedCertificate - Base64 Encoded certificate. - EncodedCertificate *string `json:"encodedCertificate,omitempty"` - // CertificatePassword - Certificate Password. - CertificatePassword *string `json:"certificatePassword,omitempty"` - // StoreName - The System.Security.Cryptography.x509certificates.StoreName certificate store location. Only Root and CertificateAuthority are valid locations. Possible values include: 'CertificateAuthority', 'Root' - StoreName StoreName `json:"storeName,omitempty"` - // Certificate - Certificate information. - Certificate *CertificateInformation `json:"certificate,omitempty"` -} - -// CertificateContract certificate details. -type CertificateContract struct { +// CacheContract cache details. +type CacheContract struct { autorest.Response `json:"-"` - // CertificateContractProperties - Certificate properties details. - *CertificateContractProperties `json:"properties,omitempty"` + // CacheContractProperties - Cache properties details. + *CacheContractProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -2992,17 +3355,17 @@ type CertificateContract struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for CertificateContract. -func (cc CertificateContract) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for CacheContract. +func (cc CacheContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if cc.CertificateContractProperties != nil { - objectMap["properties"] = cc.CertificateContractProperties + if cc.CacheContractProperties != nil { + objectMap["properties"] = cc.CacheContractProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for CertificateContract struct. -func (cc *CertificateContract) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for CacheContract struct. +func (cc *CacheContract) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -3012,12 +3375,12 @@ func (cc *CertificateContract) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var certificateContractProperties CertificateContractProperties - err = json.Unmarshal(*v, &certificateContractProperties) + var cacheContractProperties CacheContractProperties + err = json.Unmarshal(*v, &cacheContractProperties) if err != nil { return err } - cc.CertificateContractProperties = &certificateContractProperties + cc.CacheContractProperties = &cacheContractProperties } case "id": if v != nil { @@ -3052,33 +3415,33 @@ func (cc *CertificateContract) UnmarshalJSON(body []byte) error { return nil } -// CertificateContractProperties properties of the Certificate contract. -type CertificateContractProperties struct { - // Subject - Subject attribute of the certificate. - Subject *string `json:"subject,omitempty"` - // Thumbprint - Thumbprint of the certificate. - Thumbprint *string `json:"thumbprint,omitempty"` - // 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. - ExpirationDate *date.Time `json:"expirationDate,omitempty"` +// CacheContractProperties properties of the Cache contract. +type CacheContractProperties struct { + // Description - Cache description + Description *string `json:"description,omitempty"` + // ConnectionString - Runtime connection string to cache + ConnectionString *string `json:"connectionString,omitempty"` + // ResourceID - Original uri of entity in external system cache points to + ResourceID *string `json:"resourceId,omitempty"` } -// CertificateCreateOrUpdateParameters certificate create or update details. -type CertificateCreateOrUpdateParameters struct { - // CertificateCreateOrUpdateProperties - Certificate create or update properties details. - *CertificateCreateOrUpdateProperties `json:"properties,omitempty"` +// CacheUpdateParameters cache update details. +type CacheUpdateParameters struct { + // CacheUpdateProperties - Cache update properties details. + *CacheUpdateProperties `json:"properties,omitempty"` } -// MarshalJSON is the custom marshaler for CertificateCreateOrUpdateParameters. -func (ccoup CertificateCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for CacheUpdateParameters. +func (cup CacheUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if ccoup.CertificateCreateOrUpdateProperties != nil { - objectMap["properties"] = ccoup.CertificateCreateOrUpdateProperties + if cup.CacheUpdateProperties != nil { + objectMap["properties"] = cup.CacheUpdateProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for CertificateCreateOrUpdateParameters struct. -func (ccoup *CertificateCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for CacheUpdateParameters struct. +func (cup *CacheUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -3088,12 +3451,12 @@ func (ccoup *CertificateCreateOrUpdateParameters) UnmarshalJSON(body []byte) err switch k { case "properties": if v != nil { - var certificateCreateOrUpdateProperties CertificateCreateOrUpdateProperties - err = json.Unmarshal(*v, &certificateCreateOrUpdateProperties) + var cacheUpdateProperties CacheUpdateProperties + err = json.Unmarshal(*v, &cacheUpdateProperties) if err != nil { return err } - ccoup.CertificateCreateOrUpdateProperties = &certificateCreateOrUpdateProperties + cup.CacheUpdateProperties = &cacheUpdateProperties } } } @@ -3101,74 +3464,36 @@ func (ccoup *CertificateCreateOrUpdateParameters) UnmarshalJSON(body []byte) err return nil } -// CertificateCreateOrUpdateProperties parameters supplied to the CreateOrUpdate certificate operation. -type CertificateCreateOrUpdateProperties struct { - // Data - Base 64 encoded certificate using the application/x-pkcs12 representation. - Data *string `json:"data,omitempty"` - // Password - Password for the Certificate - Password *string `json:"password,omitempty"` -} - -// CertificateInformation SSL certificate information. -type CertificateInformation struct { - autorest.Response `json:"-"` - // Expiry - Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. - Expiry *date.Time `json:"expiry,omitempty"` - // Thumbprint - Thumbprint of the certificate. - Thumbprint *string `json:"thumbprint,omitempty"` - // Subject - Subject of the certificate. - Subject *string `json:"subject,omitempty"` -} - -// ConnectivityStatusContract details about connectivity to a resource. -type ConnectivityStatusContract struct { - // Name - The hostname of the resource which the service depends on. This can be the database, storage or any other azure resource on which the service depends upon. - Name *string `json:"name,omitempty"` - // Status - Resource Connectivity Status Type identifier. Possible values include: 'Initializing', 'Success', 'Failure' - Status ConnectivityStatusType `json:"status,omitempty"` - // Error - Error details of the connectivity to the resource. - Error *string `json:"error,omitempty"` - // LastUpdated - The date when the resource connectivity status was last updated. This status should be updated every 15 minutes. If this status has not been updated, then it means that the service has lost network connectivity to the resource, from inside the Virtual Network.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. - LastUpdated *date.Time `json:"lastUpdated,omitempty"` - // LastStatusChange - The date when the resource connectivity status last Changed from success to failure or vice-versa. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. - LastStatusChange *date.Time `json:"lastStatusChange,omitempty"` -} - -// CurrentUserIdentity ... -type CurrentUserIdentity struct { - autorest.Response `json:"-"` - // ID - API Management service user id. - ID *string `json:"id,omitempty"` -} - -// DeployConfigurationParameters parameters supplied to the Deploy Configuration operation. -type DeployConfigurationParameters struct { - // Branch - The name of the Git branch from which the configuration is to be deployed to the configuration database. - Branch *string `json:"branch,omitempty"` - // Force - The value enforcing deleting subscriptions to products that are deleted in this update. - Force *bool `json:"force,omitempty"` +// CacheUpdateProperties parameters supplied to the Update Cache operation. +type CacheUpdateProperties struct { + // Description - Cache description + Description *string `json:"description,omitempty"` + // ConnectionString - Runtime connection string to cache + ConnectionString *string `json:"connectionString,omitempty"` + // ResourceID - Original uri of entity in external system cache points to + ResourceID *string `json:"resourceId,omitempty"` } -// DiagnosticCollection paged Diagnostic list representation. -type DiagnosticCollection struct { +// CertificateCollection paged Certificates list representation. +type CertificateCollection struct { autorest.Response `json:"-"` // Value - Page values. - Value *[]DiagnosticContract `json:"value,omitempty"` + Value *[]CertificateContract `json:"value,omitempty"` // NextLink - Next page link if any. NextLink *string `json:"nextLink,omitempty"` } -// DiagnosticCollectionIterator provides access to a complete listing of DiagnosticContract values. -type DiagnosticCollectionIterator struct { +// CertificateCollectionIterator provides access to a complete listing of CertificateContract values. +type CertificateCollectionIterator struct { i int - page DiagnosticCollectionPage + page CertificateCollectionPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *DiagnosticCollectionIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *CertificateCollectionIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticCollectionIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/CertificateCollectionIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -3193,62 +3518,62 @@ func (iter *DiagnosticCollectionIterator) NextWithContext(ctx context.Context) ( // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *DiagnosticCollectionIterator) Next() error { +func (iter *CertificateCollectionIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DiagnosticCollectionIterator) NotDone() bool { +func (iter CertificateCollectionIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. -func (iter DiagnosticCollectionIterator) Response() DiagnosticCollection { +func (iter CertificateCollectionIterator) Response() CertificateCollection { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter DiagnosticCollectionIterator) Value() DiagnosticContract { +func (iter CertificateCollectionIterator) Value() CertificateContract { if !iter.page.NotDone() { - return DiagnosticContract{} + return CertificateContract{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the DiagnosticCollectionIterator type. -func NewDiagnosticCollectionIterator(page DiagnosticCollectionPage) DiagnosticCollectionIterator { - return DiagnosticCollectionIterator{page: page} +// Creates a new instance of the CertificateCollectionIterator type. +func NewCertificateCollectionIterator(page CertificateCollectionPage) CertificateCollectionIterator { + return CertificateCollectionIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (dc DiagnosticCollection) IsEmpty() bool { - return dc.Value == nil || len(*dc.Value) == 0 +func (cc CertificateCollection) IsEmpty() bool { + return cc.Value == nil || len(*cc.Value) == 0 } -// diagnosticCollectionPreparer prepares a request to retrieve the next set of results. +// certificateCollectionPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (dc DiagnosticCollection) diagnosticCollectionPreparer(ctx context.Context) (*http.Request, error) { - if dc.NextLink == nil || len(to.String(dc.NextLink)) < 1 { +func (cc CertificateCollection) certificateCollectionPreparer(ctx context.Context) (*http.Request, error) { + if cc.NextLink == nil || len(to.String(cc.NextLink)) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(dc.NextLink))) + autorest.WithBaseURL(to.String(cc.NextLink))) } -// DiagnosticCollectionPage contains a page of DiagnosticContract values. -type DiagnosticCollectionPage struct { - fn func(context.Context, DiagnosticCollection) (DiagnosticCollection, error) - dc DiagnosticCollection +// CertificateCollectionPage contains a page of CertificateContract values. +type CertificateCollectionPage struct { + fn func(context.Context, CertificateCollection) (CertificateCollection, error) + cc CertificateCollection } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *DiagnosticCollectionPage) NextWithContext(ctx context.Context) (err error) { +func (page *CertificateCollectionPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticCollectionPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/CertificateCollectionPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -3257,49 +3582,62 @@ func (page *DiagnosticCollectionPage) NextWithContext(ctx context.Context) (err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.dc) + next, err := page.fn(ctx, page.cc) if err != nil { return err } - page.dc = next + page.cc = next return nil } // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (page *DiagnosticCollectionPage) Next() error { +func (page *CertificateCollectionPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DiagnosticCollectionPage) NotDone() bool { - return !page.dc.IsEmpty() +func (page CertificateCollectionPage) NotDone() bool { + return !page.cc.IsEmpty() } // Response returns the raw server response from the last page request. -func (page DiagnosticCollectionPage) Response() DiagnosticCollection { - return page.dc +func (page CertificateCollectionPage) Response() CertificateCollection { + return page.cc } // Values returns the slice of values for the current page or nil if there are no values. -func (page DiagnosticCollectionPage) Values() []DiagnosticContract { - if page.dc.IsEmpty() { +func (page CertificateCollectionPage) Values() []CertificateContract { + if page.cc.IsEmpty() { return nil } - return *page.dc.Value + return *page.cc.Value } -// Creates a new instance of the DiagnosticCollectionPage type. -func NewDiagnosticCollectionPage(getNextPage func(context.Context, DiagnosticCollection) (DiagnosticCollection, error)) DiagnosticCollectionPage { - return DiagnosticCollectionPage{fn: getNextPage} +// Creates a new instance of the CertificateCollectionPage type. +func NewCertificateCollectionPage(getNextPage func(context.Context, CertificateCollection) (CertificateCollection, error)) CertificateCollectionPage { + return CertificateCollectionPage{fn: getNextPage} } -// DiagnosticContract diagnostic details. -type DiagnosticContract struct { +// CertificateConfiguration certificate configuration which consist of non-trusted intermediates and root +// certificates. +type CertificateConfiguration struct { + // EncodedCertificate - Base64 Encoded certificate. + EncodedCertificate *string `json:"encodedCertificate,omitempty"` + // CertificatePassword - Certificate Password. + CertificatePassword *string `json:"certificatePassword,omitempty"` + // StoreName - The System.Security.Cryptography.x509certificates.StoreName certificate store location. Only Root and CertificateAuthority are valid locations. Possible values include: 'CertificateAuthority', 'Root' + StoreName StoreName `json:"storeName,omitempty"` + // Certificate - Certificate information. + Certificate *CertificateInformation `json:"certificate,omitempty"` +} + +// CertificateContract certificate details. +type CertificateContract struct { autorest.Response `json:"-"` - // DiagnosticContractProperties - Diagnostic entity contract properties. - *DiagnosticContractProperties `json:"properties,omitempty"` + // CertificateContractProperties - Certificate properties details. + *CertificateContractProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -3308,17 +3646,17 @@ type DiagnosticContract struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for DiagnosticContract. -func (dc DiagnosticContract) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for CertificateContract. +func (cc CertificateContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if dc.DiagnosticContractProperties != nil { - objectMap["properties"] = dc.DiagnosticContractProperties + if cc.CertificateContractProperties != nil { + objectMap["properties"] = cc.CertificateContractProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for DiagnosticContract struct. -func (dc *DiagnosticContract) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for CertificateContract struct. +func (cc *CertificateContract) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -3328,12 +3666,12 @@ func (dc *DiagnosticContract) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var diagnosticContractProperties DiagnosticContractProperties - err = json.Unmarshal(*v, &diagnosticContractProperties) + var certificateContractProperties CertificateContractProperties + err = json.Unmarshal(*v, &certificateContractProperties) if err != nil { return err } - dc.DiagnosticContractProperties = &diagnosticContractProperties + cc.CertificateContractProperties = &certificateContractProperties } case "id": if v != nil { @@ -3342,7 +3680,7 @@ func (dc *DiagnosticContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - dc.ID = &ID + cc.ID = &ID } case "name": if v != nil { @@ -3351,7 +3689,7 @@ func (dc *DiagnosticContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - dc.Name = &name + cc.Name = &name } case "type": if v != nil { @@ -3360,7 +3698,7 @@ func (dc *DiagnosticContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - dc.Type = &typeVar + cc.Type = &typeVar } } } @@ -3368,38 +3706,167 @@ func (dc *DiagnosticContract) UnmarshalJSON(body []byte) error { return nil } -// DiagnosticContractProperties diagnostic Entity Properties -type DiagnosticContractProperties struct { - // Enabled - Indicates whether a diagnostic should receive data or not. - Enabled *bool `json:"enabled,omitempty"` +// CertificateContractProperties properties of the Certificate contract. +type CertificateContractProperties struct { + // Subject - Subject attribute of the certificate. + Subject *string `json:"subject,omitempty"` + // Thumbprint - Thumbprint of the certificate. + Thumbprint *string `json:"thumbprint,omitempty"` + // 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. + ExpirationDate *date.Time `json:"expirationDate,omitempty"` } -// EmailTemplateCollection paged email template list representation. -type EmailTemplateCollection struct { - autorest.Response `json:"-"` - // Value - Page values. - Value *[]EmailTemplateContract `json:"value,omitempty"` - // NextLink - Next page link if any. - NextLink *string `json:"nextLink,omitempty"` +// CertificateCreateOrUpdateParameters certificate create or update details. +type CertificateCreateOrUpdateParameters struct { + // CertificateCreateOrUpdateProperties - Certificate create or update properties details. + *CertificateCreateOrUpdateProperties `json:"properties,omitempty"` } -// EmailTemplateCollectionIterator provides access to a complete listing of EmailTemplateContract values. -type EmailTemplateCollectionIterator struct { - i int - page EmailTemplateCollectionPage +// MarshalJSON is the custom marshaler for CertificateCreateOrUpdateParameters. +func (ccoup CertificateCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ccoup.CertificateCreateOrUpdateProperties != nil { + objectMap["properties"] = ccoup.CertificateCreateOrUpdateProperties + } + return json.Marshal(objectMap) } -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *EmailTemplateCollectionIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/EmailTemplateCollectionIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) +// UnmarshalJSON is the custom unmarshaler for CertificateCreateOrUpdateParameters struct. +func (ccoup *CertificateCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var certificateCreateOrUpdateProperties CertificateCreateOrUpdateProperties + err = json.Unmarshal(*v, &certificateCreateOrUpdateProperties) + if err != nil { + return err + } + ccoup.CertificateCreateOrUpdateProperties = &certificateCreateOrUpdateProperties + } + } + } + + return nil +} + +// CertificateCreateOrUpdateProperties parameters supplied to the CreateOrUpdate certificate operation. +type CertificateCreateOrUpdateProperties struct { + // Data - Base 64 encoded certificate using the application/x-pkcs12 representation. + Data *string `json:"data,omitempty"` + // Password - Password for the Certificate + Password *string `json:"password,omitempty"` +} + +// CertificateInformation SSL certificate information. +type CertificateInformation struct { + // Expiry - Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + Expiry *date.Time `json:"expiry,omitempty"` + // Thumbprint - Thumbprint of the certificate. + Thumbprint *string `json:"thumbprint,omitempty"` + // Subject - Subject of the certificate. + Subject *string `json:"subject,omitempty"` +} + +// ClientSecretContract client or app secret used in IdentityProviders, Aad, OpenID or OAuth. +type ClientSecretContract struct { + autorest.Response `json:"-"` + // ClientSecret - Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. + ClientSecret *string `json:"clientSecret,omitempty"` +} + +// ConnectivityStatusContract details about connectivity to a resource. +type ConnectivityStatusContract struct { + // Name - The hostname of the resource which the service depends on. This can be the database, storage or any other azure resource on which the service depends upon. + Name *string `json:"name,omitempty"` + // Status - Resource Connectivity Status Type identifier. Possible values include: 'Initializing', 'Success', 'Failure' + Status ConnectivityStatusType `json:"status,omitempty"` + // Error - Error details of the connectivity to the resource. + Error *string `json:"error,omitempty"` + // LastUpdated - The date when the resource connectivity status was last updated. This status should be updated every 15 minutes. If this status has not been updated, then it means that the service has lost network connectivity to the resource, from inside the Virtual Network.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + LastUpdated *date.Time `json:"lastUpdated,omitempty"` + // LastStatusChange - The date when the resource connectivity status last Changed from success to failure or vice-versa. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + LastStatusChange *date.Time `json:"lastStatusChange,omitempty"` +} + +// DeployConfigurationParameterProperties parameters supplied to the Deploy Configuration operation. +type DeployConfigurationParameterProperties struct { + // Branch - The name of the Git branch from which the configuration is to be deployed to the configuration database. + Branch *string `json:"branch,omitempty"` + // Force - The value enforcing deleting subscriptions to products that are deleted in this update. + Force *bool `json:"force,omitempty"` +} + +// DeployConfigurationParameters deploy Tenant Configuration Contract. +type DeployConfigurationParameters struct { + // DeployConfigurationParameterProperties - Deploy Configuration Parameter contract properties. + *DeployConfigurationParameterProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeployConfigurationParameters. +func (dcp DeployConfigurationParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dcp.DeployConfigurationParameterProperties != nil { + objectMap["properties"] = dcp.DeployConfigurationParameterProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DeployConfigurationParameters struct. +func (dcp *DeployConfigurationParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var deployConfigurationParameterProperties DeployConfigurationParameterProperties + err = json.Unmarshal(*v, &deployConfigurationParameterProperties) + if err != nil { + return err + } + dcp.DeployConfigurationParameterProperties = &deployConfigurationParameterProperties + } + } + } + + return nil +} + +// DiagnosticCollection paged Diagnostic list representation. +type DiagnosticCollection struct { + autorest.Response `json:"-"` + // Value - Page values. + Value *[]DiagnosticContract `json:"value,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// DiagnosticCollectionIterator provides access to a complete listing of DiagnosticContract values. +type DiagnosticCollectionIterator struct { + i int + page DiagnosticCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DiagnosticCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) }() } iter.i++ @@ -3418,62 +3885,62 @@ func (iter *EmailTemplateCollectionIterator) NextWithContext(ctx context.Context // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *EmailTemplateCollectionIterator) Next() error { +func (iter *DiagnosticCollectionIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter EmailTemplateCollectionIterator) NotDone() bool { +func (iter DiagnosticCollectionIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. -func (iter EmailTemplateCollectionIterator) Response() EmailTemplateCollection { +func (iter DiagnosticCollectionIterator) Response() DiagnosticCollection { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter EmailTemplateCollectionIterator) Value() EmailTemplateContract { +func (iter DiagnosticCollectionIterator) Value() DiagnosticContract { if !iter.page.NotDone() { - return EmailTemplateContract{} + return DiagnosticContract{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the EmailTemplateCollectionIterator type. -func NewEmailTemplateCollectionIterator(page EmailTemplateCollectionPage) EmailTemplateCollectionIterator { - return EmailTemplateCollectionIterator{page: page} +// Creates a new instance of the DiagnosticCollectionIterator type. +func NewDiagnosticCollectionIterator(page DiagnosticCollectionPage) DiagnosticCollectionIterator { + return DiagnosticCollectionIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (etc EmailTemplateCollection) IsEmpty() bool { - return etc.Value == nil || len(*etc.Value) == 0 +func (dc DiagnosticCollection) IsEmpty() bool { + return dc.Value == nil || len(*dc.Value) == 0 } -// emailTemplateCollectionPreparer prepares a request to retrieve the next set of results. +// diagnosticCollectionPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (etc EmailTemplateCollection) emailTemplateCollectionPreparer(ctx context.Context) (*http.Request, error) { - if etc.NextLink == nil || len(to.String(etc.NextLink)) < 1 { +func (dc DiagnosticCollection) diagnosticCollectionPreparer(ctx context.Context) (*http.Request, error) { + if dc.NextLink == nil || len(to.String(dc.NextLink)) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(etc.NextLink))) + autorest.WithBaseURL(to.String(dc.NextLink))) } -// EmailTemplateCollectionPage contains a page of EmailTemplateContract values. -type EmailTemplateCollectionPage struct { - fn func(context.Context, EmailTemplateCollection) (EmailTemplateCollection, error) - etc EmailTemplateCollection +// DiagnosticCollectionPage contains a page of DiagnosticContract values. +type DiagnosticCollectionPage struct { + fn func(context.Context, DiagnosticCollection) (DiagnosticCollection, error) + dc DiagnosticCollection } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *EmailTemplateCollectionPage) NextWithContext(ctx context.Context) (err error) { +func (page *DiagnosticCollectionPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/EmailTemplateCollectionPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticCollectionPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -3482,49 +3949,49 @@ func (page *EmailTemplateCollectionPage) NextWithContext(ctx context.Context) (e tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.etc) + next, err := page.fn(ctx, page.dc) if err != nil { return err } - page.etc = next + page.dc = next return nil } // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (page *EmailTemplateCollectionPage) Next() error { +func (page *DiagnosticCollectionPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page EmailTemplateCollectionPage) NotDone() bool { - return !page.etc.IsEmpty() +func (page DiagnosticCollectionPage) NotDone() bool { + return !page.dc.IsEmpty() } // Response returns the raw server response from the last page request. -func (page EmailTemplateCollectionPage) Response() EmailTemplateCollection { - return page.etc +func (page DiagnosticCollectionPage) Response() DiagnosticCollection { + return page.dc } // Values returns the slice of values for the current page or nil if there are no values. -func (page EmailTemplateCollectionPage) Values() []EmailTemplateContract { - if page.etc.IsEmpty() { +func (page DiagnosticCollectionPage) Values() []DiagnosticContract { + if page.dc.IsEmpty() { return nil } - return *page.etc.Value + return *page.dc.Value } -// Creates a new instance of the EmailTemplateCollectionPage type. -func NewEmailTemplateCollectionPage(getNextPage func(context.Context, EmailTemplateCollection) (EmailTemplateCollection, error)) EmailTemplateCollectionPage { - return EmailTemplateCollectionPage{fn: getNextPage} +// Creates a new instance of the DiagnosticCollectionPage type. +func NewDiagnosticCollectionPage(getNextPage func(context.Context, DiagnosticCollection) (DiagnosticCollection, error)) DiagnosticCollectionPage { + return DiagnosticCollectionPage{fn: getNextPage} } -// EmailTemplateContract email Template details. -type EmailTemplateContract struct { +// DiagnosticContract diagnostic details. +type DiagnosticContract struct { autorest.Response `json:"-"` - // EmailTemplateContractProperties - Email Template entity contract properties. - *EmailTemplateContractProperties `json:"properties,omitempty"` + // DiagnosticContractProperties - Diagnostic entity contract properties. + *DiagnosticContractProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -3533,17 +4000,17 @@ type EmailTemplateContract struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for EmailTemplateContract. -func (etc EmailTemplateContract) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for DiagnosticContract. +func (dc DiagnosticContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if etc.EmailTemplateContractProperties != nil { - objectMap["properties"] = etc.EmailTemplateContractProperties + if dc.DiagnosticContractProperties != nil { + objectMap["properties"] = dc.DiagnosticContractProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for EmailTemplateContract struct. -func (etc *EmailTemplateContract) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for DiagnosticContract struct. +func (dc *DiagnosticContract) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -3553,12 +4020,12 @@ func (etc *EmailTemplateContract) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var emailTemplateContractProperties EmailTemplateContractProperties - err = json.Unmarshal(*v, &emailTemplateContractProperties) + var diagnosticContractProperties DiagnosticContractProperties + err = json.Unmarshal(*v, &diagnosticContractProperties) if err != nil { return err } - etc.EmailTemplateContractProperties = &emailTemplateContractProperties + dc.DiagnosticContractProperties = &diagnosticContractProperties } case "id": if v != nil { @@ -3567,7 +4034,7 @@ func (etc *EmailTemplateContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - etc.ID = &ID + dc.ID = &ID } case "name": if v != nil { @@ -3576,7 +4043,7 @@ func (etc *EmailTemplateContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - etc.Name = &name + dc.Name = &name } case "type": if v != nil { @@ -3585,7 +4052,7 @@ func (etc *EmailTemplateContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - etc.Type = &typeVar + dc.Type = &typeVar } } } @@ -3593,171 +4060,46 @@ func (etc *EmailTemplateContract) UnmarshalJSON(body []byte) error { return nil } -// EmailTemplateContractProperties email Template Contract properties. -type EmailTemplateContractProperties struct { - // Subject - Subject of the Template. - Subject *string `json:"subject,omitempty"` - // Body - Email Template Body. This should be a valid XDocument - Body *string `json:"body,omitempty"` - // Title - Title of the Template. - Title *string `json:"title,omitempty"` - // Description - Description of the Email Template. - Description *string `json:"description,omitempty"` - // IsDefault - READ-ONLY; Whether the template is the default template provided by Api Management or has been edited. - IsDefault *bool `json:"isDefault,omitempty"` - // Parameters - Email Template Parameter values. - Parameters *[]EmailTemplateParametersContractProperties `json:"parameters,omitempty"` +// DiagnosticContractProperties diagnostic Entity Properties +type DiagnosticContractProperties struct { + // AlwaysLog - Specifies for what type of messages sampling settings should not apply. Possible values include: 'AllErrors' + AlwaysLog AlwaysLog `json:"alwaysLog,omitempty"` + // LoggerID - Resource Id of a target logger. + LoggerID *string `json:"loggerId,omitempty"` + // Sampling - Sampling settings for Diagnostic. + Sampling *SamplingSettings `json:"sampling,omitempty"` + // Frontend - Diagnostic settings for incoming/outgoing HTTP messages to the Gateway. + Frontend *PipelineDiagnosticSettings `json:"frontend,omitempty"` + // Backend - Diagnostic settings for incoming/outgoing HTTP messages to the Backend + Backend *PipelineDiagnosticSettings `json:"backend,omitempty"` + // LogClientIP - Log the ClientIP. Default is false. + LogClientIP *bool `json:"logClientIp,omitempty"` + // HTTPCorrelationProtocol - Sets correlation protocol to use for Application Insights diagnostics. Possible values include: 'HTTPCorrelationProtocolNone', 'HTTPCorrelationProtocolLegacy', 'HTTPCorrelationProtocolW3C' + HTTPCorrelationProtocol HTTPCorrelationProtocol `json:"httpCorrelationProtocol,omitempty"` + // Verbosity - The verbosity level applied to traces emitted by trace policies. Possible values include: 'Verbose', 'Information', 'Error' + Verbosity Verbosity `json:"verbosity,omitempty"` } -// EmailTemplateParametersContractProperties email Template Parameter contract. -type EmailTemplateParametersContractProperties struct { - // Name - Template parameter name. - Name *string `json:"name,omitempty"` - // Title - Template parameter title. - Title *string `json:"title,omitempty"` - // Description - Template parameter description. - Description *string `json:"description,omitempty"` +// EmailTemplateCollection paged email template list representation. +type EmailTemplateCollection struct { + autorest.Response `json:"-"` + // Value - Page values. + Value *[]EmailTemplateContract `json:"value,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` } -// EmailTemplateUpdateParameterProperties email Template Update Contract properties. -type EmailTemplateUpdateParameterProperties struct { - // Subject - Subject of the Template. - Subject *string `json:"subject,omitempty"` - // Title - Title of the Template. - Title *string `json:"title,omitempty"` - // Description - Description of the Email Template. - Description *string `json:"description,omitempty"` - // Body - Email Template Body. This should be a valid XDocument - Body *string `json:"body,omitempty"` - // Parameters - Email Template Parameter values. - Parameters *[]EmailTemplateParametersContractProperties `json:"parameters,omitempty"` -} - -// EmailTemplateUpdateParameters email Template update Parameters. -type EmailTemplateUpdateParameters struct { - // EmailTemplateUpdateParameterProperties - Email Template Update contract properties. - *EmailTemplateUpdateParameterProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for EmailTemplateUpdateParameters. -func (etup EmailTemplateUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if etup.EmailTemplateUpdateParameterProperties != nil { - objectMap["properties"] = etup.EmailTemplateUpdateParameterProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for EmailTemplateUpdateParameters struct. -func (etup *EmailTemplateUpdateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var emailTemplateUpdateParameterProperties EmailTemplateUpdateParameterProperties - err = json.Unmarshal(*v, &emailTemplateUpdateParameterProperties) - if err != nil { - return err - } - etup.EmailTemplateUpdateParameterProperties = &emailTemplateUpdateParameterProperties - } - } - } - - return nil -} - -// ErrorFieldContract error Field contract. -type ErrorFieldContract struct { - // Code - Property level error code. - Code *string `json:"code,omitempty"` - // Message - Human-readable representation of property-level error. - Message *string `json:"message,omitempty"` - // Target - Property name. - Target *string `json:"target,omitempty"` -} - -// ErrorResponse error Response. -type ErrorResponse struct { - // ErrorResponseBody - Properties of the Error Response. - *ErrorResponseBody `json:"error,omitempty"` -} - -// MarshalJSON is the custom marshaler for ErrorResponse. -func (er ErrorResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if er.ErrorResponseBody != nil { - objectMap["error"] = er.ErrorResponseBody - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ErrorResponse struct. -func (er *ErrorResponse) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "error": - if v != nil { - var errorResponseBody ErrorResponseBody - err = json.Unmarshal(*v, &errorResponseBody) - if err != nil { - return err - } - er.ErrorResponseBody = &errorResponseBody - } - } - } - - return nil -} - -// ErrorResponseBody error Body contract. -type ErrorResponseBody struct { - // Code - Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. - Code *string `json:"code,omitempty"` - // Message - Human-readable representation of the error. - Message *string `json:"message,omitempty"` - // Details - The list of invalid fields send in request, in case of validation error. - Details *[]ErrorFieldContract `json:"details,omitempty"` -} - -// GenerateSsoURLResult generate SSO Url operations response details. -type GenerateSsoURLResult struct { - autorest.Response `json:"-"` - // Value - Redirect Url containing the SSO URL value. - Value *string `json:"value,omitempty"` -} - -// GroupCollection paged Group list representation. -type GroupCollection struct { - autorest.Response `json:"-"` - // Value - Page values. - Value *[]GroupContract `json:"value,omitempty"` - // NextLink - Next page link if any. - NextLink *string `json:"nextLink,omitempty"` -} - -// GroupCollectionIterator provides access to a complete listing of GroupContract values. -type GroupCollectionIterator struct { +// EmailTemplateCollectionIterator provides access to a complete listing of EmailTemplateContract values. +type EmailTemplateCollectionIterator struct { i int - page GroupCollectionPage + page EmailTemplateCollectionPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *GroupCollectionIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *EmailTemplateCollectionIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GroupCollectionIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/EmailTemplateCollectionIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -3782,62 +4124,62 @@ func (iter *GroupCollectionIterator) NextWithContext(ctx context.Context) (err e // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *GroupCollectionIterator) Next() error { +func (iter *EmailTemplateCollectionIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter GroupCollectionIterator) NotDone() bool { +func (iter EmailTemplateCollectionIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. -func (iter GroupCollectionIterator) Response() GroupCollection { +func (iter EmailTemplateCollectionIterator) Response() EmailTemplateCollection { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter GroupCollectionIterator) Value() GroupContract { +func (iter EmailTemplateCollectionIterator) Value() EmailTemplateContract { if !iter.page.NotDone() { - return GroupContract{} + return EmailTemplateContract{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the GroupCollectionIterator type. -func NewGroupCollectionIterator(page GroupCollectionPage) GroupCollectionIterator { - return GroupCollectionIterator{page: page} +// Creates a new instance of the EmailTemplateCollectionIterator type. +func NewEmailTemplateCollectionIterator(page EmailTemplateCollectionPage) EmailTemplateCollectionIterator { + return EmailTemplateCollectionIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (gc GroupCollection) IsEmpty() bool { - return gc.Value == nil || len(*gc.Value) == 0 +func (etc EmailTemplateCollection) IsEmpty() bool { + return etc.Value == nil || len(*etc.Value) == 0 } -// groupCollectionPreparer prepares a request to retrieve the next set of results. +// emailTemplateCollectionPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (gc GroupCollection) groupCollectionPreparer(ctx context.Context) (*http.Request, error) { - if gc.NextLink == nil || len(to.String(gc.NextLink)) < 1 { +func (etc EmailTemplateCollection) emailTemplateCollectionPreparer(ctx context.Context) (*http.Request, error) { + if etc.NextLink == nil || len(to.String(etc.NextLink)) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(gc.NextLink))) + autorest.WithBaseURL(to.String(etc.NextLink))) } -// GroupCollectionPage contains a page of GroupContract values. -type GroupCollectionPage struct { - fn func(context.Context, GroupCollection) (GroupCollection, error) - gc GroupCollection +// EmailTemplateCollectionPage contains a page of EmailTemplateContract values. +type EmailTemplateCollectionPage struct { + fn func(context.Context, EmailTemplateCollection) (EmailTemplateCollection, error) + etc EmailTemplateCollection } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *GroupCollectionPage) NextWithContext(ctx context.Context) (err error) { +func (page *EmailTemplateCollectionPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GroupCollectionPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/EmailTemplateCollectionPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -3846,49 +4188,49 @@ func (page *GroupCollectionPage) NextWithContext(ctx context.Context) (err error tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.gc) + next, err := page.fn(ctx, page.etc) if err != nil { return err } - page.gc = next + page.etc = next return nil } // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (page *GroupCollectionPage) Next() error { +func (page *EmailTemplateCollectionPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page GroupCollectionPage) NotDone() bool { - return !page.gc.IsEmpty() +func (page EmailTemplateCollectionPage) NotDone() bool { + return !page.etc.IsEmpty() } // Response returns the raw server response from the last page request. -func (page GroupCollectionPage) Response() GroupCollection { - return page.gc +func (page EmailTemplateCollectionPage) Response() EmailTemplateCollection { + return page.etc } // Values returns the slice of values for the current page or nil if there are no values. -func (page GroupCollectionPage) Values() []GroupContract { - if page.gc.IsEmpty() { +func (page EmailTemplateCollectionPage) Values() []EmailTemplateContract { + if page.etc.IsEmpty() { return nil } - return *page.gc.Value + return *page.etc.Value } -// Creates a new instance of the GroupCollectionPage type. -func NewGroupCollectionPage(getNextPage func(context.Context, GroupCollection) (GroupCollection, error)) GroupCollectionPage { - return GroupCollectionPage{fn: getNextPage} +// Creates a new instance of the EmailTemplateCollectionPage type. +func NewEmailTemplateCollectionPage(getNextPage func(context.Context, EmailTemplateCollection) (EmailTemplateCollection, error)) EmailTemplateCollectionPage { + return EmailTemplateCollectionPage{fn: getNextPage} } -// GroupContract contract details. -type GroupContract struct { +// EmailTemplateContract email Template details. +type EmailTemplateContract struct { autorest.Response `json:"-"` - // GroupContractProperties - Group entity contract properties. - *GroupContractProperties `json:"properties,omitempty"` + // EmailTemplateContractProperties - Email Template entity contract properties. + *EmailTemplateContractProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -3897,17 +4239,17 @@ type GroupContract struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for GroupContract. -func (gc GroupContract) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for EmailTemplateContract. +func (etc EmailTemplateContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if gc.GroupContractProperties != nil { - objectMap["properties"] = gc.GroupContractProperties + if etc.EmailTemplateContractProperties != nil { + objectMap["properties"] = etc.EmailTemplateContractProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for GroupContract struct. -func (gc *GroupContract) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for EmailTemplateContract struct. +func (etc *EmailTemplateContract) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -3917,12 +4259,12 @@ func (gc *GroupContract) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var groupContractProperties GroupContractProperties - err = json.Unmarshal(*v, &groupContractProperties) + var emailTemplateContractProperties EmailTemplateContractProperties + err = json.Unmarshal(*v, &emailTemplateContractProperties) if err != nil { return err } - gc.GroupContractProperties = &groupContractProperties + etc.EmailTemplateContractProperties = &emailTemplateContractProperties } case "id": if v != nil { @@ -3931,7 +4273,7 @@ func (gc *GroupContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - gc.ID = &ID + etc.ID = &ID } case "name": if v != nil { @@ -3940,7 +4282,7 @@ func (gc *GroupContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - gc.Name = &name + etc.Name = &name } case "type": if v != nil { @@ -3949,7 +4291,7 @@ func (gc *GroupContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - gc.Type = &typeVar + etc.Type = &typeVar } } } @@ -3957,88 +4299,63 @@ func (gc *GroupContract) UnmarshalJSON(body []byte) error { return nil } -// GroupContractProperties group contract Properties. -type GroupContractProperties struct { - // DisplayName - Group name. - DisplayName *string `json:"displayName,omitempty"` - // Description - Group description. Can contain HTML formatting tags. +// EmailTemplateContractProperties email Template Contract properties. +type EmailTemplateContractProperties struct { + // Subject - Subject of the Template. + Subject *string `json:"subject,omitempty"` + // Body - Email Template Body. This should be a valid XDocument + Body *string `json:"body,omitempty"` + // Title - Title of the Template. + Title *string `json:"title,omitempty"` + // Description - Description of the Email Template. Description *string `json:"description,omitempty"` - // BuiltIn - READ-ONLY; true if the group is one of the three system groups (Administrators, Developers, or Guests); otherwise false. - BuiltIn *bool `json:"builtIn,omitempty"` - // Type - Group type. Possible values include: 'Custom', 'System', 'External' - Type GroupType `json:"type,omitempty"` - // ExternalID - For external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active Directory aad://.onmicrosoft.com/groups/; otherwise the value is null. - ExternalID *string `json:"externalId,omitempty"` + // IsDefault - READ-ONLY; Whether the template is the default template provided by Api Management or has been edited. + IsDefault *bool `json:"isDefault,omitempty"` + // Parameters - Email Template Parameter values. + Parameters *[]EmailTemplateParametersContractProperties `json:"parameters,omitempty"` } -// GroupCreateParameters parameters supplied to the Create Group operation. -type GroupCreateParameters struct { - // GroupCreateParametersProperties - Properties supplied to Create Group operation. - *GroupCreateParametersProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for GroupCreateParameters. -func (gcp GroupCreateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gcp.GroupCreateParametersProperties != nil { - objectMap["properties"] = gcp.GroupCreateParametersProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GroupCreateParameters struct. -func (gcp *GroupCreateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var groupCreateParametersProperties GroupCreateParametersProperties - err = json.Unmarshal(*v, &groupCreateParametersProperties) - if err != nil { - return err - } - gcp.GroupCreateParametersProperties = &groupCreateParametersProperties - } - } - } - - return nil +// EmailTemplateParametersContractProperties email Template Parameter contract. +type EmailTemplateParametersContractProperties struct { + // Name - Template parameter name. + Name *string `json:"name,omitempty"` + // Title - Template parameter title. + Title *string `json:"title,omitempty"` + // Description - Template parameter description. + Description *string `json:"description,omitempty"` } -// GroupCreateParametersProperties parameters supplied to the Create Group operation. -type GroupCreateParametersProperties struct { - // DisplayName - Group name. - DisplayName *string `json:"displayName,omitempty"` - // Description - Group description. +// EmailTemplateUpdateParameterProperties email Template Update Contract properties. +type EmailTemplateUpdateParameterProperties struct { + // Subject - Subject of the Template. + Subject *string `json:"subject,omitempty"` + // Title - Title of the Template. + Title *string `json:"title,omitempty"` + // Description - Description of the Email Template. Description *string `json:"description,omitempty"` - // Type - Group type. Possible values include: 'Custom', 'System', 'External' - Type GroupType `json:"type,omitempty"` - // 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://.onmicrosoft.com/groups/; otherwise the value is null. - ExternalID *string `json:"externalId,omitempty"` + // Body - Email Template Body. This should be a valid XDocument + Body *string `json:"body,omitempty"` + // Parameters - Email Template Parameter values. + Parameters *[]EmailTemplateParametersContractProperties `json:"parameters,omitempty"` } -// GroupUpdateParameters parameters supplied to the Update Group operation. -type GroupUpdateParameters struct { - // GroupUpdateParametersProperties - Group entity update contract properties. - *GroupUpdateParametersProperties `json:"properties,omitempty"` +// EmailTemplateUpdateParameters email Template update Parameters. +type EmailTemplateUpdateParameters struct { + // EmailTemplateUpdateParameterProperties - Email Template Update contract properties. + *EmailTemplateUpdateParameterProperties `json:"properties,omitempty"` } -// MarshalJSON is the custom marshaler for GroupUpdateParameters. -func (gup GroupUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for EmailTemplateUpdateParameters. +func (etup EmailTemplateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if gup.GroupUpdateParametersProperties != nil { - objectMap["properties"] = gup.GroupUpdateParametersProperties + if etup.EmailTemplateUpdateParameterProperties != nil { + objectMap["properties"] = etup.EmailTemplateUpdateParameterProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for GroupUpdateParameters struct. -func (gup *GroupUpdateParameters) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for EmailTemplateUpdateParameters struct. +func (etup *EmailTemplateUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -4048,12 +4365,12 @@ func (gup *GroupUpdateParameters) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var groupUpdateParametersProperties GroupUpdateParametersProperties - err = json.Unmarshal(*v, &groupUpdateParametersProperties) + var emailTemplateUpdateParameterProperties EmailTemplateUpdateParameterProperties + err = json.Unmarshal(*v, &emailTemplateUpdateParameterProperties) if err != nil { return err } - gup.GroupUpdateParametersProperties = &groupUpdateParametersProperties + etup.EmailTemplateUpdateParameterProperties = &emailTemplateUpdateParameterProperties } } } @@ -4061,88 +4378,33 @@ func (gup *GroupUpdateParameters) UnmarshalJSON(body []byte) error { return nil } -// GroupUpdateParametersProperties parameters supplied to the Update Group operation. -type GroupUpdateParametersProperties struct { - // DisplayName - Group name. - DisplayName *string `json:"displayName,omitempty"` - // Description - Group description. - Description *string `json:"description,omitempty"` - // Type - Group type. Possible values include: 'Custom', 'System', 'External' - Type GroupType `json:"type,omitempty"` - // 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://.onmicrosoft.com/groups/; otherwise the value is null. - ExternalID *string `json:"externalId,omitempty"` -} - -// HostnameConfiguration custom hostname configuration. -type HostnameConfiguration struct { - // Type - Hostname type. Possible values include: 'Proxy', 'Portal', 'Management', 'Scm' - Type HostnameType `json:"type,omitempty"` - // HostName - Hostname to configure on the Api Management service. - HostName *string `json:"hostName,omitempty"` - // KeyVaultID - Url to the KeyVault Secret containing the Ssl Certificate. If absolute Url containing version is provided, auto-update of ssl certificate will not work. This requires Api Management service to be configured with MSI. The secret should be of type *application/x-pkcs12* - KeyVaultID *string `json:"keyVaultId,omitempty"` - // EncodedCertificate - Base64 Encoded certificate. - EncodedCertificate *string `json:"encodedCertificate,omitempty"` - // CertificatePassword - Certificate Password. - CertificatePassword *string `json:"certificatePassword,omitempty"` - // DefaultSslBinding - Specify true to setup the certificate associated with this Hostname as the Default SSL Certificate. If a client does not send the SNI header, then this will be the certificate that will be challenged. The property is useful if a service has multiple custom hostname enabled and it needs to decide on the default ssl certificate. The setting only applied to Proxy Hostname Type. - DefaultSslBinding *bool `json:"defaultSslBinding,omitempty"` - // NegotiateClientCertificate - Specify true to always negotiate client certificate on the hostname. Default Value is false. - NegotiateClientCertificate *bool `json:"negotiateClientCertificate,omitempty"` - // Certificate - Certificate information. - Certificate *CertificateInformation `json:"certificate,omitempty"` -} - -// HostnameConfigurationOld custom hostname configuration. -type HostnameConfigurationOld struct { - // Type - Hostname type. Possible values include: 'Proxy', 'Portal', 'Management', 'Scm' - Type HostnameType `json:"type,omitempty"` - // Hostname - Hostname to configure. - Hostname *string `json:"hostname,omitempty"` - // Certificate - Certificate information. - Certificate *CertificateInformation `json:"certificate,omitempty"` -} - -// IdentityProviderBaseParameters identity Provider Base Parameter Properties. -type IdentityProviderBaseParameters struct { - // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' - Type IdentityProviderType `json:"type,omitempty"` - // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. - AllowedTenants *[]string `json:"allowedTenants,omitempty"` - // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. - SignupPolicyName *string `json:"signupPolicyName,omitempty"` - // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. - SigninPolicyName *string `json:"signinPolicyName,omitempty"` - // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. - ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` - // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. - PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` +// ErrorFieldContract error Field contract. +type ErrorFieldContract struct { + // Code - Property level error code. + Code *string `json:"code,omitempty"` + // Message - Human-readable representation of property-level error. + Message *string `json:"message,omitempty"` + // Target - Property name. + Target *string `json:"target,omitempty"` } -// IdentityProviderContract identity Provider details. -type IdentityProviderContract struct { - autorest.Response `json:"-"` - // IdentityProviderContractProperties - Identity Provider contract properties. - *IdentityProviderContractProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type for API Management resource. - Type *string `json:"type,omitempty"` +// ErrorResponse error Response. +type ErrorResponse struct { + // ErrorResponseBody - Properties of the Error Response. + *ErrorResponseBody `json:"error,omitempty"` } -// MarshalJSON is the custom marshaler for IdentityProviderContract. -func (ipc IdentityProviderContract) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ErrorResponse. +func (er ErrorResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if ipc.IdentityProviderContractProperties != nil { - objectMap["properties"] = ipc.IdentityProviderContractProperties + if er.ErrorResponseBody != nil { + objectMap["error"] = er.ErrorResponseBody } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for IdentityProviderContract struct. -func (ipc *IdentityProviderContract) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ErrorResponse struct. +func (er *ErrorResponse) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -4150,41 +4412,14 @@ func (ipc *IdentityProviderContract) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "properties": - if v != nil { - var identityProviderContractProperties IdentityProviderContractProperties - err = json.Unmarshal(*v, &identityProviderContractProperties) - if err != nil { - return err - } - ipc.IdentityProviderContractProperties = &identityProviderContractProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ipc.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ipc.Name = &name - } - case "type": + case "error": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var errorResponseBody ErrorResponseBody + err = json.Unmarshal(*v, &errorResponseBody) if err != nil { return err } - ipc.Type = &typeVar + er.ErrorResponseBody = &errorResponseBody } } } @@ -4192,48 +4427,36 @@ func (ipc *IdentityProviderContract) UnmarshalJSON(body []byte) error { return nil } -// IdentityProviderContractProperties the external Identity Providers like Facebook, Google, Microsoft, -// Twitter or Azure Active Directory which can be used to enable access to the API Management service -// developer portal for all users. -type IdentityProviderContractProperties struct { - // 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. - ClientID *string `json:"clientId,omitempty"` - // 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. - ClientSecret *string `json:"clientSecret,omitempty"` - // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' - Type IdentityProviderType `json:"type,omitempty"` - // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. - AllowedTenants *[]string `json:"allowedTenants,omitempty"` - // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. - SignupPolicyName *string `json:"signupPolicyName,omitempty"` - // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. - SigninPolicyName *string `json:"signinPolicyName,omitempty"` - // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. - ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` - // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. - PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` +// ErrorResponseBody error Body contract. +type ErrorResponseBody struct { + // Code - Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. + Code *string `json:"code,omitempty"` + // Message - Human-readable representation of the error. + Message *string `json:"message,omitempty"` + // Details - The list of invalid fields send in request, in case of validation error. + Details *[]ErrorFieldContract `json:"details,omitempty"` } -// IdentityProviderList list of all the Identity Providers configured on the service instance. -type IdentityProviderList struct { +// GatewayCollection paged Gateway list representation. +type GatewayCollection struct { autorest.Response `json:"-"` - // Value - Identity Provider configuration values. - Value *[]IdentityProviderContract `json:"value,omitempty"` - // NextLink - Next page link if any. + // Value - READ-ONLY; Page values. + Value *[]GatewayContract `json:"value,omitempty"` + // NextLink - READ-ONLY; Next page link if any. NextLink *string `json:"nextLink,omitempty"` } -// IdentityProviderListIterator provides access to a complete listing of IdentityProviderContract values. -type IdentityProviderListIterator struct { +// GatewayCollectionIterator provides access to a complete listing of GatewayContract values. +type GatewayCollectionIterator struct { i int - page IdentityProviderListPage + page GatewayCollectionPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *IdentityProviderListIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *GatewayCollectionIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IdentityProviderListIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayCollectionIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -4258,62 +4481,62 @@ func (iter *IdentityProviderListIterator) NextWithContext(ctx context.Context) ( // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *IdentityProviderListIterator) Next() error { +func (iter *GatewayCollectionIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter IdentityProviderListIterator) NotDone() bool { +func (iter GatewayCollectionIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. -func (iter IdentityProviderListIterator) Response() IdentityProviderList { +func (iter GatewayCollectionIterator) Response() GatewayCollection { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter IdentityProviderListIterator) Value() IdentityProviderContract { +func (iter GatewayCollectionIterator) Value() GatewayContract { if !iter.page.NotDone() { - return IdentityProviderContract{} + return GatewayContract{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the IdentityProviderListIterator type. -func NewIdentityProviderListIterator(page IdentityProviderListPage) IdentityProviderListIterator { - return IdentityProviderListIterator{page: page} +// Creates a new instance of the GatewayCollectionIterator type. +func NewGatewayCollectionIterator(page GatewayCollectionPage) GatewayCollectionIterator { + return GatewayCollectionIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (ipl IdentityProviderList) IsEmpty() bool { - return ipl.Value == nil || len(*ipl.Value) == 0 +func (gc GatewayCollection) IsEmpty() bool { + return gc.Value == nil || len(*gc.Value) == 0 } -// identityProviderListPreparer prepares a request to retrieve the next set of results. +// gatewayCollectionPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (ipl IdentityProviderList) identityProviderListPreparer(ctx context.Context) (*http.Request, error) { - if ipl.NextLink == nil || len(to.String(ipl.NextLink)) < 1 { +func (gc GatewayCollection) gatewayCollectionPreparer(ctx context.Context) (*http.Request, error) { + if gc.NextLink == nil || len(to.String(gc.NextLink)) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(ipl.NextLink))) + autorest.WithBaseURL(to.String(gc.NextLink))) } -// IdentityProviderListPage contains a page of IdentityProviderContract values. -type IdentityProviderListPage struct { - fn func(context.Context, IdentityProviderList) (IdentityProviderList, error) - ipl IdentityProviderList +// GatewayCollectionPage contains a page of GatewayContract values. +type GatewayCollectionPage struct { + fn func(context.Context, GatewayCollection) (GatewayCollection, error) + gc GatewayCollection } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *IdentityProviderListPage) NextWithContext(ctx context.Context) (err error) { +func (page *GatewayCollectionPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IdentityProviderListPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayCollectionPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -4322,61 +4545,68 @@ func (page *IdentityProviderListPage) NextWithContext(ctx context.Context) (err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.ipl) + next, err := page.fn(ctx, page.gc) if err != nil { return err } - page.ipl = next + page.gc = next return nil } // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (page *IdentityProviderListPage) Next() error { +func (page *GatewayCollectionPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page IdentityProviderListPage) NotDone() bool { - return !page.ipl.IsEmpty() +func (page GatewayCollectionPage) NotDone() bool { + return !page.gc.IsEmpty() } // Response returns the raw server response from the last page request. -func (page IdentityProviderListPage) Response() IdentityProviderList { - return page.ipl +func (page GatewayCollectionPage) Response() GatewayCollection { + return page.gc } // Values returns the slice of values for the current page or nil if there are no values. -func (page IdentityProviderListPage) Values() []IdentityProviderContract { - if page.ipl.IsEmpty() { +func (page GatewayCollectionPage) Values() []GatewayContract { + if page.gc.IsEmpty() { return nil } - return *page.ipl.Value + return *page.gc.Value } -// Creates a new instance of the IdentityProviderListPage type. -func NewIdentityProviderListPage(getNextPage func(context.Context, IdentityProviderList) (IdentityProviderList, error)) IdentityProviderListPage { - return IdentityProviderListPage{fn: getNextPage} +// Creates a new instance of the GatewayCollectionPage type. +func NewGatewayCollectionPage(getNextPage func(context.Context, GatewayCollection) (GatewayCollection, error)) GatewayCollectionPage { + return GatewayCollectionPage{fn: getNextPage} } -// IdentityProviderUpdateParameters parameters supplied to update Identity Provider -type IdentityProviderUpdateParameters struct { - // IdentityProviderUpdateProperties - Identity Provider update properties. - *IdentityProviderUpdateProperties `json:"properties,omitempty"` +// GatewayContract gateway details. +type GatewayContract struct { + autorest.Response `json:"-"` + // GatewayContractProperties - Gateway details. + *GatewayContractProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type for API Management resource. + Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for IdentityProviderUpdateParameters. -func (ipup IdentityProviderUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for GatewayContract. +func (gc GatewayContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if ipup.IdentityProviderUpdateProperties != nil { - objectMap["properties"] = ipup.IdentityProviderUpdateProperties + if gc.GatewayContractProperties != nil { + objectMap["properties"] = gc.GatewayContractProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for IdentityProviderUpdateParameters struct. -func (ipup *IdentityProviderUpdateParameters) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for GatewayContract struct. +func (gc *GatewayContract) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -4386,12 +4616,39 @@ func (ipup *IdentityProviderUpdateParameters) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var identityProviderUpdateProperties IdentityProviderUpdateProperties - err = json.Unmarshal(*v, &identityProviderUpdateProperties) + var gatewayContractProperties GatewayContractProperties + err = json.Unmarshal(*v, &gatewayContractProperties) if err != nil { return err } - ipup.IdentityProviderUpdateProperties = &identityProviderUpdateProperties + gc.GatewayContractProperties = &gatewayContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + gc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + gc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + gc.Type = &typeVar } } } @@ -4399,47 +4656,35 @@ func (ipup *IdentityProviderUpdateParameters) UnmarshalJSON(body []byte) error { return nil } -// IdentityProviderUpdateProperties parameters supplied to the Update Identity Provider operation. -type IdentityProviderUpdateProperties struct { - // 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. - ClientID *string `json:"clientId,omitempty"` - // 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. - ClientSecret *string `json:"clientSecret,omitempty"` - // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' - Type IdentityProviderType `json:"type,omitempty"` - // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. - AllowedTenants *[]string `json:"allowedTenants,omitempty"` - // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. - SignupPolicyName *string `json:"signupPolicyName,omitempty"` - // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. - SigninPolicyName *string `json:"signinPolicyName,omitempty"` - // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. - ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` - // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. - PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` +// GatewayContractProperties properties of the Gateway contract. +type GatewayContractProperties struct { + // LocationData - Gateway location. + LocationData *ResourceLocationDataContract `json:"locationData,omitempty"` + // Description - Gateway description + Description *string `json:"description,omitempty"` } -// IssueAttachmentCollection paged Issue Attachment list representation. -type IssueAttachmentCollection struct { +// GatewayHostnameConfigurationCollection paged Gateway hostname configuration list representation. +type GatewayHostnameConfigurationCollection struct { autorest.Response `json:"-"` - // Value - READ-ONLY; Issue Attachment values. - Value *[]IssueAttachmentContract `json:"value,omitempty"` + // Value - READ-ONLY; Page values. + Value *[]GatewayHostnameConfigurationContract `json:"value,omitempty"` // NextLink - READ-ONLY; Next page link if any. NextLink *string `json:"nextLink,omitempty"` } -// IssueAttachmentCollectionIterator provides access to a complete listing of IssueAttachmentContract -// values. -type IssueAttachmentCollectionIterator struct { +// GatewayHostnameConfigurationCollectionIterator provides access to a complete listing of +// GatewayHostnameConfigurationContract values. +type GatewayHostnameConfigurationCollectionIterator struct { i int - page IssueAttachmentCollectionPage + page GatewayHostnameConfigurationCollectionPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *IssueAttachmentCollectionIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *GatewayHostnameConfigurationCollectionIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IssueAttachmentCollectionIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayHostnameConfigurationCollectionIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -4464,62 +4709,63 @@ func (iter *IssueAttachmentCollectionIterator) NextWithContext(ctx context.Conte // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *IssueAttachmentCollectionIterator) Next() error { +func (iter *GatewayHostnameConfigurationCollectionIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter IssueAttachmentCollectionIterator) NotDone() bool { +func (iter GatewayHostnameConfigurationCollectionIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. -func (iter IssueAttachmentCollectionIterator) Response() IssueAttachmentCollection { +func (iter GatewayHostnameConfigurationCollectionIterator) Response() GatewayHostnameConfigurationCollection { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter IssueAttachmentCollectionIterator) Value() IssueAttachmentContract { +func (iter GatewayHostnameConfigurationCollectionIterator) Value() GatewayHostnameConfigurationContract { if !iter.page.NotDone() { - return IssueAttachmentContract{} + return GatewayHostnameConfigurationContract{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the IssueAttachmentCollectionIterator type. -func NewIssueAttachmentCollectionIterator(page IssueAttachmentCollectionPage) IssueAttachmentCollectionIterator { - return IssueAttachmentCollectionIterator{page: page} +// Creates a new instance of the GatewayHostnameConfigurationCollectionIterator type. +func NewGatewayHostnameConfigurationCollectionIterator(page GatewayHostnameConfigurationCollectionPage) GatewayHostnameConfigurationCollectionIterator { + return GatewayHostnameConfigurationCollectionIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (iac IssueAttachmentCollection) IsEmpty() bool { - return iac.Value == nil || len(*iac.Value) == 0 +func (ghcc GatewayHostnameConfigurationCollection) IsEmpty() bool { + return ghcc.Value == nil || len(*ghcc.Value) == 0 } -// issueAttachmentCollectionPreparer prepares a request to retrieve the next set of results. +// gatewayHostnameConfigurationCollectionPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (iac IssueAttachmentCollection) issueAttachmentCollectionPreparer(ctx context.Context) (*http.Request, error) { - if iac.NextLink == nil || len(to.String(iac.NextLink)) < 1 { +func (ghcc GatewayHostnameConfigurationCollection) gatewayHostnameConfigurationCollectionPreparer(ctx context.Context) (*http.Request, error) { + if ghcc.NextLink == nil || len(to.String(ghcc.NextLink)) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(iac.NextLink))) + autorest.WithBaseURL(to.String(ghcc.NextLink))) } -// IssueAttachmentCollectionPage contains a page of IssueAttachmentContract values. -type IssueAttachmentCollectionPage struct { - fn func(context.Context, IssueAttachmentCollection) (IssueAttachmentCollection, error) - iac IssueAttachmentCollection +// GatewayHostnameConfigurationCollectionPage contains a page of GatewayHostnameConfigurationContract +// values. +type GatewayHostnameConfigurationCollectionPage struct { + fn func(context.Context, GatewayHostnameConfigurationCollection) (GatewayHostnameConfigurationCollection, error) + ghcc GatewayHostnameConfigurationCollection } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *IssueAttachmentCollectionPage) NextWithContext(ctx context.Context) (err error) { +func (page *GatewayHostnameConfigurationCollectionPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IssueAttachmentCollectionPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayHostnameConfigurationCollectionPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -4528,49 +4774,49 @@ func (page *IssueAttachmentCollectionPage) NextWithContext(ctx context.Context) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.iac) + next, err := page.fn(ctx, page.ghcc) if err != nil { return err } - page.iac = next + page.ghcc = next return nil } // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (page *IssueAttachmentCollectionPage) Next() error { +func (page *GatewayHostnameConfigurationCollectionPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page IssueAttachmentCollectionPage) NotDone() bool { - return !page.iac.IsEmpty() +func (page GatewayHostnameConfigurationCollectionPage) NotDone() bool { + return !page.ghcc.IsEmpty() } // Response returns the raw server response from the last page request. -func (page IssueAttachmentCollectionPage) Response() IssueAttachmentCollection { - return page.iac +func (page GatewayHostnameConfigurationCollectionPage) Response() GatewayHostnameConfigurationCollection { + return page.ghcc } // Values returns the slice of values for the current page or nil if there are no values. -func (page IssueAttachmentCollectionPage) Values() []IssueAttachmentContract { - if page.iac.IsEmpty() { +func (page GatewayHostnameConfigurationCollectionPage) Values() []GatewayHostnameConfigurationContract { + if page.ghcc.IsEmpty() { return nil } - return *page.iac.Value + return *page.ghcc.Value } -// Creates a new instance of the IssueAttachmentCollectionPage type. -func NewIssueAttachmentCollectionPage(getNextPage func(context.Context, IssueAttachmentCollection) (IssueAttachmentCollection, error)) IssueAttachmentCollectionPage { - return IssueAttachmentCollectionPage{fn: getNextPage} +// Creates a new instance of the GatewayHostnameConfigurationCollectionPage type. +func NewGatewayHostnameConfigurationCollectionPage(getNextPage func(context.Context, GatewayHostnameConfigurationCollection) (GatewayHostnameConfigurationCollection, error)) GatewayHostnameConfigurationCollectionPage { + return GatewayHostnameConfigurationCollectionPage{fn: getNextPage} } -// IssueAttachmentContract issue Attachment Contract details. -type IssueAttachmentContract struct { +// GatewayHostnameConfigurationContract gateway hostname configuration details. +type GatewayHostnameConfigurationContract struct { autorest.Response `json:"-"` - // IssueAttachmentContractProperties - Properties of the Issue Attachment. - *IssueAttachmentContractProperties `json:"properties,omitempty"` + // GatewayHostnameConfigurationContractProperties - Gateway hostname configuration details. + *GatewayHostnameConfigurationContractProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -4579,17 +4825,17 @@ type IssueAttachmentContract struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for IssueAttachmentContract. -func (iac IssueAttachmentContract) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for GatewayHostnameConfigurationContract. +func (ghcc GatewayHostnameConfigurationContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if iac.IssueAttachmentContractProperties != nil { - objectMap["properties"] = iac.IssueAttachmentContractProperties + if ghcc.GatewayHostnameConfigurationContractProperties != nil { + objectMap["properties"] = ghcc.GatewayHostnameConfigurationContractProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for IssueAttachmentContract struct. -func (iac *IssueAttachmentContract) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for GatewayHostnameConfigurationContract struct. +func (ghcc *GatewayHostnameConfigurationContract) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -4599,12 +4845,12 @@ func (iac *IssueAttachmentContract) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var issueAttachmentContractProperties IssueAttachmentContractProperties - err = json.Unmarshal(*v, &issueAttachmentContractProperties) + var gatewayHostnameConfigurationContractProperties GatewayHostnameConfigurationContractProperties + err = json.Unmarshal(*v, &gatewayHostnameConfigurationContractProperties) if err != nil { return err } - iac.IssueAttachmentContractProperties = &issueAttachmentContractProperties + ghcc.GatewayHostnameConfigurationContractProperties = &gatewayHostnameConfigurationContractProperties } case "id": if v != nil { @@ -4613,7 +4859,7 @@ func (iac *IssueAttachmentContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - iac.ID = &ID + ghcc.ID = &ID } case "name": if v != nil { @@ -4622,7 +4868,7 @@ func (iac *IssueAttachmentContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - iac.Name = &name + ghcc.Name = &name } case "type": if v != nil { @@ -4631,7 +4877,7 @@ func (iac *IssueAttachmentContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - iac.Type = &typeVar + ghcc.Type = &typeVar } } } @@ -4639,36 +4885,73 @@ func (iac *IssueAttachmentContract) UnmarshalJSON(body []byte) error { return nil } -// IssueAttachmentContractProperties issue Attachment contract Properties. -type IssueAttachmentContractProperties struct { - // Title - Filename by which the binary data will be saved. - Title *string `json:"title,omitempty"` - // ContentFormat - Either 'link' if content is provided via an HTTP link or the MIME type of the Base64-encoded binary data provided in the 'content' property. - ContentFormat *string `json:"contentFormat,omitempty"` - // Content - An HTTP link or Base64-encoded binary data. - Content *string `json:"content,omitempty"` +// GatewayHostnameConfigurationContractProperties gateway hostname configuration details. +type GatewayHostnameConfigurationContractProperties struct { + // Hostname - Hostname value. Supports valid domain name, partial or full wildcard + Hostname *string `json:"hostname,omitempty"` + // CertificateID - Identifier of Certificate entity that will be used for TLS connection establishment + CertificateID *string `json:"certificateId,omitempty"` + // NegotiateClientCertificate - Determines whether gateway requests client certificate + NegotiateClientCertificate *bool `json:"negotiateClientCertificate,omitempty"` } -// IssueCollection paged Issue list representation. -type IssueCollection struct { +// GatewayKeyRegenerationRequestContract gateway key regeneration request contract properties. +type GatewayKeyRegenerationRequestContract struct { + // KeyType - The Key being regenerated. Possible values include: 'Primary', 'Secondary' + KeyType KeyType `json:"keyType,omitempty"` +} + +// GatewayKeysContract gateway authentication keys. +type GatewayKeysContract struct { autorest.Response `json:"-"` - // Value - READ-ONLY; Issue values. - Value *[]IssueContract `json:"value,omitempty"` - // NextLink - READ-ONLY; Next page link if any. + // Primary - Primary gateway key. + Primary *string `json:"primary,omitempty"` + // Secondary - Secondary gateway key. + Secondary *string `json:"secondary,omitempty"` +} + +// GatewayTokenContract gateway access token. +type GatewayTokenContract struct { + autorest.Response `json:"-"` + // Value - Shared Access Authentication token value for the Gateway. + Value *string `json:"value,omitempty"` +} + +// GatewayTokenRequestContract gateway token request contract properties. +type GatewayTokenRequestContract struct { + // KeyType - The Key to be used to generate gateway token. Possible values include: 'Primary', 'Secondary' + KeyType KeyType `json:"keyType,omitempty"` + // 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. + Expiry *date.Time `json:"expiry,omitempty"` +} + +// GenerateSsoURLResult generate SSO Url operations response details. +type GenerateSsoURLResult struct { + autorest.Response `json:"-"` + // Value - Redirect Url containing the SSO URL value. + Value *string `json:"value,omitempty"` +} + +// GroupCollection paged Group list representation. +type GroupCollection struct { + autorest.Response `json:"-"` + // Value - Page values. + Value *[]GroupContract `json:"value,omitempty"` + // NextLink - Next page link if any. NextLink *string `json:"nextLink,omitempty"` } -// IssueCollectionIterator provides access to a complete listing of IssueContract values. -type IssueCollectionIterator struct { +// GroupCollectionIterator provides access to a complete listing of GroupContract values. +type GroupCollectionIterator struct { i int - page IssueCollectionPage + page GroupCollectionPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *IssueCollectionIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *GroupCollectionIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IssueCollectionIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/GroupCollectionIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -4693,62 +4976,62 @@ func (iter *IssueCollectionIterator) NextWithContext(ctx context.Context) (err e // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *IssueCollectionIterator) Next() error { +func (iter *GroupCollectionIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter IssueCollectionIterator) NotDone() bool { +func (iter GroupCollectionIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. -func (iter IssueCollectionIterator) Response() IssueCollection { +func (iter GroupCollectionIterator) Response() GroupCollection { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter IssueCollectionIterator) Value() IssueContract { +func (iter GroupCollectionIterator) Value() GroupContract { if !iter.page.NotDone() { - return IssueContract{} + return GroupContract{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the IssueCollectionIterator type. -func NewIssueCollectionIterator(page IssueCollectionPage) IssueCollectionIterator { - return IssueCollectionIterator{page: page} +// Creates a new instance of the GroupCollectionIterator type. +func NewGroupCollectionIterator(page GroupCollectionPage) GroupCollectionIterator { + return GroupCollectionIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (ic IssueCollection) IsEmpty() bool { - return ic.Value == nil || len(*ic.Value) == 0 +func (gc GroupCollection) IsEmpty() bool { + return gc.Value == nil || len(*gc.Value) == 0 } -// issueCollectionPreparer prepares a request to retrieve the next set of results. +// groupCollectionPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (ic IssueCollection) issueCollectionPreparer(ctx context.Context) (*http.Request, error) { - if ic.NextLink == nil || len(to.String(ic.NextLink)) < 1 { +func (gc GroupCollection) groupCollectionPreparer(ctx context.Context) (*http.Request, error) { + if gc.NextLink == nil || len(to.String(gc.NextLink)) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(ic.NextLink))) + autorest.WithBaseURL(to.String(gc.NextLink))) } -// IssueCollectionPage contains a page of IssueContract values. -type IssueCollectionPage struct { - fn func(context.Context, IssueCollection) (IssueCollection, error) - ic IssueCollection +// GroupCollectionPage contains a page of GroupContract values. +type GroupCollectionPage struct { + fn func(context.Context, GroupCollection) (GroupCollection, error) + gc GroupCollection } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *IssueCollectionPage) NextWithContext(ctx context.Context) (err error) { +func (page *GroupCollectionPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IssueCollectionPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/GroupCollectionPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -4757,18 +5040,1037 @@ func (page *IssueCollectionPage) NextWithContext(ctx context.Context) (err error tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.ic) + next, err := page.fn(ctx, page.gc) if err != nil { return err } - page.ic = next + page.gc = next return nil } // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (page *IssueCollectionPage) Next() error { +func (page *GroupCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page GroupCollectionPage) NotDone() bool { + return !page.gc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page GroupCollectionPage) Response() GroupCollection { + return page.gc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page GroupCollectionPage) Values() []GroupContract { + if page.gc.IsEmpty() { + return nil + } + return *page.gc.Value +} + +// Creates a new instance of the GroupCollectionPage type. +func NewGroupCollectionPage(getNextPage func(context.Context, GroupCollection) (GroupCollection, error)) GroupCollectionPage { + return GroupCollectionPage{fn: getNextPage} +} + +// GroupContract contract details. +type GroupContract struct { + autorest.Response `json:"-"` + // GroupContractProperties - Group entity contract properties. + *GroupContractProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for GroupContract. +func (gc GroupContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gc.GroupContractProperties != nil { + objectMap["properties"] = gc.GroupContractProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GroupContract struct. +func (gc *GroupContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var groupContractProperties GroupContractProperties + err = json.Unmarshal(*v, &groupContractProperties) + if err != nil { + return err + } + gc.GroupContractProperties = &groupContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + gc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + gc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + gc.Type = &typeVar + } + } + } + + return nil +} + +// GroupContractProperties group contract Properties. +type GroupContractProperties struct { + // DisplayName - Group name. + DisplayName *string `json:"displayName,omitempty"` + // Description - Group description. Can contain HTML formatting tags. + Description *string `json:"description,omitempty"` + // BuiltIn - READ-ONLY; true if the group is one of the three system groups (Administrators, Developers, or Guests); otherwise false. + BuiltIn *bool `json:"builtIn,omitempty"` + // Type - Group type. Possible values include: 'Custom', 'System', 'External' + Type GroupType `json:"type,omitempty"` + // ExternalID - For external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active Directory `aad://.onmicrosoft.com/groups/`; otherwise the value is null. + ExternalID *string `json:"externalId,omitempty"` +} + +// GroupCreateParameters parameters supplied to the Create Group operation. +type GroupCreateParameters struct { + // GroupCreateParametersProperties - Properties supplied to Create Group operation. + *GroupCreateParametersProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for GroupCreateParameters. +func (gcp GroupCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gcp.GroupCreateParametersProperties != nil { + objectMap["properties"] = gcp.GroupCreateParametersProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GroupCreateParameters struct. +func (gcp *GroupCreateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var groupCreateParametersProperties GroupCreateParametersProperties + err = json.Unmarshal(*v, &groupCreateParametersProperties) + if err != nil { + return err + } + gcp.GroupCreateParametersProperties = &groupCreateParametersProperties + } + } + } + + return nil +} + +// GroupCreateParametersProperties parameters supplied to the Create Group operation. +type GroupCreateParametersProperties struct { + // DisplayName - Group name. + DisplayName *string `json:"displayName,omitempty"` + // Description - Group description. + Description *string `json:"description,omitempty"` + // Type - Group type. Possible values include: 'Custom', 'System', 'External' + Type GroupType `json:"type,omitempty"` + // 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://.onmicrosoft.com/groups/`; otherwise the value is null. + ExternalID *string `json:"externalId,omitempty"` +} + +// GroupUpdateParameters parameters supplied to the Update Group operation. +type GroupUpdateParameters struct { + // GroupUpdateParametersProperties - Group entity update contract properties. + *GroupUpdateParametersProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for GroupUpdateParameters. +func (gup GroupUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gup.GroupUpdateParametersProperties != nil { + objectMap["properties"] = gup.GroupUpdateParametersProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GroupUpdateParameters struct. +func (gup *GroupUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var groupUpdateParametersProperties GroupUpdateParametersProperties + err = json.Unmarshal(*v, &groupUpdateParametersProperties) + if err != nil { + return err + } + gup.GroupUpdateParametersProperties = &groupUpdateParametersProperties + } + } + } + + return nil +} + +// GroupUpdateParametersProperties parameters supplied to the Update Group operation. +type GroupUpdateParametersProperties struct { + // DisplayName - Group name. + DisplayName *string `json:"displayName,omitempty"` + // Description - Group description. + Description *string `json:"description,omitempty"` + // Type - Group type. Possible values include: 'Custom', 'System', 'External' + Type GroupType `json:"type,omitempty"` + // 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://.onmicrosoft.com/groups/`; otherwise the value is null. + ExternalID *string `json:"externalId,omitempty"` +} + +// HostnameConfiguration custom hostname configuration. +type HostnameConfiguration struct { + // Type - Hostname type. Possible values include: 'HostnameTypeProxy', 'HostnameTypePortal', 'HostnameTypeManagement', 'HostnameTypeScm', 'HostnameTypeDeveloperPortal' + Type HostnameType `json:"type,omitempty"` + // HostName - Hostname to configure on the Api Management service. + HostName *string `json:"hostName,omitempty"` + // KeyVaultID - Url to the KeyVault Secret containing the Ssl Certificate. If absolute Url containing version is provided, auto-update of ssl certificate will not work. This requires Api Management service to be configured with MSI. The secret should be of type *application/x-pkcs12* + KeyVaultID *string `json:"keyVaultId,omitempty"` + // EncodedCertificate - Base64 Encoded certificate. + EncodedCertificate *string `json:"encodedCertificate,omitempty"` + // CertificatePassword - Certificate Password. + CertificatePassword *string `json:"certificatePassword,omitempty"` + // DefaultSslBinding - Specify true to setup the certificate associated with this Hostname as the Default SSL Certificate. If a client does not send the SNI header, then this will be the certificate that will be challenged. The property is useful if a service has multiple custom hostname enabled and it needs to decide on the default ssl certificate. The setting only applied to Proxy Hostname Type. + DefaultSslBinding *bool `json:"defaultSslBinding,omitempty"` + // NegotiateClientCertificate - Specify true to always negotiate client certificate on the hostname. Default Value is false. + NegotiateClientCertificate *bool `json:"negotiateClientCertificate,omitempty"` + // Certificate - Certificate information. + Certificate *CertificateInformation `json:"certificate,omitempty"` +} + +// HTTPMessageDiagnostic http message diagnostic settings. +type HTTPMessageDiagnostic struct { + // Headers - Array of HTTP Headers to log. + Headers *[]string `json:"headers,omitempty"` + // Body - Body logging settings. + Body *BodyDiagnosticSettings `json:"body,omitempty"` +} + +// IdentityProviderBaseParameters identity Provider Base Parameter Properties. +type IdentityProviderBaseParameters struct { + // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' + Type IdentityProviderType `json:"type,omitempty"` + // SigninTenant - The TenantId to use instead of Common when logging into Active Directory + SigninTenant *string `json:"signinTenant,omitempty"` + // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. + AllowedTenants *[]string `json:"allowedTenants,omitempty"` + // Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C. + Authority *string `json:"authority,omitempty"` + // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. + SignupPolicyName *string `json:"signupPolicyName,omitempty"` + // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. + SigninPolicyName *string `json:"signinPolicyName,omitempty"` + // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. + ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` + // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` +} + +// IdentityProviderContract identity Provider details. +type IdentityProviderContract struct { + autorest.Response `json:"-"` + // IdentityProviderContractProperties - Identity Provider contract properties. + *IdentityProviderContractProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for IdentityProviderContract. +func (ipc IdentityProviderContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ipc.IdentityProviderContractProperties != nil { + objectMap["properties"] = ipc.IdentityProviderContractProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IdentityProviderContract struct. +func (ipc *IdentityProviderContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var identityProviderContractProperties IdentityProviderContractProperties + err = json.Unmarshal(*v, &identityProviderContractProperties) + if err != nil { + return err + } + ipc.IdentityProviderContractProperties = &identityProviderContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ipc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ipc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ipc.Type = &typeVar + } + } + } + + return nil +} + +// IdentityProviderContractProperties the external Identity Providers like Facebook, Google, Microsoft, +// Twitter or Azure Active Directory which can be used to enable access to the API Management service +// developer portal for all users. +type IdentityProviderContractProperties struct { + // 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. + ClientID *string `json:"clientId,omitempty"` + // 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. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + ClientSecret *string `json:"clientSecret,omitempty"` + // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' + Type IdentityProviderType `json:"type,omitempty"` + // SigninTenant - The TenantId to use instead of Common when logging into Active Directory + SigninTenant *string `json:"signinTenant,omitempty"` + // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. + AllowedTenants *[]string `json:"allowedTenants,omitempty"` + // Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C. + Authority *string `json:"authority,omitempty"` + // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. + SignupPolicyName *string `json:"signupPolicyName,omitempty"` + // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. + SigninPolicyName *string `json:"signinPolicyName,omitempty"` + // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. + ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` + // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` +} + +// IdentityProviderCreateContract identity Provider details. +type IdentityProviderCreateContract struct { + // IdentityProviderCreateContractProperties - Identity Provider contract properties. + *IdentityProviderCreateContractProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for IdentityProviderCreateContract. +func (ipcc IdentityProviderCreateContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ipcc.IdentityProviderCreateContractProperties != nil { + objectMap["properties"] = ipcc.IdentityProviderCreateContractProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IdentityProviderCreateContract struct. +func (ipcc *IdentityProviderCreateContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var identityProviderCreateContractProperties IdentityProviderCreateContractProperties + err = json.Unmarshal(*v, &identityProviderCreateContractProperties) + if err != nil { + return err + } + ipcc.IdentityProviderCreateContractProperties = &identityProviderCreateContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ipcc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ipcc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ipcc.Type = &typeVar + } + } + } + + return nil +} + +// IdentityProviderCreateContractProperties the external Identity Providers like Facebook, Google, +// Microsoft, Twitter or Azure Active Directory which can be used to enable access to the API Management +// service developer portal for all users. +type IdentityProviderCreateContractProperties struct { + // 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. + ClientID *string `json:"clientId,omitempty"` + // 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. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + ClientSecret *string `json:"clientSecret,omitempty"` + // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' + Type IdentityProviderType `json:"type,omitempty"` + // SigninTenant - The TenantId to use instead of Common when logging into Active Directory + SigninTenant *string `json:"signinTenant,omitempty"` + // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. + AllowedTenants *[]string `json:"allowedTenants,omitempty"` + // Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C. + Authority *string `json:"authority,omitempty"` + // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. + SignupPolicyName *string `json:"signupPolicyName,omitempty"` + // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. + SigninPolicyName *string `json:"signinPolicyName,omitempty"` + // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. + ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` + // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` +} + +// IdentityProviderList list of all the Identity Providers configured on the service instance. +type IdentityProviderList struct { + autorest.Response `json:"-"` + // Value - Identity Provider configuration values. + Value *[]IdentityProviderContract `json:"value,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// IdentityProviderListIterator provides access to a complete listing of IdentityProviderContract values. +type IdentityProviderListIterator struct { + i int + page IdentityProviderListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *IdentityProviderListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IdentityProviderListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *IdentityProviderListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter IdentityProviderListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter IdentityProviderListIterator) Response() IdentityProviderList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter IdentityProviderListIterator) Value() IdentityProviderContract { + if !iter.page.NotDone() { + return IdentityProviderContract{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the IdentityProviderListIterator type. +func NewIdentityProviderListIterator(page IdentityProviderListPage) IdentityProviderListIterator { + return IdentityProviderListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ipl IdentityProviderList) IsEmpty() bool { + return ipl.Value == nil || len(*ipl.Value) == 0 +} + +// identityProviderListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ipl IdentityProviderList) identityProviderListPreparer(ctx context.Context) (*http.Request, error) { + if ipl.NextLink == nil || len(to.String(ipl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ipl.NextLink))) +} + +// IdentityProviderListPage contains a page of IdentityProviderContract values. +type IdentityProviderListPage struct { + fn func(context.Context, IdentityProviderList) (IdentityProviderList, error) + ipl IdentityProviderList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *IdentityProviderListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IdentityProviderListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.ipl) + if err != nil { + return err + } + page.ipl = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *IdentityProviderListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page IdentityProviderListPage) NotDone() bool { + return !page.ipl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page IdentityProviderListPage) Response() IdentityProviderList { + return page.ipl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page IdentityProviderListPage) Values() []IdentityProviderContract { + if page.ipl.IsEmpty() { + return nil + } + return *page.ipl.Value +} + +// Creates a new instance of the IdentityProviderListPage type. +func NewIdentityProviderListPage(getNextPage func(context.Context, IdentityProviderList) (IdentityProviderList, error)) IdentityProviderListPage { + return IdentityProviderListPage{fn: getNextPage} +} + +// IdentityProviderUpdateParameters parameters supplied to update Identity Provider +type IdentityProviderUpdateParameters struct { + // IdentityProviderUpdateProperties - Identity Provider update properties. + *IdentityProviderUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for IdentityProviderUpdateParameters. +func (ipup IdentityProviderUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ipup.IdentityProviderUpdateProperties != nil { + objectMap["properties"] = ipup.IdentityProviderUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IdentityProviderUpdateParameters struct. +func (ipup *IdentityProviderUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var identityProviderUpdateProperties IdentityProviderUpdateProperties + err = json.Unmarshal(*v, &identityProviderUpdateProperties) + if err != nil { + return err + } + ipup.IdentityProviderUpdateProperties = &identityProviderUpdateProperties + } + } + } + + return nil +} + +// IdentityProviderUpdateProperties parameters supplied to the Update Identity Provider operation. +type IdentityProviderUpdateProperties struct { + // 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. + ClientID *string `json:"clientId,omitempty"` + // 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. + ClientSecret *string `json:"clientSecret,omitempty"` + // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' + Type IdentityProviderType `json:"type,omitempty"` + // SigninTenant - The TenantId to use instead of Common when logging into Active Directory + SigninTenant *string `json:"signinTenant,omitempty"` + // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. + AllowedTenants *[]string `json:"allowedTenants,omitempty"` + // Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C. + Authority *string `json:"authority,omitempty"` + // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. + SignupPolicyName *string `json:"signupPolicyName,omitempty"` + // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. + SigninPolicyName *string `json:"signinPolicyName,omitempty"` + // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. + ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` + // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` +} + +// IssueAttachmentCollection paged Issue Attachment list representation. +type IssueAttachmentCollection struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Issue Attachment values. + Value *[]IssueAttachmentContract `json:"value,omitempty"` + // NextLink - READ-ONLY; Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// IssueAttachmentCollectionIterator provides access to a complete listing of IssueAttachmentContract +// values. +type IssueAttachmentCollectionIterator struct { + i int + page IssueAttachmentCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *IssueAttachmentCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IssueAttachmentCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *IssueAttachmentCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter IssueAttachmentCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter IssueAttachmentCollectionIterator) Response() IssueAttachmentCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter IssueAttachmentCollectionIterator) Value() IssueAttachmentContract { + if !iter.page.NotDone() { + return IssueAttachmentContract{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the IssueAttachmentCollectionIterator type. +func NewIssueAttachmentCollectionIterator(page IssueAttachmentCollectionPage) IssueAttachmentCollectionIterator { + return IssueAttachmentCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (iac IssueAttachmentCollection) IsEmpty() bool { + return iac.Value == nil || len(*iac.Value) == 0 +} + +// issueAttachmentCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (iac IssueAttachmentCollection) issueAttachmentCollectionPreparer(ctx context.Context) (*http.Request, error) { + if iac.NextLink == nil || len(to.String(iac.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(iac.NextLink))) +} + +// IssueAttachmentCollectionPage contains a page of IssueAttachmentContract values. +type IssueAttachmentCollectionPage struct { + fn func(context.Context, IssueAttachmentCollection) (IssueAttachmentCollection, error) + iac IssueAttachmentCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *IssueAttachmentCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IssueAttachmentCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.iac) + if err != nil { + return err + } + page.iac = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *IssueAttachmentCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page IssueAttachmentCollectionPage) NotDone() bool { + return !page.iac.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page IssueAttachmentCollectionPage) Response() IssueAttachmentCollection { + return page.iac +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page IssueAttachmentCollectionPage) Values() []IssueAttachmentContract { + if page.iac.IsEmpty() { + return nil + } + return *page.iac.Value +} + +// Creates a new instance of the IssueAttachmentCollectionPage type. +func NewIssueAttachmentCollectionPage(getNextPage func(context.Context, IssueAttachmentCollection) (IssueAttachmentCollection, error)) IssueAttachmentCollectionPage { + return IssueAttachmentCollectionPage{fn: getNextPage} +} + +// IssueAttachmentContract issue Attachment Contract details. +type IssueAttachmentContract struct { + autorest.Response `json:"-"` + // IssueAttachmentContractProperties - Properties of the Issue Attachment. + *IssueAttachmentContractProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for IssueAttachmentContract. +func (iac IssueAttachmentContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if iac.IssueAttachmentContractProperties != nil { + objectMap["properties"] = iac.IssueAttachmentContractProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IssueAttachmentContract struct. +func (iac *IssueAttachmentContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var issueAttachmentContractProperties IssueAttachmentContractProperties + err = json.Unmarshal(*v, &issueAttachmentContractProperties) + if err != nil { + return err + } + iac.IssueAttachmentContractProperties = &issueAttachmentContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + iac.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + iac.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + iac.Type = &typeVar + } + } + } + + return nil +} + +// IssueAttachmentContractProperties issue Attachment contract Properties. +type IssueAttachmentContractProperties struct { + // Title - Filename by which the binary data will be saved. + Title *string `json:"title,omitempty"` + // ContentFormat - Either 'link' if content is provided via an HTTP link or the MIME type of the Base64-encoded binary data provided in the 'content' property. + ContentFormat *string `json:"contentFormat,omitempty"` + // Content - An HTTP link or Base64-encoded binary data. + Content *string `json:"content,omitempty"` +} + +// IssueCollection paged Issue list representation. +type IssueCollection struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Issue values. + Value *[]IssueContract `json:"value,omitempty"` + // NextLink - READ-ONLY; Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// IssueCollectionIterator provides access to a complete listing of IssueContract values. +type IssueCollectionIterator struct { + i int + page IssueCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *IssueCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IssueCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *IssueCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter IssueCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter IssueCollectionIterator) Response() IssueCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter IssueCollectionIterator) Value() IssueContract { + if !iter.page.NotDone() { + return IssueContract{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the IssueCollectionIterator type. +func NewIssueCollectionIterator(page IssueCollectionPage) IssueCollectionIterator { + return IssueCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ic IssueCollection) IsEmpty() bool { + return ic.Value == nil || len(*ic.Value) == 0 +} + +// issueCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ic IssueCollection) issueCollectionPreparer(ctx context.Context) (*http.Request, error) { + if ic.NextLink == nil || len(to.String(ic.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ic.NextLink))) +} + +// IssueCollectionPage contains a page of IssueContract values. +type IssueCollectionPage struct { + fn func(context.Context, IssueCollection) (IssueCollection, error) + ic IssueCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *IssueCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IssueCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.ic) + if err != nil { + return err + } + page.ic = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *IssueCollectionPage) Next() error { return page.NextWithContext(context.Background()) } @@ -4777,44 +6079,435 @@ func (page IssueCollectionPage) NotDone() bool { return !page.ic.IsEmpty() } -// Response returns the raw server response from the last page request. -func (page IssueCollectionPage) Response() IssueCollection { - return page.ic +// Response returns the raw server response from the last page request. +func (page IssueCollectionPage) Response() IssueCollection { + return page.ic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page IssueCollectionPage) Values() []IssueContract { + if page.ic.IsEmpty() { + return nil + } + return *page.ic.Value +} + +// Creates a new instance of the IssueCollectionPage type. +func NewIssueCollectionPage(getNextPage func(context.Context, IssueCollection) (IssueCollection, error)) IssueCollectionPage { + return IssueCollectionPage{fn: getNextPage} +} + +// IssueCommentCollection paged Issue Comment list representation. +type IssueCommentCollection struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Issue Comment values. + Value *[]IssueCommentContract `json:"value,omitempty"` + // NextLink - READ-ONLY; Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// IssueCommentCollectionIterator provides access to a complete listing of IssueCommentContract values. +type IssueCommentCollectionIterator struct { + i int + page IssueCommentCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *IssueCommentCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IssueCommentCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *IssueCommentCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter IssueCommentCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter IssueCommentCollectionIterator) Response() IssueCommentCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter IssueCommentCollectionIterator) Value() IssueCommentContract { + if !iter.page.NotDone() { + return IssueCommentContract{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the IssueCommentCollectionIterator type. +func NewIssueCommentCollectionIterator(page IssueCommentCollectionPage) IssueCommentCollectionIterator { + return IssueCommentCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (icc IssueCommentCollection) IsEmpty() bool { + return icc.Value == nil || len(*icc.Value) == 0 +} + +// issueCommentCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (icc IssueCommentCollection) issueCommentCollectionPreparer(ctx context.Context) (*http.Request, error) { + if icc.NextLink == nil || len(to.String(icc.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(icc.NextLink))) +} + +// IssueCommentCollectionPage contains a page of IssueCommentContract values. +type IssueCommentCollectionPage struct { + fn func(context.Context, IssueCommentCollection) (IssueCommentCollection, error) + icc IssueCommentCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *IssueCommentCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IssueCommentCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.icc) + if err != nil { + return err + } + page.icc = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *IssueCommentCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page IssueCommentCollectionPage) NotDone() bool { + return !page.icc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page IssueCommentCollectionPage) Response() IssueCommentCollection { + return page.icc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page IssueCommentCollectionPage) Values() []IssueCommentContract { + if page.icc.IsEmpty() { + return nil + } + return *page.icc.Value +} + +// Creates a new instance of the IssueCommentCollectionPage type. +func NewIssueCommentCollectionPage(getNextPage func(context.Context, IssueCommentCollection) (IssueCommentCollection, error)) IssueCommentCollectionPage { + return IssueCommentCollectionPage{fn: getNextPage} +} + +// IssueCommentContract issue Comment Contract details. +type IssueCommentContract struct { + autorest.Response `json:"-"` + // IssueCommentContractProperties - Properties of the Issue Comment. + *IssueCommentContractProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for IssueCommentContract. +func (icc IssueCommentContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if icc.IssueCommentContractProperties != nil { + objectMap["properties"] = icc.IssueCommentContractProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IssueCommentContract struct. +func (icc *IssueCommentContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var issueCommentContractProperties IssueCommentContractProperties + err = json.Unmarshal(*v, &issueCommentContractProperties) + if err != nil { + return err + } + icc.IssueCommentContractProperties = &issueCommentContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + icc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + icc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + icc.Type = &typeVar + } + } + } + + return nil +} + +// IssueCommentContractProperties issue Comment contract Properties. +type IssueCommentContractProperties struct { + // Text - Comment text. + Text *string `json:"text,omitempty"` + // CreatedDate - Date and time when the comment was created. + CreatedDate *date.Time `json:"createdDate,omitempty"` + // UserID - A resource identifier for the user who left the comment. + UserID *string `json:"userId,omitempty"` +} + +// IssueContract issue Contract details. +type IssueContract struct { + autorest.Response `json:"-"` + // IssueContractProperties - Properties of the Issue. + *IssueContractProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for IssueContract. +func (ic IssueContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ic.IssueContractProperties != nil { + objectMap["properties"] = ic.IssueContractProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IssueContract struct. +func (ic *IssueContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var issueContractProperties IssueContractProperties + err = json.Unmarshal(*v, &issueContractProperties) + if err != nil { + return err + } + ic.IssueContractProperties = &issueContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ic.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ic.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ic.Type = &typeVar + } + } + } + + return nil +} + +// IssueContractBaseProperties issue contract Base Properties. +type IssueContractBaseProperties struct { + // CreatedDate - Date and time when the issue was created. + CreatedDate *date.Time `json:"createdDate,omitempty"` + // State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed' + State State `json:"state,omitempty"` + // APIID - A resource identifier for the API the issue was created for. + APIID *string `json:"apiId,omitempty"` } -// Values returns the slice of values for the current page or nil if there are no values. -func (page IssueCollectionPage) Values() []IssueContract { - if page.ic.IsEmpty() { - return nil +// IssueContractProperties issue contract Properties. +type IssueContractProperties struct { + // Title - The issue title. + Title *string `json:"title,omitempty"` + // Description - Text describing the issue. + Description *string `json:"description,omitempty"` + // UserID - A resource identifier for the user created the issue. + UserID *string `json:"userId,omitempty"` + // CreatedDate - Date and time when the issue was created. + CreatedDate *date.Time `json:"createdDate,omitempty"` + // State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed' + State State `json:"state,omitempty"` + // APIID - A resource identifier for the API the issue was created for. + APIID *string `json:"apiId,omitempty"` +} + +// IssueUpdateContract issue update Parameters. +type IssueUpdateContract struct { + // IssueUpdateContractProperties - Issue entity Update contract properties. + *IssueUpdateContractProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for IssueUpdateContract. +func (iuc IssueUpdateContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if iuc.IssueUpdateContractProperties != nil { + objectMap["properties"] = iuc.IssueUpdateContractProperties } - return *page.ic.Value + return json.Marshal(objectMap) } -// Creates a new instance of the IssueCollectionPage type. -func NewIssueCollectionPage(getNextPage func(context.Context, IssueCollection) (IssueCollection, error)) IssueCollectionPage { - return IssueCollectionPage{fn: getNextPage} +// UnmarshalJSON is the custom unmarshaler for IssueUpdateContract struct. +func (iuc *IssueUpdateContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var issueUpdateContractProperties IssueUpdateContractProperties + err = json.Unmarshal(*v, &issueUpdateContractProperties) + if err != nil { + return err + } + iuc.IssueUpdateContractProperties = &issueUpdateContractProperties + } + } + } + + return nil } -// IssueCommentCollection paged Issue Comment list representation. -type IssueCommentCollection struct { +// IssueUpdateContractProperties issue contract Update Properties. +type IssueUpdateContractProperties struct { + // Title - The issue title. + Title *string `json:"title,omitempty"` + // Description - Text describing the issue. + Description *string `json:"description,omitempty"` + // UserID - A resource identifier for the user created the issue. + UserID *string `json:"userId,omitempty"` + // CreatedDate - Date and time when the issue was created. + CreatedDate *date.Time `json:"createdDate,omitempty"` + // State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed' + State State `json:"state,omitempty"` + // APIID - A resource identifier for the API the issue was created for. + APIID *string `json:"apiId,omitempty"` +} + +// ListNetworkStatusContractByLocation ... +type ListNetworkStatusContractByLocation struct { autorest.Response `json:"-"` - // Value - READ-ONLY; Issue Comment values. - Value *[]IssueCommentContract `json:"value,omitempty"` - // NextLink - READ-ONLY; Next page link if any. + Value *[]NetworkStatusContractByLocation `json:"value,omitempty"` +} + +// LoggerCollection paged Logger list representation. +type LoggerCollection struct { + autorest.Response `json:"-"` + // Value - Logger values. + Value *[]LoggerContract `json:"value,omitempty"` + // Count - Total record count number across all pages. + Count *int64 `json:"count,omitempty"` + // NextLink - Next page link if any. NextLink *string `json:"nextLink,omitempty"` } -// IssueCommentCollectionIterator provides access to a complete listing of IssueCommentContract values. -type IssueCommentCollectionIterator struct { +// LoggerCollectionIterator provides access to a complete listing of LoggerContract values. +type LoggerCollectionIterator struct { i int - page IssueCommentCollectionPage + page LoggerCollectionPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *IssueCommentCollectionIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *LoggerCollectionIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IssueCommentCollectionIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/LoggerCollectionIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -4839,62 +6532,62 @@ func (iter *IssueCommentCollectionIterator) NextWithContext(ctx context.Context) // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *IssueCommentCollectionIterator) Next() error { +func (iter *LoggerCollectionIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter IssueCommentCollectionIterator) NotDone() bool { +func (iter LoggerCollectionIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. -func (iter IssueCommentCollectionIterator) Response() IssueCommentCollection { +func (iter LoggerCollectionIterator) Response() LoggerCollection { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter IssueCommentCollectionIterator) Value() IssueCommentContract { +func (iter LoggerCollectionIterator) Value() LoggerContract { if !iter.page.NotDone() { - return IssueCommentContract{} + return LoggerContract{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the IssueCommentCollectionIterator type. -func NewIssueCommentCollectionIterator(page IssueCommentCollectionPage) IssueCommentCollectionIterator { - return IssueCommentCollectionIterator{page: page} +// Creates a new instance of the LoggerCollectionIterator type. +func NewLoggerCollectionIterator(page LoggerCollectionPage) LoggerCollectionIterator { + return LoggerCollectionIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (icc IssueCommentCollection) IsEmpty() bool { - return icc.Value == nil || len(*icc.Value) == 0 +func (lc LoggerCollection) IsEmpty() bool { + return lc.Value == nil || len(*lc.Value) == 0 } -// issueCommentCollectionPreparer prepares a request to retrieve the next set of results. +// loggerCollectionPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (icc IssueCommentCollection) issueCommentCollectionPreparer(ctx context.Context) (*http.Request, error) { - if icc.NextLink == nil || len(to.String(icc.NextLink)) < 1 { +func (lc LoggerCollection) loggerCollectionPreparer(ctx context.Context) (*http.Request, error) { + if lc.NextLink == nil || len(to.String(lc.NextLink)) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(icc.NextLink))) + autorest.WithBaseURL(to.String(lc.NextLink))) } -// IssueCommentCollectionPage contains a page of IssueCommentContract values. -type IssueCommentCollectionPage struct { - fn func(context.Context, IssueCommentCollection) (IssueCommentCollection, error) - icc IssueCommentCollection +// LoggerCollectionPage contains a page of LoggerContract values. +type LoggerCollectionPage struct { + fn func(context.Context, LoggerCollection) (LoggerCollection, error) + lc LoggerCollection } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *IssueCommentCollectionPage) NextWithContext(ctx context.Context) (err error) { +func (page *LoggerCollectionPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IssueCommentCollectionPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/LoggerCollectionPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -4903,132 +6596,49 @@ func (page *IssueCommentCollectionPage) NextWithContext(ctx context.Context) (er tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.icc) + next, err := page.fn(ctx, page.lc) if err != nil { return err } - page.icc = next + page.lc = next return nil } // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (page *IssueCommentCollectionPage) Next() error { +func (page *LoggerCollectionPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page IssueCommentCollectionPage) NotDone() bool { - return !page.icc.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page IssueCommentCollectionPage) Response() IssueCommentCollection { - return page.icc -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page IssueCommentCollectionPage) Values() []IssueCommentContract { - if page.icc.IsEmpty() { - return nil - } - return *page.icc.Value -} - -// Creates a new instance of the IssueCommentCollectionPage type. -func NewIssueCommentCollectionPage(getNextPage func(context.Context, IssueCommentCollection) (IssueCommentCollection, error)) IssueCommentCollectionPage { - return IssueCommentCollectionPage{fn: getNextPage} -} - -// IssueCommentContract issue Comment Contract details. -type IssueCommentContract struct { - autorest.Response `json:"-"` - // IssueCommentContractProperties - Properties of the Issue Comment. - *IssueCommentContractProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type for API Management resource. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for IssueCommentContract. -func (icc IssueCommentContract) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if icc.IssueCommentContractProperties != nil { - objectMap["properties"] = icc.IssueCommentContractProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for IssueCommentContract struct. -func (icc *IssueCommentContract) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var issueCommentContractProperties IssueCommentContractProperties - err = json.Unmarshal(*v, &issueCommentContractProperties) - if err != nil { - return err - } - icc.IssueCommentContractProperties = &issueCommentContractProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - icc.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - icc.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - icc.Type = &typeVar - } - } - } +func (page LoggerCollectionPage) NotDone() bool { + return !page.lc.IsEmpty() +} - return nil +// Response returns the raw server response from the last page request. +func (page LoggerCollectionPage) Response() LoggerCollection { + return page.lc } -// IssueCommentContractProperties issue Comment contract Properties. -type IssueCommentContractProperties struct { - // Text - Comment text. - Text *string `json:"text,omitempty"` - // CreatedDate - Date and time when the comment was created. - CreatedDate *date.Time `json:"createdDate,omitempty"` - // UserID - A resource identifier for the user who left the comment. - UserID *string `json:"userId,omitempty"` +// Values returns the slice of values for the current page or nil if there are no values. +func (page LoggerCollectionPage) Values() []LoggerContract { + if page.lc.IsEmpty() { + return nil + } + return *page.lc.Value } -// IssueContract issue Contract details. -type IssueContract struct { +// Creates a new instance of the LoggerCollectionPage type. +func NewLoggerCollectionPage(getNextPage func(context.Context, LoggerCollection) (LoggerCollection, error)) LoggerCollectionPage { + return LoggerCollectionPage{fn: getNextPage} +} + +// LoggerContract logger details. +type LoggerContract struct { autorest.Response `json:"-"` - // IssueContractProperties - Properties of the Issue. - *IssueContractProperties `json:"properties,omitempty"` + // LoggerContractProperties - Logger entity contract properties. + *LoggerContractProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -5037,17 +6647,17 @@ type IssueContract struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for IssueContract. -func (ic IssueContract) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for LoggerContract. +func (lc LoggerContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if ic.IssueContractProperties != nil { - objectMap["properties"] = ic.IssueContractProperties + if lc.LoggerContractProperties != nil { + objectMap["properties"] = lc.LoggerContractProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for IssueContract struct. -func (ic *IssueContract) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for LoggerContract struct. +func (lc *LoggerContract) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -5057,12 +6667,12 @@ func (ic *IssueContract) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var issueContractProperties IssueContractProperties - err = json.Unmarshal(*v, &issueContractProperties) + var loggerContractProperties LoggerContractProperties + err = json.Unmarshal(*v, &loggerContractProperties) if err != nil { return err } - ic.IssueContractProperties = &issueContractProperties + lc.LoggerContractProperties = &loggerContractProperties } case "id": if v != nil { @@ -5071,7 +6681,7 @@ func (ic *IssueContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - ic.ID = &ID + lc.ID = &ID } case "name": if v != nil { @@ -5080,7 +6690,7 @@ func (ic *IssueContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - ic.Name = &name + lc.Name = &name } case "type": if v != nil { @@ -5089,7 +6699,7 @@ func (ic *IssueContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - ic.Type = &typeVar + lc.Type = &typeVar } } } @@ -5097,49 +6707,61 @@ func (ic *IssueContract) UnmarshalJSON(body []byte) error { return nil } -// IssueContractBaseProperties issue contract Base Properties. -type IssueContractBaseProperties struct { - // CreatedDate - Date and time when the issue was created. - CreatedDate *date.Time `json:"createdDate,omitempty"` - // State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed' - State State `json:"state,omitempty"` - // APIID - A resource identifier for the API the issue was created for. - APIID *string `json:"apiId,omitempty"` +// LoggerContractProperties the Logger entity in API Management represents an event sink that you can use +// to log API Management events. Currently the Logger entity supports logging API Management events to +// Azure Event Hubs. +type LoggerContractProperties struct { + // LoggerType - Logger type. Possible values include: 'AzureEventHub', 'ApplicationInsights' + LoggerType LoggerType `json:"loggerType,omitempty"` + // Description - Logger description. + Description *string `json:"description,omitempty"` + // Credentials - The name and SendRule connection string of the event hub for azureEventHub logger. + // Instrumentation key for applicationInsights logger. + Credentials map[string]*string `json:"credentials"` + // IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true. + IsBuffered *bool `json:"isBuffered,omitempty"` + // ResourceID - Azure Resource Id of a log target (either Azure Event Hub resource or Azure Application Insights resource). + ResourceID *string `json:"resourceId,omitempty"` } -// IssueContractProperties issue contract Properties. -type IssueContractProperties struct { - // Title - The issue title. - Title *string `json:"title,omitempty"` - // Description - Text describing the issue. - Description *string `json:"description,omitempty"` - // UserID - A resource identifier for the user created the issue. - UserID *string `json:"userId,omitempty"` - // CreatedDate - Date and time when the issue was created. - CreatedDate *date.Time `json:"createdDate,omitempty"` - // State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed' - State State `json:"state,omitempty"` - // APIID - A resource identifier for the API the issue was created for. - APIID *string `json:"apiId,omitempty"` +// MarshalJSON is the custom marshaler for LoggerContractProperties. +func (lcp LoggerContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lcp.LoggerType != "" { + objectMap["loggerType"] = lcp.LoggerType + } + if lcp.Description != nil { + objectMap["description"] = lcp.Description + } + if lcp.Credentials != nil { + objectMap["credentials"] = lcp.Credentials + } + if lcp.IsBuffered != nil { + objectMap["isBuffered"] = lcp.IsBuffered + } + if lcp.ResourceID != nil { + objectMap["resourceId"] = lcp.ResourceID + } + return json.Marshal(objectMap) } -// IssueUpdateContract issue update Parameters. -type IssueUpdateContract struct { - // IssueUpdateContractProperties - Issue entity Update contract properties. - *IssueUpdateContractProperties `json:"properties,omitempty"` +// LoggerUpdateContract logger update contract. +type LoggerUpdateContract struct { + // LoggerUpdateParameters - Logger entity update contract properties. + *LoggerUpdateParameters `json:"properties,omitempty"` } -// MarshalJSON is the custom marshaler for IssueUpdateContract. -func (iuc IssueUpdateContract) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for LoggerUpdateContract. +func (luc LoggerUpdateContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if iuc.IssueUpdateContractProperties != nil { - objectMap["properties"] = iuc.IssueUpdateContractProperties + if luc.LoggerUpdateParameters != nil { + objectMap["properties"] = luc.LoggerUpdateParameters } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for IssueUpdateContract struct. -func (iuc *IssueUpdateContract) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for LoggerUpdateContract struct. +func (luc *LoggerUpdateContract) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -5149,12 +6771,12 @@ func (iuc *IssueUpdateContract) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var issueUpdateContractProperties IssueUpdateContractProperties - err = json.Unmarshal(*v, &issueUpdateContractProperties) + var loggerUpdateParameters LoggerUpdateParameters + err = json.Unmarshal(*v, &loggerUpdateParameters) if err != nil { return err } - iuc.IssueUpdateContractProperties = &issueUpdateContractProperties + luc.LoggerUpdateParameters = &loggerUpdateParameters } } } @@ -5162,50 +6784,56 @@ func (iuc *IssueUpdateContract) UnmarshalJSON(body []byte) error { return nil } -// IssueUpdateContractProperties issue contract Update Properties. -type IssueUpdateContractProperties struct { - // Title - The issue title. - Title *string `json:"title,omitempty"` - // Description - Text describing the issue. +// LoggerUpdateParameters parameters supplied to the Update Logger operation. +type LoggerUpdateParameters struct { + // LoggerType - Logger type. Possible values include: 'AzureEventHub', 'ApplicationInsights' + LoggerType LoggerType `json:"loggerType,omitempty"` + // Description - Logger description. Description *string `json:"description,omitempty"` - // UserID - A resource identifier for the user created the issue. - UserID *string `json:"userId,omitempty"` - // CreatedDate - Date and time when the issue was created. - CreatedDate *date.Time `json:"createdDate,omitempty"` - // State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed' - State State `json:"state,omitempty"` - // APIID - A resource identifier for the API the issue was created for. - APIID *string `json:"apiId,omitempty"` + // Credentials - Logger credentials. + Credentials map[string]*string `json:"credentials"` + // IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true. + IsBuffered *bool `json:"isBuffered,omitempty"` } -// ListNetworkStatusContractByLocation ... -type ListNetworkStatusContractByLocation struct { - autorest.Response `json:"-"` - Value *[]NetworkStatusContractByLocation `json:"value,omitempty"` +// MarshalJSON is the custom marshaler for LoggerUpdateParameters. +func (lup LoggerUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lup.LoggerType != "" { + objectMap["loggerType"] = lup.LoggerType + } + if lup.Description != nil { + objectMap["description"] = lup.Description + } + if lup.Credentials != nil { + objectMap["credentials"] = lup.Credentials + } + if lup.IsBuffered != nil { + objectMap["isBuffered"] = lup.IsBuffered + } + return json.Marshal(objectMap) } -// LoggerCollection paged Logger list representation. -type LoggerCollection struct { +// NamedValueCollection paged NamedValue list representation. +type NamedValueCollection struct { autorest.Response `json:"-"` - // Value - Logger values. - Value *[]LoggerContract `json:"value,omitempty"` - // Count - Total record count number across all pages. - Count *int64 `json:"count,omitempty"` + // Value - Page values. + Value *[]NamedValueContract `json:"value,omitempty"` // NextLink - Next page link if any. NextLink *string `json:"nextLink,omitempty"` } -// LoggerCollectionIterator provides access to a complete listing of LoggerContract values. -type LoggerCollectionIterator struct { +// NamedValueCollectionIterator provides access to a complete listing of NamedValueContract values. +type NamedValueCollectionIterator struct { i int - page LoggerCollectionPage + page NamedValueCollectionPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *LoggerCollectionIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *NamedValueCollectionIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoggerCollectionIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/NamedValueCollectionIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -5230,62 +6858,62 @@ func (iter *LoggerCollectionIterator) NextWithContext(ctx context.Context) (err // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *LoggerCollectionIterator) Next() error { +func (iter *NamedValueCollectionIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter LoggerCollectionIterator) NotDone() bool { +func (iter NamedValueCollectionIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. -func (iter LoggerCollectionIterator) Response() LoggerCollection { +func (iter NamedValueCollectionIterator) Response() NamedValueCollection { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter LoggerCollectionIterator) Value() LoggerContract { +func (iter NamedValueCollectionIterator) Value() NamedValueContract { if !iter.page.NotDone() { - return LoggerContract{} + return NamedValueContract{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the LoggerCollectionIterator type. -func NewLoggerCollectionIterator(page LoggerCollectionPage) LoggerCollectionIterator { - return LoggerCollectionIterator{page: page} +// Creates a new instance of the NamedValueCollectionIterator type. +func NewNamedValueCollectionIterator(page NamedValueCollectionPage) NamedValueCollectionIterator { + return NamedValueCollectionIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (lc LoggerCollection) IsEmpty() bool { - return lc.Value == nil || len(*lc.Value) == 0 +func (nvc NamedValueCollection) IsEmpty() bool { + return nvc.Value == nil || len(*nvc.Value) == 0 } -// loggerCollectionPreparer prepares a request to retrieve the next set of results. +// namedValueCollectionPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (lc LoggerCollection) loggerCollectionPreparer(ctx context.Context) (*http.Request, error) { - if lc.NextLink == nil || len(to.String(lc.NextLink)) < 1 { +func (nvc NamedValueCollection) namedValueCollectionPreparer(ctx context.Context) (*http.Request, error) { + if nvc.NextLink == nil || len(to.String(nvc.NextLink)) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(lc.NextLink))) + autorest.WithBaseURL(to.String(nvc.NextLink))) } -// LoggerCollectionPage contains a page of LoggerContract values. -type LoggerCollectionPage struct { - fn func(context.Context, LoggerCollection) (LoggerCollection, error) - lc LoggerCollection +// NamedValueCollectionPage contains a page of NamedValueContract values. +type NamedValueCollectionPage struct { + fn func(context.Context, NamedValueCollection) (NamedValueCollection, error) + nvc NamedValueCollection } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *LoggerCollectionPage) NextWithContext(ctx context.Context) (err error) { +func (page *NamedValueCollectionPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoggerCollectionPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/NamedValueCollectionPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -5294,49 +6922,133 @@ func (page *LoggerCollectionPage) NextWithContext(ctx context.Context) (err erro tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lc) + next, err := page.fn(ctx, page.nvc) if err != nil { return err } - page.lc = next + page.nvc = next return nil } // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (page *LoggerCollectionPage) Next() error { +func (page *NamedValueCollectionPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page LoggerCollectionPage) NotDone() bool { - return !page.lc.IsEmpty() +func (page NamedValueCollectionPage) NotDone() bool { + return !page.nvc.IsEmpty() } // Response returns the raw server response from the last page request. -func (page LoggerCollectionPage) Response() LoggerCollection { - return page.lc +func (page NamedValueCollectionPage) Response() NamedValueCollection { + return page.nvc } // Values returns the slice of values for the current page or nil if there are no values. -func (page LoggerCollectionPage) Values() []LoggerContract { - if page.lc.IsEmpty() { +func (page NamedValueCollectionPage) Values() []NamedValueContract { + if page.nvc.IsEmpty() { return nil } - return *page.lc.Value + return *page.nvc.Value +} + +// Creates a new instance of the NamedValueCollectionPage type. +func NewNamedValueCollectionPage(getNextPage func(context.Context, NamedValueCollection) (NamedValueCollection, error)) NamedValueCollectionPage { + return NamedValueCollectionPage{fn: getNextPage} +} + +// NamedValueContract namedValue details. +type NamedValueContract struct { + autorest.Response `json:"-"` + // NamedValueContractProperties - NamedValue entity contract properties. + *NamedValueContractProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for NamedValueContract. +func (nvc NamedValueContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if nvc.NamedValueContractProperties != nil { + objectMap["properties"] = nvc.NamedValueContractProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for NamedValueContract struct. +func (nvc *NamedValueContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var namedValueContractProperties NamedValueContractProperties + err = json.Unmarshal(*v, &namedValueContractProperties) + if err != nil { + return err + } + nvc.NamedValueContractProperties = &namedValueContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + nvc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + nvc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + nvc.Type = &typeVar + } + } + } + + return nil } -// Creates a new instance of the LoggerCollectionPage type. -func NewLoggerCollectionPage(getNextPage func(context.Context, LoggerCollection) (LoggerCollection, error)) LoggerCollectionPage { - return LoggerCollectionPage{fn: getNextPage} +// NamedValueContractProperties namedValue Contract properties. +type NamedValueContractProperties struct { + // DisplayName - Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters. + DisplayName *string `json:"displayName,omitempty"` + // Value - Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + Value *string `json:"value,omitempty"` + // Tags - Optional tags that when provided can be used to filter the NamedValue list. + Tags *[]string `json:"tags,omitempty"` + // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. + Secret *bool `json:"secret,omitempty"` } -// LoggerContract logger details. -type LoggerContract struct { - autorest.Response `json:"-"` - // LoggerContractProperties - Logger entity contract properties. - *LoggerContractProperties `json:"properties,omitempty"` +// NamedValueCreateContract namedValue details. +type NamedValueCreateContract struct { + // NamedValueCreateContractProperties - NamedValue entity contract properties for PUT operation. + *NamedValueCreateContractProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -5345,17 +7057,17 @@ type LoggerContract struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for LoggerContract. -func (lc LoggerContract) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for NamedValueCreateContract. +func (nvcc NamedValueCreateContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if lc.LoggerContractProperties != nil { - objectMap["properties"] = lc.LoggerContractProperties + if nvcc.NamedValueCreateContractProperties != nil { + objectMap["properties"] = nvcc.NamedValueCreateContractProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for LoggerContract struct. -func (lc *LoggerContract) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for NamedValueCreateContract struct. +func (nvcc *NamedValueCreateContract) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -5365,12 +7077,12 @@ func (lc *LoggerContract) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var loggerContractProperties LoggerContractProperties - err = json.Unmarshal(*v, &loggerContractProperties) + var namedValueCreateContractProperties NamedValueCreateContractProperties + err = json.Unmarshal(*v, &namedValueCreateContractProperties) if err != nil { return err } - lc.LoggerContractProperties = &loggerContractProperties + nvcc.NamedValueCreateContractProperties = &namedValueCreateContractProperties } case "id": if v != nil { @@ -5379,7 +7091,7 @@ func (lc *LoggerContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - lc.ID = &ID + nvcc.ID = &ID } case "name": if v != nil { @@ -5388,7 +7100,7 @@ func (lc *LoggerContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - lc.Name = &name + nvcc.Name = &name } case "type": if v != nil { @@ -5397,7 +7109,7 @@ func (lc *LoggerContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - lc.Type = &typeVar + nvcc.Type = &typeVar } } } @@ -5405,56 +7117,113 @@ func (lc *LoggerContract) UnmarshalJSON(body []byte) error { return nil } -// LoggerContractProperties the Logger entity in API Management represents an event sink that you can use -// to log API Management events. Currently the Logger entity supports logging API Management events to -// Azure Event Hubs. -type LoggerContractProperties struct { - // LoggerType - Logger type. Possible values include: 'AzureEventHub', 'ApplicationInsights' - LoggerType LoggerType `json:"loggerType,omitempty"` - // Description - Logger description. - Description *string `json:"description,omitempty"` - // Credentials - The name and SendRule connection string of the event hub for azureEventHub logger. - // Instrumentation key for applicationInsights logger. - Credentials map[string]*string `json:"credentials"` - // IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true. - IsBuffered *bool `json:"isBuffered,omitempty"` +// NamedValueCreateContractProperties namedValue Contract properties. +type NamedValueCreateContractProperties struct { + // DisplayName - Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters. + DisplayName *string `json:"displayName,omitempty"` + // Value - Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + Value *string `json:"value,omitempty"` + // Tags - Optional tags that when provided can be used to filter the NamedValue list. + Tags *[]string `json:"tags,omitempty"` + // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. + Secret *bool `json:"secret,omitempty"` } -// MarshalJSON is the custom marshaler for LoggerContractProperties. -func (lcp LoggerContractProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lcp.LoggerType != "" { - objectMap["loggerType"] = lcp.LoggerType +// NamedValueCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type NamedValueCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *NamedValueCreateOrUpdateFuture) Result(client NamedValueClient) (nvc NamedValueContract, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return } - if lcp.Description != nil { - objectMap["description"] = lcp.Description + if !done { + err = azure.NewAsyncOpIncompleteError("apimanagement.NamedValueCreateOrUpdateFuture") + return } - if lcp.Credentials != nil { - objectMap["credentials"] = lcp.Credentials + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if nvc.Response.Response, err = future.GetResult(sender); err == nil && nvc.Response.Response.StatusCode != http.StatusNoContent { + nvc, err = client.CreateOrUpdateResponder(nvc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueCreateOrUpdateFuture", "Result", nvc.Response.Response, "Failure responding to request") + } } - if lcp.IsBuffered != nil { - objectMap["isBuffered"] = lcp.IsBuffered + return +} + +// NamedValueEntityBaseParameters namedValue Entity Base Parameters set. +type NamedValueEntityBaseParameters struct { + // Tags - Optional tags that when provided can be used to filter the NamedValue list. + Tags *[]string `json:"tags,omitempty"` + // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. + Secret *bool `json:"secret,omitempty"` +} + +// NamedValueUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type NamedValueUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *NamedValueUpdateFuture) Result(client NamedValueClient) (nvc NamedValueContract, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueUpdateFuture", "Result", future.Response(), "Polling failure") + return } - return json.Marshal(objectMap) + if !done { + err = azure.NewAsyncOpIncompleteError("apimanagement.NamedValueUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if nvc.Response.Response, err = future.GetResult(sender); err == nil && nvc.Response.Response.StatusCode != http.StatusNoContent { + nvc, err = client.UpdateResponder(nvc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueUpdateFuture", "Result", nvc.Response.Response, "Failure responding to request") + } + } + return } -// LoggerUpdateContract logger update contract. -type LoggerUpdateContract struct { - // LoggerUpdateParameters - Logger entity update contract properties. - *LoggerUpdateParameters `json:"properties,omitempty"` +// NamedValueUpdateParameterProperties namedValue Contract properties. +type NamedValueUpdateParameterProperties struct { + // DisplayName - Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters. + DisplayName *string `json:"displayName,omitempty"` + // Value - Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. + Value *string `json:"value,omitempty"` + // Tags - Optional tags that when provided can be used to filter the NamedValue list. + Tags *[]string `json:"tags,omitempty"` + // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. + Secret *bool `json:"secret,omitempty"` } -// MarshalJSON is the custom marshaler for LoggerUpdateContract. -func (luc LoggerUpdateContract) MarshalJSON() ([]byte, error) { +// NamedValueUpdateParameters namedValue update Parameters. +type NamedValueUpdateParameters struct { + // NamedValueUpdateParameterProperties - NamedValue entity Update contract properties. + *NamedValueUpdateParameterProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for NamedValueUpdateParameters. +func (nvup NamedValueUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if luc.LoggerUpdateParameters != nil { - objectMap["properties"] = luc.LoggerUpdateParameters + if nvup.NamedValueUpdateParameterProperties != nil { + objectMap["properties"] = nvup.NamedValueUpdateParameterProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for LoggerUpdateContract struct. -func (luc *LoggerUpdateContract) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for NamedValueUpdateParameters struct. +func (nvup *NamedValueUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -5464,12 +7233,12 @@ func (luc *LoggerUpdateContract) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var loggerUpdateParameters LoggerUpdateParameters - err = json.Unmarshal(*v, &loggerUpdateParameters) + var namedValueUpdateParameterProperties NamedValueUpdateParameterProperties + err = json.Unmarshal(*v, &namedValueUpdateParameterProperties) if err != nil { return err } - luc.LoggerUpdateParameters = &loggerUpdateParameters + nvup.NamedValueUpdateParameterProperties = &namedValueUpdateParameterProperties } } } @@ -5477,36 +7246,6 @@ func (luc *LoggerUpdateContract) UnmarshalJSON(body []byte) error { return nil } -// LoggerUpdateParameters parameters supplied to the Update Logger operation. -type LoggerUpdateParameters struct { - // LoggerType - Logger type. Possible values include: 'AzureEventHub', 'ApplicationInsights' - LoggerType LoggerType `json:"loggerType,omitempty"` - // Description - Logger description. - Description *string `json:"description,omitempty"` - // Credentials - Logger credentials. - Credentials map[string]*string `json:"credentials"` - // IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true. - IsBuffered *bool `json:"isBuffered,omitempty"` -} - -// MarshalJSON is the custom marshaler for LoggerUpdateParameters. -func (lup LoggerUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lup.LoggerType != "" { - objectMap["loggerType"] = lup.LoggerType - } - if lup.Description != nil { - objectMap["description"] = lup.Description - } - if lup.Credentials != nil { - objectMap["credentials"] = lup.Credentials - } - if lup.IsBuffered != nil { - objectMap["isBuffered"] = lup.IsBuffered - } - return json.Marshal(objectMap) -} - // NetworkStatusContract network Status details. type NetworkStatusContract struct { autorest.Response `json:"-"` @@ -6599,126 +8338,34 @@ type ParameterContract struct { Type *string `json:"type,omitempty"` // DefaultValue - Default parameter value. DefaultValue *string `json:"defaultValue,omitempty"` - // Required - whether parameter is required or not. + // Required - Specifies whether parameter is required or not. Required *bool `json:"required,omitempty"` // Values - Parameter values. - Values *[]string `json:"values,omitempty"` -} - -// PolicyCollection the response of the list policy operation. -type PolicyCollection struct { - autorest.Response `json:"-"` - // Value - Policy Contract value. - Value *[]PolicyContract `json:"value,omitempty"` - // NextLink - Next page link if any. - NextLink *string `json:"nextLink,omitempty"` -} - -// PolicyContract policy Contract details. -type PolicyContract struct { - autorest.Response `json:"-"` - // PolicyContractProperties - Properties of the Policy. - *PolicyContractProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type for API Management resource. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for PolicyContract. -func (pc PolicyContract) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pc.PolicyContractProperties != nil { - objectMap["properties"] = pc.PolicyContractProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PolicyContract struct. -func (pc *PolicyContract) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var policyContractProperties PolicyContractProperties - err = json.Unmarshal(*v, &policyContractProperties) - if err != nil { - return err - } - pc.PolicyContractProperties = &policyContractProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pc.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pc.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - pc.Type = &typeVar - } - } - } - - return nil -} - -// PolicyContractProperties policy contract Properties. -type PolicyContractProperties struct { - // PolicyContent - Json escaped Xml Encoded contents of the Policy. - PolicyContent *string `json:"policyContent,omitempty"` - // ContentFormat - Format of the policyContent. Possible values include: 'XML', 'XMLLink', 'Rawxml', 'RawxmlLink' - ContentFormat PolicyContentFormat `json:"contentFormat,omitempty"` + Values *[]string `json:"values,omitempty"` } -// PolicySnippetContract policy snippet. -type PolicySnippetContract struct { - // Name - READ-ONLY; Snippet name. - Name *string `json:"name,omitempty"` - // Content - READ-ONLY; Snippet content. - Content *string `json:"content,omitempty"` - // ToolTip - READ-ONLY; Snippet toolTip. - ToolTip *string `json:"toolTip,omitempty"` - // Scope - READ-ONLY; Binary OR value of the Snippet scope. - Scope *int32 `json:"scope,omitempty"` +// PipelineDiagnosticSettings diagnostic settings for incoming/outgoing HTTP messages to the Gateway. +type PipelineDiagnosticSettings struct { + // Request - Diagnostic settings for request. + Request *HTTPMessageDiagnostic `json:"request,omitempty"` + // Response - Diagnostic settings for response. + Response *HTTPMessageDiagnostic `json:"response,omitempty"` } -// PolicySnippetsCollection the response of the list policy snippets operation. -type PolicySnippetsCollection struct { +// PolicyCollection the response of the list policy operation. +type PolicyCollection struct { autorest.Response `json:"-"` - // Value - Policy snippet value. - Value *[]PolicySnippetContract `json:"value,omitempty"` + // Value - Policy Contract value. + Value *[]PolicyContract `json:"value,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` } -// PortalDelegationSettings delegation settings for a developer portal. -type PortalDelegationSettings struct { +// PolicyContract policy Contract details. +type PolicyContract struct { autorest.Response `json:"-"` - // PortalDelegationSettingsProperties - Delegation settings contract properties. - *PortalDelegationSettingsProperties `json:"properties,omitempty"` + // PolicyContractProperties - Properties of the Policy. + *PolicyContractProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -6727,17 +8374,17 @@ type PortalDelegationSettings struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for PortalDelegationSettings. -func (pds PortalDelegationSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for PolicyContract. +func (pc PolicyContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if pds.PortalDelegationSettingsProperties != nil { - objectMap["properties"] = pds.PortalDelegationSettingsProperties + if pc.PolicyContractProperties != nil { + objectMap["properties"] = pc.PolicyContractProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for PortalDelegationSettings struct. -func (pds *PortalDelegationSettings) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for PolicyContract struct. +func (pc *PolicyContract) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -6747,12 +8394,12 @@ func (pds *PortalDelegationSettings) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var portalDelegationSettingsProperties PortalDelegationSettingsProperties - err = json.Unmarshal(*v, &portalDelegationSettingsProperties) + var policyContractProperties PolicyContractProperties + err = json.Unmarshal(*v, &policyContractProperties) if err != nil { return err } - pds.PortalDelegationSettingsProperties = &portalDelegationSettingsProperties + pc.PolicyContractProperties = &policyContractProperties } case "id": if v != nil { @@ -6761,7 +8408,7 @@ func (pds *PortalDelegationSettings) UnmarshalJSON(body []byte) error { if err != nil { return err } - pds.ID = &ID + pc.ID = &ID } case "name": if v != nil { @@ -6770,7 +8417,7 @@ func (pds *PortalDelegationSettings) UnmarshalJSON(body []byte) error { if err != nil { return err } - pds.Name = &name + pc.Name = &name } case "type": if v != nil { @@ -6779,7 +8426,7 @@ func (pds *PortalDelegationSettings) UnmarshalJSON(body []byte) error { if err != nil { return err } - pds.Type = &typeVar + pc.Type = &typeVar } } } @@ -6787,29 +8434,27 @@ func (pds *PortalDelegationSettings) UnmarshalJSON(body []byte) error { return nil } -// PortalDelegationSettingsProperties delegation settings contract properties. -type PortalDelegationSettingsProperties struct { - // URL - A delegation Url. - URL *string `json:"url,omitempty"` - // ValidationKey - A base64-encoded validation key to validate, that a request is coming from Azure API Management. - ValidationKey *string `json:"validationKey,omitempty"` - // Subscriptions - Subscriptions delegation settings. - Subscriptions *SubscriptionsDelegationSettingsProperties `json:"subscriptions,omitempty"` - // UserRegistration - User registration delegation settings. - UserRegistration *RegistrationDelegationSettingsProperties `json:"userRegistration,omitempty"` +// PolicyContractProperties policy contract Properties. +type PolicyContractProperties struct { + // Value - Contents of the Policy as defined by the format. + Value *string `json:"value,omitempty"` + // Format - Format of the policyContent. Possible values include: 'XML', 'XMLLink', 'Rawxml', 'RawxmlLink' + Format PolicyContentFormat `json:"format,omitempty"` } -// PortalSigninSettingProperties sign-in settings contract properties. -type PortalSigninSettingProperties struct { - // Enabled - Redirect Anonymous users to the Sign-In page. - Enabled *bool `json:"enabled,omitempty"` +// PolicyDescriptionCollection descriptions of APIM policies. +type PolicyDescriptionCollection struct { + autorest.Response `json:"-"` + // Value - Descriptions of APIM policies. + Value *[]PolicyDescriptionContract `json:"value,omitempty"` + // Count - Total record count number. + Count *int64 `json:"count,omitempty"` } -// PortalSigninSettings sign-In settings for the Developer Portal. -type PortalSigninSettings struct { - autorest.Response `json:"-"` - // PortalSigninSettingProperties - Sign-in settings contract properties. - *PortalSigninSettingProperties `json:"properties,omitempty"` +// PolicyDescriptionContract policy description details. +type PolicyDescriptionContract struct { + // PolicyDescriptionContractProperties - Policy description contract properties. + *PolicyDescriptionContractProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -6818,17 +8463,17 @@ type PortalSigninSettings struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for PortalSigninSettings. -func (pss PortalSigninSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for PolicyDescriptionContract. +func (pdc PolicyDescriptionContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if pss.PortalSigninSettingProperties != nil { - objectMap["properties"] = pss.PortalSigninSettingProperties + if pdc.PolicyDescriptionContractProperties != nil { + objectMap["properties"] = pdc.PolicyDescriptionContractProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for PortalSigninSettings struct. -func (pss *PortalSigninSettings) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for PolicyDescriptionContract struct. +func (pdc *PolicyDescriptionContract) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -6838,12 +8483,12 @@ func (pss *PortalSigninSettings) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var portalSigninSettingProperties PortalSigninSettingProperties - err = json.Unmarshal(*v, &portalSigninSettingProperties) + var policyDescriptionContractProperties PolicyDescriptionContractProperties + err = json.Unmarshal(*v, &policyDescriptionContractProperties) if err != nil { return err } - pss.PortalSigninSettingProperties = &portalSigninSettingProperties + pdc.PolicyDescriptionContractProperties = &policyDescriptionContractProperties } case "id": if v != nil { @@ -6852,7 +8497,7 @@ func (pss *PortalSigninSettings) UnmarshalJSON(body []byte) error { if err != nil { return err } - pss.ID = &ID + pdc.ID = &ID } case "name": if v != nil { @@ -6861,7 +8506,7 @@ func (pss *PortalSigninSettings) UnmarshalJSON(body []byte) error { if err != nil { return err } - pss.Name = &name + pdc.Name = &name } case "type": if v != nil { @@ -6870,7 +8515,7 @@ func (pss *PortalSigninSettings) UnmarshalJSON(body []byte) error { if err != nil { return err } - pss.Type = &typeVar + pdc.Type = &typeVar } } } @@ -6878,11 +8523,19 @@ func (pss *PortalSigninSettings) UnmarshalJSON(body []byte) error { return nil } -// PortalSignupSettings sign-Up settings for a developer portal. -type PortalSignupSettings struct { +// PolicyDescriptionContractProperties policy description properties. +type PolicyDescriptionContractProperties struct { + // Description - READ-ONLY; Policy description. + Description *string `json:"description,omitempty"` + // Scope - READ-ONLY; Binary OR value of the Snippet scope. + Scope *int32 `json:"scope,omitempty"` +} + +// PortalDelegationSettings delegation settings for a developer portal. +type PortalDelegationSettings struct { autorest.Response `json:"-"` - // PortalSignupSettingsProperties - Sign-up settings contract properties. - *PortalSignupSettingsProperties `json:"properties,omitempty"` + // PortalDelegationSettingsProperties - Delegation settings contract properties. + *PortalDelegationSettingsProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -6891,17 +8544,17 @@ type PortalSignupSettings struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for PortalSignupSettings. -func (pss PortalSignupSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for PortalDelegationSettings. +func (pds PortalDelegationSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if pss.PortalSignupSettingsProperties != nil { - objectMap["properties"] = pss.PortalSignupSettingsProperties + if pds.PortalDelegationSettingsProperties != nil { + objectMap["properties"] = pds.PortalDelegationSettingsProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for PortalSignupSettings struct. -func (pss *PortalSignupSettings) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for PortalDelegationSettings struct. +func (pds *PortalDelegationSettings) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -6911,205 +8564,76 @@ func (pss *PortalSignupSettings) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var portalSignupSettingsProperties PortalSignupSettingsProperties - err = json.Unmarshal(*v, &portalSignupSettingsProperties) - if err != nil { - return err - } - pss.PortalSignupSettingsProperties = &portalSignupSettingsProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pss.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pss.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var portalDelegationSettingsProperties PortalDelegationSettingsProperties + err = json.Unmarshal(*v, &portalDelegationSettingsProperties) if err != nil { return err - } - pss.Type = &typeVar - } - } - } - - return nil -} - -// PortalSignupSettingsProperties sign-up settings contract properties. -type PortalSignupSettingsProperties struct { - // Enabled - Allow users to sign up on a developer portal. - Enabled *bool `json:"enabled,omitempty"` - // TermsOfService - Terms of service contract properties. - TermsOfService *TermsOfServiceProperties `json:"termsOfService,omitempty"` -} - -// ProductCollection paged Products list representation. -type ProductCollection struct { - autorest.Response `json:"-"` - // Value - Page values. - Value *[]ProductContract `json:"value,omitempty"` - // NextLink - Next page link if any. - NextLink *string `json:"nextLink,omitempty"` -} - -// ProductCollectionIterator provides access to a complete listing of ProductContract values. -type ProductCollectionIterator struct { - i int - page ProductCollectionPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ProductCollectionIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProductCollectionIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ProductCollectionIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ProductCollectionIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ProductCollectionIterator) Response() ProductCollection { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ProductCollectionIterator) Value() ProductContract { - if !iter.page.NotDone() { - return ProductContract{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ProductCollectionIterator type. -func NewProductCollectionIterator(page ProductCollectionPage) ProductCollectionIterator { - return ProductCollectionIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (pc ProductCollection) IsEmpty() bool { - return pc.Value == nil || len(*pc.Value) == 0 -} - -// productCollectionPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (pc ProductCollection) productCollectionPreparer(ctx context.Context) (*http.Request, error) { - if pc.NextLink == nil || len(to.String(pc.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(pc.NextLink))) -} - -// ProductCollectionPage contains a page of ProductContract values. -type ProductCollectionPage struct { - fn func(context.Context, ProductCollection) (ProductCollection, error) - pc ProductCollection -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ProductCollectionPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProductCollectionPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode + } + pds.PortalDelegationSettingsProperties = &portalDelegationSettingsProperties } - tracing.EndSpan(ctx, sc, err) - }() - } - next, err := page.fn(ctx, page.pc) - if err != nil { - return err + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pds.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pds.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pds.Type = &typeVar + } + } } - page.pc = next - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ProductCollectionPage) Next() error { - return page.NextWithContext(context.Background()) -} -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ProductCollectionPage) NotDone() bool { - return !page.pc.IsEmpty() + return nil } -// Response returns the raw server response from the last page request. -func (page ProductCollectionPage) Response() ProductCollection { - return page.pc +// PortalDelegationSettingsProperties delegation settings contract properties. +type PortalDelegationSettingsProperties struct { + // URL - A delegation Url. + URL *string `json:"url,omitempty"` + // ValidationKey - A base64-encoded validation key to validate, that a request is coming from Azure API Management. + ValidationKey *string `json:"validationKey,omitempty"` + // Subscriptions - Subscriptions delegation settings. + Subscriptions *SubscriptionsDelegationSettingsProperties `json:"subscriptions,omitempty"` + // UserRegistration - User registration delegation settings. + UserRegistration *RegistrationDelegationSettingsProperties `json:"userRegistration,omitempty"` } -// Values returns the slice of values for the current page or nil if there are no values. -func (page ProductCollectionPage) Values() []ProductContract { - if page.pc.IsEmpty() { - return nil - } - return *page.pc.Value +// PortalSettingValidationKeyContract client or app secret used in IdentityProviders, Aad, OpenID or OAuth. +type PortalSettingValidationKeyContract struct { + autorest.Response `json:"-"` + // ValidationKey - This is secret value of the validation key in portal settings. + ValidationKey *string `json:"validationKey,omitempty"` } -// Creates a new instance of the ProductCollectionPage type. -func NewProductCollectionPage(getNextPage func(context.Context, ProductCollection) (ProductCollection, error)) ProductCollectionPage { - return ProductCollectionPage{fn: getNextPage} +// PortalSigninSettingProperties sign-in settings contract properties. +type PortalSigninSettingProperties struct { + // Enabled - Redirect Anonymous users to the Sign-In page. + Enabled *bool `json:"enabled,omitempty"` } -// ProductContract product details. -type ProductContract struct { +// PortalSigninSettings sign-In settings for the Developer Portal. +type PortalSigninSettings struct { autorest.Response `json:"-"` - // ProductContractProperties - Product entity contract properties. - *ProductContractProperties `json:"properties,omitempty"` + // PortalSigninSettingProperties - Sign-in settings contract properties. + *PortalSigninSettingProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -7118,17 +8642,17 @@ type ProductContract struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for ProductContract. -func (pc ProductContract) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for PortalSigninSettings. +func (pss PortalSigninSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if pc.ProductContractProperties != nil { - objectMap["properties"] = pc.ProductContractProperties + if pss.PortalSigninSettingProperties != nil { + objectMap["properties"] = pss.PortalSigninSettingProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ProductContract struct. -func (pc *ProductContract) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for PortalSigninSettings struct. +func (pss *PortalSigninSettings) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -7138,12 +8662,12 @@ func (pc *ProductContract) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var productContractProperties ProductContractProperties - err = json.Unmarshal(*v, &productContractProperties) + var portalSigninSettingProperties PortalSigninSettingProperties + err = json.Unmarshal(*v, &portalSigninSettingProperties) if err != nil { return err } - pc.ProductContractProperties = &productContractProperties + pss.PortalSigninSettingProperties = &portalSigninSettingProperties } case "id": if v != nil { @@ -7152,7 +8676,7 @@ func (pc *ProductContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - pc.ID = &ID + pss.ID = &ID } case "name": if v != nil { @@ -7161,7 +8685,7 @@ func (pc *ProductContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - pc.Name = &name + pss.Name = &name } case "type": if v != nil { @@ -7170,7 +8694,7 @@ func (pc *ProductContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - pc.Type = &typeVar + pss.Type = &typeVar } } } @@ -7178,77 +8702,30 @@ func (pc *ProductContract) UnmarshalJSON(body []byte) error { return nil } -// ProductContractProperties product profile. -type ProductContractProperties struct { - // DisplayName - Product name. - DisplayName *string `json:"displayName,omitempty"` - // Description - Product description. May include HTML formatting tags. - Description *string `json:"description,omitempty"` - // 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. - Terms *string `json:"terms,omitempty"` - // 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. - SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - // 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 false. - ApprovalRequired *bool `json:"approvalRequired,omitempty"` - // 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 false. - SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` - // 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' - State ProductState `json:"state,omitempty"` -} - -// ProductEntityBaseParameters product Entity Base Parameters -type ProductEntityBaseParameters struct { - // Description - Product description. May include HTML formatting tags. - Description *string `json:"description,omitempty"` - // 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. - Terms *string `json:"terms,omitempty"` - // 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. - SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - // 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 false. - ApprovalRequired *bool `json:"approvalRequired,omitempty"` - // 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 false. - SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` - // 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' - State ProductState `json:"state,omitempty"` -} - -// ProductTagResourceContractProperties product profile. -type ProductTagResourceContractProperties struct { - // ID - Identifier of the product in the form of /products/{productId} +// PortalSignupSettings sign-Up settings for a developer portal. +type PortalSignupSettings struct { + autorest.Response `json:"-"` + // PortalSignupSettingsProperties - Sign-up settings contract properties. + *PortalSignupSettingsProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` - // Name - Product name. + // Name - READ-ONLY; Resource name. Name *string `json:"name,omitempty"` - // Description - Product description. May include HTML formatting tags. - Description *string `json:"description,omitempty"` - // 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. - Terms *string `json:"terms,omitempty"` - // 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. - SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - // 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 false. - ApprovalRequired *bool `json:"approvalRequired,omitempty"` - // 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 false. - SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` - // 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' - State ProductState `json:"state,omitempty"` -} - -// ProductUpdateParameters product Update parameters. -type ProductUpdateParameters struct { - // ProductUpdateProperties - Product entity Update contract properties. - *ProductUpdateProperties `json:"properties,omitempty"` + // Type - READ-ONLY; Resource type for API Management resource. + Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for ProductUpdateParameters. -func (pup ProductUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for PortalSignupSettings. +func (pss PortalSignupSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if pup.ProductUpdateProperties != nil { - objectMap["properties"] = pup.ProductUpdateProperties + if pss.PortalSignupSettingsProperties != nil { + objectMap["properties"] = pss.PortalSignupSettingsProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ProductUpdateParameters struct. -func (pup *ProductUpdateParameters) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for PortalSignupSettings struct. +func (pss *PortalSignupSettings) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -7258,12 +8735,39 @@ func (pup *ProductUpdateParameters) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var productUpdateProperties ProductUpdateProperties - err = json.Unmarshal(*v, &productUpdateProperties) + var portalSignupSettingsProperties PortalSignupSettingsProperties + err = json.Unmarshal(*v, &portalSignupSettingsProperties) if err != nil { return err } - pup.ProductUpdateProperties = &productUpdateProperties + pss.PortalSignupSettingsProperties = &portalSignupSettingsProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pss.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pss.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pss.Type = &typeVar } } } @@ -7271,44 +8775,34 @@ func (pup *ProductUpdateParameters) UnmarshalJSON(body []byte) error { return nil } -// ProductUpdateProperties parameters supplied to the Update Product operation. -type ProductUpdateProperties struct { - // DisplayName - Product name. - DisplayName *string `json:"displayName,omitempty"` - // Description - Product description. May include HTML formatting tags. - Description *string `json:"description,omitempty"` - // 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. - Terms *string `json:"terms,omitempty"` - // 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. - SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - // 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 false. - ApprovalRequired *bool `json:"approvalRequired,omitempty"` - // 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 false. - SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` - // 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' - State ProductState `json:"state,omitempty"` +// PortalSignupSettingsProperties sign-up settings contract properties. +type PortalSignupSettingsProperties struct { + // Enabled - Allow users to sign up on a developer portal. + Enabled *bool `json:"enabled,omitempty"` + // TermsOfService - Terms of service contract properties. + TermsOfService *TermsOfServiceProperties `json:"termsOfService,omitempty"` } -// PropertyCollection paged Property list representation. -type PropertyCollection struct { +// ProductCollection paged Products list representation. +type ProductCollection struct { autorest.Response `json:"-"` // Value - Page values. - Value *[]PropertyContract `json:"value,omitempty"` + Value *[]ProductContract `json:"value,omitempty"` // NextLink - Next page link if any. NextLink *string `json:"nextLink,omitempty"` } -// PropertyCollectionIterator provides access to a complete listing of PropertyContract values. -type PropertyCollectionIterator struct { +// ProductCollectionIterator provides access to a complete listing of ProductContract values. +type ProductCollectionIterator struct { i int - page PropertyCollectionPage + page ProductCollectionPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *PropertyCollectionIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *ProductCollectionIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PropertyCollectionIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ProductCollectionIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -7333,42 +8827,42 @@ func (iter *PropertyCollectionIterator) NextWithContext(ctx context.Context) (er // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *PropertyCollectionIterator) Next() error { +func (iter *ProductCollectionIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter PropertyCollectionIterator) NotDone() bool { +func (iter ProductCollectionIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. -func (iter PropertyCollectionIterator) Response() PropertyCollection { +func (iter ProductCollectionIterator) Response() ProductCollection { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter PropertyCollectionIterator) Value() PropertyContract { +func (iter ProductCollectionIterator) Value() ProductContract { if !iter.page.NotDone() { - return PropertyContract{} + return ProductContract{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the PropertyCollectionIterator type. -func NewPropertyCollectionIterator(page PropertyCollectionPage) PropertyCollectionIterator { - return PropertyCollectionIterator{page: page} +// Creates a new instance of the ProductCollectionIterator type. +func NewProductCollectionIterator(page ProductCollectionPage) ProductCollectionIterator { + return ProductCollectionIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (pc PropertyCollection) IsEmpty() bool { +func (pc ProductCollection) IsEmpty() bool { return pc.Value == nil || len(*pc.Value) == 0 } -// propertyCollectionPreparer prepares a request to retrieve the next set of results. +// productCollectionPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (pc PropertyCollection) propertyCollectionPreparer(ctx context.Context) (*http.Request, error) { +func (pc ProductCollection) productCollectionPreparer(ctx context.Context) (*http.Request, error) { if pc.NextLink == nil || len(to.String(pc.NextLink)) < 1 { return nil, nil } @@ -7378,17 +8872,17 @@ func (pc PropertyCollection) propertyCollectionPreparer(ctx context.Context) (*h autorest.WithBaseURL(to.String(pc.NextLink))) } -// PropertyCollectionPage contains a page of PropertyContract values. -type PropertyCollectionPage struct { - fn func(context.Context, PropertyCollection) (PropertyCollection, error) - pc PropertyCollection +// ProductCollectionPage contains a page of ProductContract values. +type ProductCollectionPage struct { + fn func(context.Context, ProductCollection) (ProductCollection, error) + pc ProductCollection } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *PropertyCollectionPage) NextWithContext(ctx context.Context) (err error) { +func (page *ProductCollectionPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PropertyCollectionPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ProductCollectionPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -7408,38 +8902,38 @@ func (page *PropertyCollectionPage) NextWithContext(ctx context.Context) (err er // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (page *PropertyCollectionPage) Next() error { +func (page *ProductCollectionPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page PropertyCollectionPage) NotDone() bool { +func (page ProductCollectionPage) NotDone() bool { return !page.pc.IsEmpty() } // Response returns the raw server response from the last page request. -func (page PropertyCollectionPage) Response() PropertyCollection { +func (page ProductCollectionPage) Response() ProductCollection { return page.pc } // Values returns the slice of values for the current page or nil if there are no values. -func (page PropertyCollectionPage) Values() []PropertyContract { +func (page ProductCollectionPage) Values() []ProductContract { if page.pc.IsEmpty() { return nil } return *page.pc.Value } -// Creates a new instance of the PropertyCollectionPage type. -func NewPropertyCollectionPage(getNextPage func(context.Context, PropertyCollection) (PropertyCollection, error)) PropertyCollectionPage { - return PropertyCollectionPage{fn: getNextPage} +// Creates a new instance of the ProductCollectionPage type. +func NewProductCollectionPage(getNextPage func(context.Context, ProductCollection) (ProductCollection, error)) ProductCollectionPage { + return ProductCollectionPage{fn: getNextPage} } -// PropertyContract property details. -type PropertyContract struct { +// ProductContract product details. +type ProductContract struct { autorest.Response `json:"-"` - // PropertyContractProperties - Property entity contract properties. - *PropertyContractProperties `json:"properties,omitempty"` + // ProductContractProperties - Product entity contract properties. + *ProductContractProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -7448,17 +8942,17 @@ type PropertyContract struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for PropertyContract. -func (pc PropertyContract) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ProductContract. +func (pc ProductContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if pc.PropertyContractProperties != nil { - objectMap["properties"] = pc.PropertyContractProperties + if pc.ProductContractProperties != nil { + objectMap["properties"] = pc.ProductContractProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for PropertyContract struct. -func (pc *PropertyContract) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ProductContract struct. +func (pc *ProductContract) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -7468,12 +8962,12 @@ func (pc *PropertyContract) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var propertyContractProperties PropertyContractProperties - err = json.Unmarshal(*v, &propertyContractProperties) + var productContractProperties ProductContractProperties + err = json.Unmarshal(*v, &productContractProperties) if err != nil { return err } - pc.PropertyContractProperties = &propertyContractProperties + pc.ProductContractProperties = &productContractProperties } case "id": if v != nil { @@ -7508,55 +9002,77 @@ func (pc *PropertyContract) UnmarshalJSON(body []byte) error { return nil } -// PropertyContractProperties property Contract properties. -type PropertyContractProperties struct { - // DisplayName - Unique name of Property. It may contain only letters, digits, period, dash, and underscore characters. +// ProductContractProperties product profile. +type ProductContractProperties struct { + // DisplayName - Product name. DisplayName *string `json:"displayName,omitempty"` - // Value - Value of the property. Can contain policy expressions. It may not be empty or consist only of whitespace. - Value *string `json:"value,omitempty"` - // Tags - Optional tags that when provided can be used to filter the property list. - Tags *[]string `json:"tags,omitempty"` - // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. - Secret *bool `json:"secret,omitempty"` + // Description - Product description. May include HTML formatting tags. + Description *string `json:"description,omitempty"` + // 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. + Terms *string `json:"terms,omitempty"` + // 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. + SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` + // 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 false. + ApprovalRequired *bool `json:"approvalRequired,omitempty"` + // 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 false. + SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` + // 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' + State ProductState `json:"state,omitempty"` } -// PropertyEntityBaseParameters property Entity Base Parameters set. -type PropertyEntityBaseParameters struct { - // Tags - Optional tags that when provided can be used to filter the property list. - Tags *[]string `json:"tags,omitempty"` - // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. - Secret *bool `json:"secret,omitempty"` +// ProductEntityBaseParameters product Entity Base Parameters +type ProductEntityBaseParameters struct { + // Description - Product description. May include HTML formatting tags. + Description *string `json:"description,omitempty"` + // 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. + Terms *string `json:"terms,omitempty"` + // 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. + SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` + // 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 false. + ApprovalRequired *bool `json:"approvalRequired,omitempty"` + // 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 false. + SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` + // 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' + State ProductState `json:"state,omitempty"` } -// PropertyUpdateParameterProperties property Contract properties. -type PropertyUpdateParameterProperties struct { - // DisplayName - Unique name of Property. It may contain only letters, digits, period, dash, and underscore characters. - DisplayName *string `json:"displayName,omitempty"` - // Value - Value of the property. Can contain policy expressions. It may not be empty or consist only of whitespace. - Value *string `json:"value,omitempty"` - // Tags - Optional tags that when provided can be used to filter the property list. - Tags *[]string `json:"tags,omitempty"` - // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. - Secret *bool `json:"secret,omitempty"` +// ProductTagResourceContractProperties product profile. +type ProductTagResourceContractProperties struct { + // ID - Identifier of the product in the form of /products/{productId} + ID *string `json:"id,omitempty"` + // Name - Product name. + Name *string `json:"name,omitempty"` + // Description - Product description. May include HTML formatting tags. + Description *string `json:"description,omitempty"` + // 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. + Terms *string `json:"terms,omitempty"` + // 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. + SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` + // 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 false. + ApprovalRequired *bool `json:"approvalRequired,omitempty"` + // 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 false. + SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` + // 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' + State ProductState `json:"state,omitempty"` } -// PropertyUpdateParameters property update Parameters. -type PropertyUpdateParameters struct { - // PropertyUpdateParameterProperties - Property entity Update contract properties. - *PropertyUpdateParameterProperties `json:"properties,omitempty"` +// ProductUpdateParameters product Update parameters. +type ProductUpdateParameters struct { + // ProductUpdateProperties - Product entity Update contract properties. + *ProductUpdateProperties `json:"properties,omitempty"` } -// MarshalJSON is the custom marshaler for PropertyUpdateParameters. -func (pup PropertyUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ProductUpdateParameters. +func (pup ProductUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if pup.PropertyUpdateParameterProperties != nil { - objectMap["properties"] = pup.PropertyUpdateParameterProperties + if pup.ProductUpdateProperties != nil { + objectMap["properties"] = pup.ProductUpdateProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for PropertyUpdateParameters struct. -func (pup *PropertyUpdateParameters) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ProductUpdateParameters struct. +func (pup *ProductUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -7566,12 +9082,12 @@ func (pup *PropertyUpdateParameters) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var propertyUpdateParameterProperties PropertyUpdateParameterProperties - err = json.Unmarshal(*v, &propertyUpdateParameterProperties) + var productUpdateProperties ProductUpdateProperties + err = json.Unmarshal(*v, &productUpdateProperties) if err != nil { return err } - pup.PropertyUpdateParameterProperties = &propertyUpdateParameterProperties + pup.ProductUpdateProperties = &productUpdateProperties } } } @@ -7579,6 +9095,31 @@ func (pup *PropertyUpdateParameters) UnmarshalJSON(body []byte) error { return nil } +// ProductUpdateProperties parameters supplied to the Update Product operation. +type ProductUpdateProperties struct { + // DisplayName - Product name. + DisplayName *string `json:"displayName,omitempty"` + // Description - Product description. May include HTML formatting tags. + Description *string `json:"description,omitempty"` + // 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. + Terms *string `json:"terms,omitempty"` + // 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. + SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` + // 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 false. + ApprovalRequired *bool `json:"approvalRequired,omitempty"` + // 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 false. + SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` + // 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' + State ProductState `json:"state,omitempty"` +} + +// PropertyValueContract client or app secret used in IdentityProviders, Aad, OpenID or OAuth. +type PropertyValueContract struct { + autorest.Response `json:"-"` + // Value - This is secret value of the NamedValue entity. + Value *string `json:"value,omitempty"` +} + // QuotaCounterCollection paged Quota Counter list representation. type QuotaCounterCollection struct { autorest.Response `json:"-"` @@ -8289,9 +9830,21 @@ type Resource struct { Type *string `json:"type,omitempty"` } +// ResourceLocationDataContract resource location data properties. +type ResourceLocationDataContract struct { + // Name - A canonical name for the geographic or physical location. + Name *string `json:"name,omitempty"` + // City - The city or locality where the resource is located. + City *string `json:"city,omitempty"` + // District - The district, state, or province where the resource is located. + District *string `json:"district,omitempty"` + // CountryOrRegion - The country or region where the resource is located. + CountryOrRegion *string `json:"countryOrRegion,omitempty"` +} + // ResourceSku describes an available API Management SKU. type ResourceSku struct { - // Name - Name of the Sku. Possible values include: 'SkuTypeDeveloper', 'SkuTypeStandard', 'SkuTypePremium', 'SkuTypeBasic' + // Name - Name of the Sku. Possible values include: 'SkuTypeDeveloper', 'SkuTypeStandard', 'SkuTypePremium', 'SkuTypeBasic', 'SkuTypeConsumption' Name SkuType `json:"name,omitempty"` } @@ -8303,7 +9856,7 @@ type ResourceSkuCapacity struct { Maximum *int32 `json:"maximum,omitempty"` // Default - READ-ONLY; The default capacity. Default *int32 `json:"default,omitempty"` - // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'Automatic', 'Manual', 'None' + // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'ResourceSkuCapacityScaleTypeAutomatic', 'ResourceSkuCapacityScaleTypeManual', 'ResourceSkuCapacityScaleTypeNone' ScaleType ResourceSkuCapacityScaleType `json:"scaleType,omitempty"` } @@ -8475,8 +10028,55 @@ type ResponseContract struct { Headers *[]ParameterContract `json:"headers,omitempty"` } -// SaveConfigurationParameter parameters supplied to the Save Tenant Configuration operation. +// SamplingSettings sampling settings for Diagnostic. +type SamplingSettings struct { + // SamplingType - Sampling type. Possible values include: 'Fixed' + SamplingType SamplingType `json:"samplingType,omitempty"` + // Percentage - Rate of sampling for fixed-rate sampling. + Percentage *float64 `json:"percentage,omitempty"` +} + +// SaveConfigurationParameter save Tenant Configuration Contract details. type SaveConfigurationParameter struct { + // SaveConfigurationParameterProperties - Properties of the Save Configuration Parameters. + *SaveConfigurationParameterProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SaveConfigurationParameter. +func (scp SaveConfigurationParameter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scp.SaveConfigurationParameterProperties != nil { + objectMap["properties"] = scp.SaveConfigurationParameterProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SaveConfigurationParameter struct. +func (scp *SaveConfigurationParameter) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var saveConfigurationParameterProperties SaveConfigurationParameterProperties + err = json.Unmarshal(*v, &saveConfigurationParameterProperties) + if err != nil { + return err + } + scp.SaveConfigurationParameterProperties = &saveConfigurationParameterProperties + } + } + } + + return nil +} + +// SaveConfigurationParameterProperties parameters supplied to the Save Tenant Configuration operation. +type SaveConfigurationParameterProperties struct { // Branch - The name of the Git branch in which to commit the current configuration snapshot. Branch *string `json:"branch,omitempty"` // 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. @@ -8702,11 +10302,11 @@ func (sc *SchemaContract) UnmarshalJSON(body []byte) error { return nil } -// SchemaContractProperties schema contract Properties. +// SchemaContractProperties API Schema create or update contract Properties. type SchemaContractProperties struct { - // 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). + // 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).
- `Swagger` Schema use `application/vnd.ms-azure-apim.swagger.definitions+json`
- `WSDL` Schema use `application/vnd.ms-azure-apim.xsd+xml`
- `OpenApi` Schema use `application/vnd.oai.openapi.components+json`
- `WADL Schema` use `application/vnd.ms-azure-apim.wadl.grammars+xml`. ContentType *string `json:"contentType,omitempty"` - // SchemaDocumentProperties - Properties of the Schema Document. + // SchemaDocumentProperties - Create or update Properties of the Schema Document. *SchemaDocumentProperties `json:"document,omitempty"` } @@ -8757,8 +10357,10 @@ func (scp *SchemaContractProperties) UnmarshalJSON(body []byte) error { // SchemaDocumentProperties schema Document Properties. type SchemaDocumentProperties struct { - // Value - Json escaped string defining the document representing the Schema. + // Value - Json escaped string defining the document representing the Schema. Used for schemas other than Swagger/OpenAPI. Value *string `json:"value,omitempty"` + // Definitions - Types definitions. Used for Swagger/OpenAPI schemas only, null otherwise. + Definitions interface{} `json:"definitions,omitempty"` } // ServiceApplyNetworkConfigurationParameters parameter supplied to the Apply Network configuration @@ -8859,6 +10461,8 @@ type ServiceBaseProperties struct { ManagementAPIURL *string `json:"managementApiUrl,omitempty"` // ScmURL - READ-ONLY; SCM endpoint URL of the API Management service. ScmURL *string `json:"scmUrl,omitempty"` + // DeveloperPortalURL - READ-ONLY; DEveloper Portal endpoint URL of the API Management service. + DeveloperPortalURL *string `json:"developerPortalUrl,omitempty"` // HostnameConfigurations - Custom hostname configuration of the API Management service. HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` // PublicIPAddresses - READ-ONLY; Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard and Premium SKU. @@ -8869,12 +10473,18 @@ type ServiceBaseProperties struct { VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` // AdditionalLocations - Additional datacenter locations of the API Management service. AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"` - // CustomProperties - Custom properties of the API Management service. Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2). Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1 and setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service. + // CustomProperties - Custom properties of the API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be used to disable just TLS 1.1 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to disable TLS 1.0 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be used to enable HTTP2 protocol on an API Management service.
Not specifying any of these properties on PATCH operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value is `True` if the service was created on or before April 1st 2018 and `False` otherwise. Http2 setting's default value is `False`.

You can disable any of next ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. For example, `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. The default value is `true` for them. Note: next ciphers can't be disabled since they are required by Azure CloudService internal components: TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384 CustomProperties map[string]*string `json:"customProperties"` // Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. Certificates *[]CertificateConfiguration `json:"certificates,omitempty"` + // EnableClientCertificate - Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. + EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"` + // DisableGateway - Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway in master region. + DisableGateway *bool `json:"disableGateway,omitempty"` // VirtualNetworkType - The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. Possible values include: 'VirtualNetworkTypeNone', 'VirtualNetworkTypeExternal', 'VirtualNetworkTypeInternal' VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"` + // APIVersionConstraint - Control Plane Apis version constraint for the API Management service. + APIVersionConstraint *APIVersionConstraint `json:"apiVersionConstraint,omitempty"` } // MarshalJSON is the custom marshaler for ServiceBaseProperties. @@ -8898,9 +10508,18 @@ func (sbp ServiceBaseProperties) MarshalJSON() ([]byte, error) { if sbp.Certificates != nil { objectMap["certificates"] = sbp.Certificates } + if sbp.EnableClientCertificate != nil { + objectMap["enableClientCertificate"] = sbp.EnableClientCertificate + } + if sbp.DisableGateway != nil { + objectMap["disableGateway"] = sbp.DisableGateway + } if sbp.VirtualNetworkType != "" { objectMap["virtualNetworkType"] = sbp.VirtualNetworkType } + if sbp.APIVersionConstraint != nil { + objectMap["apiVersionConstraint"] = sbp.APIVersionConstraint + } return json.Marshal(objectMap) } @@ -8939,6 +10558,35 @@ func (future *ServiceCreateOrUpdateFuture) Result(client ServiceClient) (sr Serv return } +// ServiceDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ServiceDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ServiceDeleteFuture) Result(client ServiceClient) (sr ServiceResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceDeleteFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { + sr, err = client.DeleteResponder(sr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceDeleteFuture", "Result", sr.Response.Response, "Failure responding to request") + } + } + return +} + // ServiceGetSsoTokenResult the response of the GetSsoToken operation. type ServiceGetSsoTokenResult struct { autorest.Response `json:"-"` @@ -8948,12 +10596,29 @@ type ServiceGetSsoTokenResult struct { // ServiceIdentity identity properties of the Api Management service resource. type ServiceIdentity struct { - // Type - The identity type. Currently the only supported type is 'SystemAssigned'. - Type *string `json:"type,omitempty"` + // Type - The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssignedUserAssigned', 'None' + Type ApimIdentityType `json:"type,omitempty"` // PrincipalID - READ-ONLY; The principal id of the identity. PrincipalID *uuid.UUID `json:"principalId,omitempty"` // TenantID - READ-ONLY; The client tenant id of the identity. TenantID *uuid.UUID `json:"tenantId,omitempty"` + // UserAssignedIdentities - The list of user identities associated with the resource. The user identity + // dictionary key references will be ARM resource ids in the form: + // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + // providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + UserAssignedIdentities map[string]*UserIdentityProperties `json:"userAssignedIdentities"` +} + +// MarshalJSON is the custom marshaler for ServiceIdentity. +func (si ServiceIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if si.Type != "" { + objectMap["type"] = si.Type + } + if si.UserAssignedIdentities != nil { + objectMap["userAssignedIdentities"] = si.UserAssignedIdentities + } + return json.Marshal(objectMap) } // ServiceListResult the response of the List API Management services operation. @@ -9137,6 +10802,8 @@ type ServiceProperties struct { ManagementAPIURL *string `json:"managementApiUrl,omitempty"` // ScmURL - READ-ONLY; SCM endpoint URL of the API Management service. ScmURL *string `json:"scmUrl,omitempty"` + // DeveloperPortalURL - READ-ONLY; DEveloper Portal endpoint URL of the API Management service. + DeveloperPortalURL *string `json:"developerPortalUrl,omitempty"` // HostnameConfigurations - Custom hostname configuration of the API Management service. HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` // PublicIPAddresses - READ-ONLY; Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard and Premium SKU. @@ -9147,12 +10814,18 @@ type ServiceProperties struct { VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` // AdditionalLocations - Additional datacenter locations of the API Management service. AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"` - // CustomProperties - Custom properties of the API Management service. Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2). Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1 and setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service. + // CustomProperties - Custom properties of the API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be used to disable just TLS 1.1 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to disable TLS 1.0 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be used to enable HTTP2 protocol on an API Management service.
Not specifying any of these properties on PATCH operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value is `True` if the service was created on or before April 1st 2018 and `False` otherwise. Http2 setting's default value is `False`.

You can disable any of next ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. For example, `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. The default value is `true` for them. Note: next ciphers can't be disabled since they are required by Azure CloudService internal components: TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384 CustomProperties map[string]*string `json:"customProperties"` // Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. Certificates *[]CertificateConfiguration `json:"certificates,omitempty"` + // EnableClientCertificate - Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. + EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"` + // DisableGateway - Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway in master region. + DisableGateway *bool `json:"disableGateway,omitempty"` // VirtualNetworkType - The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. Possible values include: 'VirtualNetworkTypeNone', 'VirtualNetworkTypeExternal', 'VirtualNetworkTypeInternal' VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"` + // APIVersionConstraint - Control Plane Apis version constraint for the API Management service. + APIVersionConstraint *APIVersionConstraint `json:"apiVersionConstraint,omitempty"` } // MarshalJSON is the custom marshaler for ServiceProperties. @@ -9182,9 +10855,18 @@ func (sp ServiceProperties) MarshalJSON() ([]byte, error) { if sp.Certificates != nil { objectMap["certificates"] = sp.Certificates } + if sp.EnableClientCertificate != nil { + objectMap["enableClientCertificate"] = sp.EnableClientCertificate + } + if sp.DisableGateway != nil { + objectMap["disableGateway"] = sp.DisableGateway + } if sp.VirtualNetworkType != "" { objectMap["virtualNetworkType"] = sp.VirtualNetworkType } + if sp.APIVersionConstraint != nil { + objectMap["apiVersionConstraint"] = sp.APIVersionConstraint + } return json.Marshal(objectMap) } @@ -9359,9 +11041,9 @@ func (future *ServiceRestoreFuture) Result(client ServiceClient) (sr ServiceReso // ServiceSkuProperties API Management service resource SKU properties. type ServiceSkuProperties struct { - // Name - Name of the Sku. Possible values include: 'SkuTypeDeveloper', 'SkuTypeStandard', 'SkuTypePremium', 'SkuTypeBasic' + // Name - Name of the Sku. Possible values include: 'SkuTypeDeveloper', 'SkuTypeStandard', 'SkuTypePremium', 'SkuTypeBasic', 'SkuTypeConsumption' Name SkuType `json:"name,omitempty"` - // Capacity - Capacity of the SKU (number of deployed units of the SKU). The default value is 1. + // Capacity - Capacity of the SKU (number of deployed units of the SKU). For Consumption SKU capacity must be specified as 0. Capacity *int32 `json:"capacity,omitempty"` } @@ -9394,43 +11076,6 @@ func (future *ServiceUpdateFuture) Result(client ServiceClient) (sr ServiceResou return } -// ServiceUpdateHostnameFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ServiceUpdateHostnameFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ServiceUpdateHostnameFuture) Result(client ServiceClient) (sr ServiceResource, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.ServiceUpdateHostnameFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceUpdateHostnameFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { - sr, err = client.UpdateHostnameResponder(sr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.ServiceUpdateHostnameFuture", "Result", sr.Response.Response, "Failure responding to request") - } - } - return -} - -// ServiceUpdateHostnameParameters parameters supplied to the UpdateHostname operation. -type ServiceUpdateHostnameParameters struct { - // Update - Hostnames to create or update. - Update *[]HostnameConfigurationOld `json:"update,omitempty"` - // Delete - Hostnames types to delete. - Delete *[]HostnameType `json:"delete,omitempty"` -} - // ServiceUpdateParameters parameter supplied to Update Api Management Service. type ServiceUpdateParameters struct { // ServiceUpdateProperties - Properties of the API Management service. @@ -9580,6 +11225,8 @@ type ServiceUpdateProperties struct { ManagementAPIURL *string `json:"managementApiUrl,omitempty"` // ScmURL - READ-ONLY; SCM endpoint URL of the API Management service. ScmURL *string `json:"scmUrl,omitempty"` + // DeveloperPortalURL - READ-ONLY; DEveloper Portal endpoint URL of the API Management service. + DeveloperPortalURL *string `json:"developerPortalUrl,omitempty"` // HostnameConfigurations - Custom hostname configuration of the API Management service. HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` // PublicIPAddresses - READ-ONLY; Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard and Premium SKU. @@ -9590,12 +11237,18 @@ type ServiceUpdateProperties struct { VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` // AdditionalLocations - Additional datacenter locations of the API Management service. AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"` - // CustomProperties - Custom properties of the API Management service. Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2). Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1 and setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service. + // CustomProperties - Custom properties of the API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be used to disable just TLS 1.1 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to disable TLS 1.0 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be used to enable HTTP2 protocol on an API Management service.
Not specifying any of these properties on PATCH operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value is `True` if the service was created on or before April 1st 2018 and `False` otherwise. Http2 setting's default value is `False`.

You can disable any of next ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. For example, `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. The default value is `true` for them. Note: next ciphers can't be disabled since they are required by Azure CloudService internal components: TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384 CustomProperties map[string]*string `json:"customProperties"` // Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. Certificates *[]CertificateConfiguration `json:"certificates,omitempty"` + // EnableClientCertificate - Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. + EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"` + // DisableGateway - Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway in master region. + DisableGateway *bool `json:"disableGateway,omitempty"` // VirtualNetworkType - The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. Possible values include: 'VirtualNetworkTypeNone', 'VirtualNetworkTypeExternal', 'VirtualNetworkTypeInternal' VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"` + // APIVersionConstraint - Control Plane Apis version constraint for the API Management service. + APIVersionConstraint *APIVersionConstraint `json:"apiVersionConstraint,omitempty"` } // MarshalJSON is the custom marshaler for ServiceUpdateProperties. @@ -9625,23 +11278,21 @@ func (sup ServiceUpdateProperties) MarshalJSON() ([]byte, error) { if sup.Certificates != nil { objectMap["certificates"] = sup.Certificates } + if sup.EnableClientCertificate != nil { + objectMap["enableClientCertificate"] = sup.EnableClientCertificate + } + if sup.DisableGateway != nil { + objectMap["disableGateway"] = sup.DisableGateway + } if sup.VirtualNetworkType != "" { objectMap["virtualNetworkType"] = sup.VirtualNetworkType } + if sup.APIVersionConstraint != nil { + objectMap["apiVersionConstraint"] = sup.APIVersionConstraint + } return json.Marshal(objectMap) } -// ServiceUploadCertificateParameters parameters supplied to the Upload SSL certificate for an API -// Management service operation. -type ServiceUploadCertificateParameters struct { - // Type - Hostname type. Possible values include: 'Proxy', 'Portal', 'Management', 'Scm' - Type HostnameType `json:"type,omitempty"` - // Certificate - Base64 Encoded certificate. - Certificate *string `json:"certificate,omitempty"` - // CertificatePassword - Certificate password. - CertificatePassword *string `json:"certificate_password,omitempty"` -} - // SubscriptionCollection paged Subscriptions list representation. type SubscriptionCollection struct { autorest.Response `json:"-"` @@ -9863,10 +11514,10 @@ func (sc *SubscriptionContract) UnmarshalJSON(body []byte) error { // SubscriptionContractProperties subscription details. type SubscriptionContractProperties struct { - // 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. - UserID *string `json:"userId,omitempty"` - // 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. - ProductID *string `json:"productId,omitempty"` + // OwnerID - The user resource identifier of the subscription owner. The value is a valid relative URL in the format of /users/{userId} where {userId} is a user identifier. + OwnerID *string `json:"ownerId,omitempty"` + // Scope - Scope like /products/{productId} or /apis or /apis/{apiId}. + Scope *string `json:"scope,omitempty"` // DisplayName - The name of the subscription, or null if the subscription has no name. DisplayName *string `json:"displayName,omitempty"` // 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' @@ -9881,20 +11532,22 @@ type SubscriptionContractProperties struct { EndDate *date.Time `json:"endDate,omitempty"` // 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. NotificationDate *date.Time `json:"notificationDate,omitempty"` - // PrimaryKey - Subscription primary key. + // PrimaryKey - Subscription primary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. PrimaryKey *string `json:"primaryKey,omitempty"` - // SecondaryKey - Subscription secondary key. + // SecondaryKey - Subscription secondary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. SecondaryKey *string `json:"secondaryKey,omitempty"` // StateComment - Optional subscription comment added by an administrator. StateComment *string `json:"stateComment,omitempty"` + // AllowTracing - Determines whether tracing is enabled + AllowTracing *bool `json:"allowTracing,omitempty"` } // SubscriptionCreateParameterProperties parameters supplied to the Create subscription operation. type SubscriptionCreateParameterProperties struct { - // UserID - User (user id path) for whom subscription is being created in form /users/{uid} - UserID *string `json:"userId,omitempty"` - // ProductID - Product (product id path) for which subscription is being created in form /products/{productId} - ProductID *string `json:"productId,omitempty"` + // OwnerID - User (user id path) for whom subscription is being created in form /users/{userId} + OwnerID *string `json:"ownerId,omitempty"` + // Scope - Scope like /products/{productId} or /apis or /apis/{apiId}. + Scope *string `json:"scope,omitempty"` // DisplayName - Subscription name. DisplayName *string `json:"displayName,omitempty"` // PrimaryKey - Primary subscription key. If not specified during request key will be generated automatically. @@ -9903,6 +11556,8 @@ type SubscriptionCreateParameterProperties struct { SecondaryKey *string `json:"secondaryKey,omitempty"` // 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' State SubscriptionState `json:"state,omitempty"` + // AllowTracing - Determines whether tracing can be enabled + AllowTracing *bool `json:"allowTracing,omitempty"` } // SubscriptionCreateParameters subscription create details. @@ -9952,6 +11607,15 @@ type SubscriptionKeyParameterNamesContract struct { Query *string `json:"query,omitempty"` } +// SubscriptionKeysContract subscription keys. +type SubscriptionKeysContract struct { + autorest.Response `json:"-"` + // PrimaryKey - Subscription primary key. + PrimaryKey *string `json:"primaryKey,omitempty"` + // SecondaryKey - Subscription secondary key. + SecondaryKey *string `json:"secondaryKey,omitempty"` +} + // SubscriptionsDelegationSettingsProperties subscriptions delegation settings properties. type SubscriptionsDelegationSettingsProperties struct { // Enabled - Enable or disable delegation for subscriptions. @@ -9960,10 +11624,10 @@ type SubscriptionsDelegationSettingsProperties struct { // SubscriptionUpdateParameterProperties parameters supplied to the Update subscription operation. type SubscriptionUpdateParameterProperties struct { - // UserID - User identifier path: /users/{uid} - UserID *string `json:"userId,omitempty"` - // ProductID - Product identifier path: /products/{productId} - ProductID *string `json:"productId,omitempty"` + // OwnerID - User identifier path: /users/{userId} + OwnerID *string `json:"ownerId,omitempty"` + // Scope - Scope like /products/{productId} or /apis or /apis/{apiId} + Scope *string `json:"scope,omitempty"` // 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. ExpirationDate *date.Time `json:"expirationDate,omitempty"` // DisplayName - Subscription name. @@ -9976,6 +11640,8 @@ type SubscriptionUpdateParameterProperties struct { State SubscriptionState `json:"state,omitempty"` // StateComment - Comments describing subscription state change by the administrator. StateComment *string `json:"stateComment,omitempty"` + // AllowTracing - Determines whether tracing can be enabled + AllowTracing *bool `json:"allowTracing,omitempty"` } // SubscriptionUpdateParameters subscription update details. @@ -10512,6 +12178,8 @@ func (tdc *TagDescriptionContract) UnmarshalJSON(body []byte) error { // TagDescriptionContractProperties tagDescription contract Properties. type TagDescriptionContractProperties struct { + // TagID - Identifier of the tag in the form of /tags/{tagId} + TagID *string `json:"tagId,omitempty"` // DisplayName - Tag name. DisplayName *string `json:"displayName,omitempty"` // Description - Description of the Tag. @@ -10566,8 +12234,6 @@ type TagResourceCollection struct { autorest.Response `json:"-"` // Value - Page values. Value *[]TagResourceContract `json:"value,omitempty"` - // Count - Total record count number across all pages. - Count *int64 `json:"count,omitempty"` // NextLink - Next page link if any. NextLink *string `json:"nextLink,omitempty"` } @@ -11102,6 +12768,8 @@ type UserCreateParameterProperties struct { LastName *string `json:"lastName,omitempty"` // Password - User Password. If no value is provided, a default password is generated. Password *string `json:"password,omitempty"` + // AppType - Determines the type of application which send the create user request. Default is old publisher portal. Possible values include: 'DeveloperPortal' + AppType AppType `json:"appType,omitempty"` // Confirmation - Determines the type of confirmation e-mail that will be sent to the newly created user. Possible values include: 'Signup', 'Invite' Confirmation Confirmation `json:"confirmation,omitempty"` // 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', 'UserStatePending', 'UserStateDeleted' @@ -11317,14 +12985,61 @@ type UserIdentityContract struct { ID *string `json:"id,omitempty"` } -// UserTokenParameters parameters supplied to the Get User Token operation. -type UserTokenParameters struct { +// UserIdentityProperties ... +type UserIdentityProperties struct { + // PrincipalID - The principal id of user assigned identity. + PrincipalID *string `json:"principalId,omitempty"` + // ClientID - The client id of user assigned identity. + ClientID *string `json:"clientId,omitempty"` +} + +// UserTokenParameterProperties parameters supplied to the Get User Token operation. +type UserTokenParameterProperties struct { // KeyType - The Key to be used to generate token for user. Possible values include: 'Primary', 'Secondary' KeyType KeyType `json:"keyType,omitempty"` // 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. Expiry *date.Time `json:"expiry,omitempty"` } +// UserTokenParameters get User Token parameters. +type UserTokenParameters struct { + // UserTokenParameterProperties - User Token Parameter contract properties. + *UserTokenParameterProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for UserTokenParameters. +func (utp UserTokenParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if utp.UserTokenParameterProperties != nil { + objectMap["properties"] = utp.UserTokenParameterProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for UserTokenParameters struct. +func (utp *UserTokenParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var userTokenParameterProperties UserTokenParameterProperties + err = json.Unmarshal(*v, &userTokenParameterProperties) + if err != nil { + return err + } + utp.UserTokenParameterProperties = &userTokenParameterProperties + } + } + } + + return nil +} + // UserTokenResult get User Token response details. type UserTokenResult struct { autorest.Response `json:"-"` diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/namedvalue.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/namedvalue.go new file mode 100644 index 000000000000..88c758c169ed --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/namedvalue.go @@ -0,0 +1,747 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// NamedValueClient is the apiManagement Client +type NamedValueClient struct { + BaseClient +} + +// NewNamedValueClient creates an instance of the NamedValueClient client. +func NewNamedValueClient(subscriptionID string) NamedValueClient { + return NewNamedValueClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewNamedValueClientWithBaseURI creates an instance of the NamedValueClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewNamedValueClientWithBaseURI(baseURI string, subscriptionID string) NamedValueClient { + return NamedValueClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a NamedValue. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// namedValueID - identifier of the NamedValue. +// parameters - create parameters. +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client NamedValueClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string, parameters NamedValueCreateContract, ifMatch string) (result NamedValueCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NamedValueClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: namedValueID, + Constraints: []validation.Constraint{{Target: "namedValueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "namedValueID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.NamedValueCreateContractProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.NamedValueCreateContractProperties.DisplayName", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.NamedValueCreateContractProperties.DisplayName", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "parameters.NamedValueCreateContractProperties.DisplayName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "parameters.NamedValueCreateContractProperties.DisplayName", Name: validation.Pattern, Rule: `^[A-Za-z0-9-._]+$`, Chain: nil}, + }}, + {Target: "parameters.NamedValueCreateContractProperties.Value", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.NamedValueCreateContractProperties.Value", Name: validation.MaxLength, Rule: 4096, Chain: nil}, + {Target: "parameters.NamedValueCreateContractProperties.Value", Name: validation.MinLength, Rule: 1, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("apimanagement.NamedValueClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, namedValueID, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client NamedValueClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string, parameters NamedValueCreateContract, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "namedValueId": autorest.Encode("path", namedValueID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client NamedValueClient) CreateOrUpdateSender(req *http.Request) (future NamedValueCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client NamedValueClient) CreateOrUpdateResponder(resp *http.Response) (result NamedValueContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes specific NamedValue from the API Management service instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// namedValueID - identifier of the NamedValue. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client NamedValueClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string, ifMatch string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NamedValueClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: namedValueID, + Constraints: []validation.Constraint{{Target: "namedValueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "namedValueID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.NamedValueClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, namedValueID, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client NamedValueClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "namedValueId": autorest.Encode("path", namedValueID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client NamedValueClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client NamedValueClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the NamedValue specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// namedValueID - identifier of the NamedValue. +func (client NamedValueClient) Get(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string) (result NamedValueContract, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NamedValueClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: namedValueID, + Constraints: []validation.Constraint{{Target: "namedValueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "namedValueID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.NamedValueClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, namedValueID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client NamedValueClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "namedValueId": autorest.Encode("path", namedValueID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client NamedValueClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client NamedValueClient) GetResponder(resp *http.Response) (result NamedValueContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEntityTag gets the entity state (Etag) version of the NamedValue specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// namedValueID - identifier of the NamedValue. +func (client NamedValueClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NamedValueClient.GetEntityTag") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: namedValueID, + Constraints: []validation.Constraint{{Target: "namedValueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "namedValueID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.NamedValueClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, namedValueID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client NamedValueClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "namedValueId": autorest.Encode("path", namedValueID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client NamedValueClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client NamedValueClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListByService lists a collection of NamedValues defined within a service instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| tags | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith, any, all |
| displayName | filter | ge, le, eq, ne, gt, +// lt | substringof, contains, startswith, endswith |
+// top - number of records to return. +// skip - number of records to skip. +func (client NamedValueClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result NamedValueCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NamedValueClient.ListByService") + defer func() { + sc := -1 + if result.nvc.Response.Response != nil { + sc = result.nvc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.NamedValueClient", "ListByService", err.Error()) + } + + result.fn = client.listByServiceNextResults + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "ListByService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServiceSender(req) + if err != nil { + result.nvc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "ListByService", resp, "Failure sending request") + return + } + + result.nvc, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "ListByService", resp, "Failure responding to request") + } + + return +} + +// ListByServicePreparer prepares the ListByService request. +func (client NamedValueClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServiceSender sends the ListByService request. The method will close the +// http.Response Body if it receives an error. +func (client NamedValueClient) ListByServiceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServiceResponder handles the response to the ListByService request. The method always +// closes the http.Response Body. +func (client NamedValueClient) ListByServiceResponder(resp *http.Response) (result NamedValueCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByServiceNextResults retrieves the next set of results, if any. +func (client NamedValueClient) listByServiceNextResults(ctx context.Context, lastResults NamedValueCollection) (result NamedValueCollection, err error) { + req, err := lastResults.namedValueCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "listByServiceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "listByServiceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "listByServiceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client NamedValueClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result NamedValueCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NamedValueClient.ListByService") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip) + return +} + +// ListValue gets the secret value of the NamedValue. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// namedValueID - identifier of the NamedValue. +func (client NamedValueClient) ListValue(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string) (result PropertyValueContract, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NamedValueClient.ListValue") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: namedValueID, + Constraints: []validation.Constraint{{Target: "namedValueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "namedValueID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.NamedValueClient", "ListValue", err.Error()) + } + + req, err := client.ListValuePreparer(ctx, resourceGroupName, serviceName, namedValueID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "ListValue", nil, "Failure preparing request") + return + } + + resp, err := client.ListValueSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "ListValue", resp, "Failure sending request") + return + } + + result, err = client.ListValueResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "ListValue", resp, "Failure responding to request") + } + + return +} + +// ListValuePreparer prepares the ListValue request. +func (client NamedValueClient) ListValuePreparer(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "namedValueId": autorest.Encode("path", namedValueID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}/listValue", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListValueSender sends the ListValue request. The method will close the +// http.Response Body if it receives an error. +func (client NamedValueClient) ListValueSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListValueResponder handles the response to the ListValue request. The method always +// closes the http.Response Body. +func (client NamedValueClient) ListValueResponder(resp *http.Response) (result PropertyValueContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates the specific NamedValue. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// namedValueID - identifier of the NamedValue. +// parameters - update parameters. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client NamedValueClient) Update(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string, parameters NamedValueUpdateParameters, ifMatch string) (result NamedValueUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NamedValueClient.Update") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: namedValueID, + Constraints: []validation.Constraint{{Target: "namedValueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "namedValueID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.NamedValueClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, namedValueID, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client NamedValueClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string, parameters NamedValueUpdateParameters, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "namedValueId": autorest.Encode("path", namedValueID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client NamedValueClient) UpdateSender(req *http.Request) (future NamedValueUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client NamedValueClient) UpdateResponder(resp *http.Response) (result NamedValueContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/networkstatus.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/networkstatus.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/networkstatus.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/networkstatus.go index 6076dcb4c053..1af7879028e5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/networkstatus.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/networkstatus.go @@ -100,7 +100,7 @@ func (client NetworkStatusClient) ListByLocationPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -185,7 +185,7 @@ func (client NetworkStatusClient) ListByServicePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/notification.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/notification.go similarity index 98% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/notification.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/notification.go index 5c03524ed16e..bdd23eecb6d5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/notification.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/notification.go @@ -42,7 +42,7 @@ func NewNotificationClientWithBaseURI(baseURI string, subscriptionID string) Not return NotificationClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate updates an Notification. +// CreateOrUpdate create or Update API Management publisher notification. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. @@ -97,7 +97,7 @@ func (client NotificationClient) CreateOrUpdatePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -187,7 +187,7 @@ func (client NotificationClient) GetPreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -280,7 +280,7 @@ func (client NotificationClient) ListByServicePreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/notificationrecipientemail.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/notificationrecipientemail.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/notificationrecipientemail.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/notificationrecipientemail.go index 70c2e3a87341..8bddd00f2f9b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/notificationrecipientemail.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/notificationrecipientemail.go @@ -99,7 +99,7 @@ func (client NotificationRecipientEmailClient) CheckEntityExistsPreparer(ctx con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -186,7 +186,7 @@ func (client NotificationRecipientEmailClient) CreateOrUpdatePreparer(ctx contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -274,7 +274,7 @@ func (client NotificationRecipientEmailClient) DeletePreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -359,7 +359,7 @@ func (client NotificationRecipientEmailClient) ListByNotificationPreparer(ctx co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/notificationrecipientuser.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/notificationrecipientuser.go similarity index 88% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/notificationrecipientuser.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/notificationrecipientuser.go index d1b7d1b31d47..5324a910bb2f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/notificationrecipientuser.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/notificationrecipientuser.go @@ -48,8 +48,8 @@ func NewNotificationRecipientUserClientWithBaseURI(baseURI string, subscriptionI // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // notificationName - notification Name Identifier. -// UID - user identifier. Must be unique in the current API Management service instance. -func (client NotificationRecipientUserClient) CheckEntityExists(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, UID string) (result autorest.Response, err error) { +// userID - user identifier. Must be unique in the current API Management service instance. +func (client NotificationRecipientUserClient) CheckEntityExists(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, userID string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/NotificationRecipientUserClient.CheckEntityExists") defer func() { @@ -65,14 +65,13 @@ func (client NotificationRecipientUserClient) CheckEntityExists(ctx context.Cont Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: UID, - Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {TargetValue: userID, + Constraints: []validation.Constraint{{Target: "userID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "userID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.NotificationRecipientUserClient", "CheckEntityExists", err.Error()) } - req, err := client.CheckEntityExistsPreparer(ctx, resourceGroupName, serviceName, notificationName, UID) + req, err := client.CheckEntityExistsPreparer(ctx, resourceGroupName, serviceName, notificationName, userID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.NotificationRecipientUserClient", "CheckEntityExists", nil, "Failure preparing request") return @@ -94,16 +93,16 @@ func (client NotificationRecipientUserClient) CheckEntityExists(ctx context.Cont } // CheckEntityExistsPreparer prepares the CheckEntityExists request. -func (client NotificationRecipientUserClient) CheckEntityExistsPreparer(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, UID string) (*http.Request, error) { +func (client NotificationRecipientUserClient) CheckEntityExistsPreparer(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, userID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "notificationName": autorest.Encode("path", notificationName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "uid": autorest.Encode("path", UID), + "userId": autorest.Encode("path", userID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -111,7 +110,7 @@ func (client NotificationRecipientUserClient) CheckEntityExistsPreparer(ctx cont preparer := autorest.CreatePreparer( autorest.AsHead(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{uid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{userId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -139,8 +138,8 @@ func (client NotificationRecipientUserClient) CheckEntityExistsResponder(resp *h // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // notificationName - notification Name Identifier. -// UID - user identifier. Must be unique in the current API Management service instance. -func (client NotificationRecipientUserClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, UID string) (result RecipientUserContract, err error) { +// userID - user identifier. Must be unique in the current API Management service instance. +func (client NotificationRecipientUserClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, userID string) (result RecipientUserContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/NotificationRecipientUserClient.CreateOrUpdate") defer func() { @@ -156,14 +155,13 @@ func (client NotificationRecipientUserClient) CreateOrUpdate(ctx context.Context Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: UID, - Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {TargetValue: userID, + Constraints: []validation.Constraint{{Target: "userID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "userID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.NotificationRecipientUserClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, notificationName, UID) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, notificationName, userID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.NotificationRecipientUserClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -185,16 +183,16 @@ func (client NotificationRecipientUserClient) CreateOrUpdate(ctx context.Context } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client NotificationRecipientUserClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, UID string) (*http.Request, error) { +func (client NotificationRecipientUserClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, userID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "notificationName": autorest.Encode("path", notificationName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "uid": autorest.Encode("path", UID), + "userId": autorest.Encode("path", userID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -202,7 +200,7 @@ func (client NotificationRecipientUserClient) CreateOrUpdatePreparer(ctx context preparer := autorest.CreatePreparer( autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{uid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{userId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -231,8 +229,8 @@ func (client NotificationRecipientUserClient) CreateOrUpdateResponder(resp *http // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // notificationName - notification Name Identifier. -// UID - user identifier. Must be unique in the current API Management service instance. -func (client NotificationRecipientUserClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, UID string) (result autorest.Response, err error) { +// userID - user identifier. Must be unique in the current API Management service instance. +func (client NotificationRecipientUserClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, userID string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/NotificationRecipientUserClient.Delete") defer func() { @@ -248,14 +246,13 @@ func (client NotificationRecipientUserClient) Delete(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: UID, - Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {TargetValue: userID, + Constraints: []validation.Constraint{{Target: "userID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "userID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.NotificationRecipientUserClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, notificationName, UID) + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, notificationName, userID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.NotificationRecipientUserClient", "Delete", nil, "Failure preparing request") return @@ -277,16 +274,16 @@ func (client NotificationRecipientUserClient) Delete(ctx context.Context, resour } // DeletePreparer prepares the Delete request. -func (client NotificationRecipientUserClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, UID string) (*http.Request, error) { +func (client NotificationRecipientUserClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, userID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "notificationName": autorest.Encode("path", notificationName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "uid": autorest.Encode("path", UID), + "userId": autorest.Encode("path", userID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -294,7 +291,7 @@ func (client NotificationRecipientUserClient) DeletePreparer(ctx context.Context preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{uid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{userId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -371,7 +368,7 @@ func (client NotificationRecipientUserClient) ListByNotificationPreparer(ctx con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/openidconnectprovider.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/openidconnectprovider.go similarity index 86% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/openidconnectprovider.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/openidconnectprovider.go index 6a17a95442b6..552546def4c2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/openidconnectprovider.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/openidconnectprovider.go @@ -109,7 +109,7 @@ func (client OpenIDConnectProviderClient) CreateOrUpdatePreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -206,7 +206,7 @@ func (client OpenIDConnectProviderClient) DeletePreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -295,7 +295,7 @@ func (client OpenIDConnectProviderClient) GetPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -384,7 +384,7 @@ func (client OpenIDConnectProviderClient) GetEntityTagPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -415,14 +415,14 @@ func (client OpenIDConnectProviderClient) GetEntityTagResponder(resp *http.Respo return } -// ListByService lists all OpenID Connect Providers. +// ListByService lists of all the OpenId Connect Providers. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - | Field | Supported operators | Supported functions | -// |-------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. func (client OpenIDConnectProviderClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result OpenIDConnectProviderCollectionPage, err error) { @@ -480,7 +480,7 @@ func (client OpenIDConnectProviderClient) ListByServicePreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -558,6 +558,95 @@ func (client OpenIDConnectProviderClient) ListByServiceComplete(ctx context.Cont return } +// ListSecrets gets the client secret details of the OpenID Connect Provider. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// opid - identifier of the OpenID Connect Provider. +func (client OpenIDConnectProviderClient) ListSecrets(ctx context.Context, resourceGroupName string, serviceName string, opid string) (result ClientSecretContract, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OpenIDConnectProviderClient.ListSecrets") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: opid, + Constraints: []validation.Constraint{{Target: "opid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "opid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.OpenIDConnectProviderClient", "ListSecrets", err.Error()) + } + + req, err := client.ListSecretsPreparer(ctx, resourceGroupName, serviceName, opid) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.OpenIDConnectProviderClient", "ListSecrets", nil, "Failure preparing request") + return + } + + resp, err := client.ListSecretsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.OpenIDConnectProviderClient", "ListSecrets", resp, "Failure sending request") + return + } + + result, err = client.ListSecretsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.OpenIDConnectProviderClient", "ListSecrets", resp, "Failure responding to request") + } + + return +} + +// ListSecretsPreparer prepares the ListSecrets request. +func (client OpenIDConnectProviderClient) ListSecretsPreparer(ctx context.Context, resourceGroupName string, serviceName string, opid string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "opid": autorest.Encode("path", opid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}/listSecrets", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSecretsSender sends the ListSecrets request. The method will close the +// http.Response Body if it receives an error. +func (client OpenIDConnectProviderClient) ListSecretsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSecretsResponder handles the response to the ListSecrets request. The method always +// closes the http.Response Body. +func (client OpenIDConnectProviderClient) ListSecretsResponder(resp *http.Response) (result ClientSecretContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // Update updates the specific OpenID Connect Provider. // Parameters: // resourceGroupName - the name of the resource group. @@ -618,7 +707,7 @@ func (client OpenIDConnectProviderClient) UpdatePreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/operation.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/operation.go similarity index 84% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/operation.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/operation.go index 1a3b64929659..ff124e130f6a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/operation.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/operation.go @@ -48,17 +48,18 @@ func NewOperationClientWithBaseURI(baseURI string, subscriptionID string) Operat // serviceName - the name of the API Management service. // apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current // revision has ;rev=n as a suffix where n is the revision number. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | apiName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | method | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | urlTemplate | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| apiName | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| method | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
| urlTemplate | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. -func (client OperationClient) ListByTags(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result TagResourceCollectionPage, err error) { +// includeNotTaggedOperations - include not tagged Operations. +func (client OperationClient) ListByTags(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32, includeNotTaggedOperations *bool) (result TagResourceCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationClient.ListByTags") defer func() { @@ -88,7 +89,7 @@ func (client OperationClient) ListByTags(ctx context.Context, resourceGroupName } result.fn = client.listByTagsNextResults - req, err := client.ListByTagsPreparer(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + req, err := client.ListByTagsPreparer(ctx, resourceGroupName, serviceName, apiid, filter, top, skip, includeNotTaggedOperations) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.OperationClient", "ListByTags", nil, "Failure preparing request") return @@ -110,7 +111,7 @@ func (client OperationClient) ListByTags(ctx context.Context, resourceGroupName } // ListByTagsPreparer prepares the ListByTags request. -func (client OperationClient) ListByTagsPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (*http.Request, error) { +func (client OperationClient) ListByTagsPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32, includeNotTaggedOperations *bool) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -118,7 +119,7 @@ func (client OperationClient) ListByTagsPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -131,6 +132,9 @@ func (client OperationClient) ListByTagsPreparer(ctx context.Context, resourceGr if skip != nil { queryParameters["$skip"] = autorest.Encode("query", *skip) } + if includeNotTaggedOperations != nil { + queryParameters["includeNotTaggedOperations"] = autorest.Encode("query", *includeNotTaggedOperations) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -181,7 +185,7 @@ func (client OperationClient) listByTagsNextResults(ctx context.Context, lastRes } // ListByTagsComplete enumerates all values, automatically crossing page boundaries as required. -func (client OperationClient) ListByTagsComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result TagResourceCollectionIterator, err error) { +func (client OperationClient) ListByTagsComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32, includeNotTaggedOperations *bool) (result TagResourceCollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationClient.ListByTags") defer func() { @@ -192,6 +196,6 @@ func (client OperationClient) ListByTagsComplete(ctx context.Context, resourceGr tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByTags(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + result.page, err = client.ListByTags(ctx, resourceGroupName, serviceName, apiid, filter, top, skip, includeNotTaggedOperations) return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/operations.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/operations.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/operations.go index 2a04e801a9e2..84b4976056b6 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/operations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/operations.go @@ -77,7 +77,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe // ListPreparer prepares the List request. func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/policy.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/policy.go similarity index 93% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/policy.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/policy.go index 7e05f4b53197..a1d4fbf54cab 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/policy.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/policy.go @@ -47,7 +47,8 @@ func NewPolicyClientWithBaseURI(baseURI string, subscriptionID string) PolicyCli // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // parameters - the policy contents to apply. -func (client PolicyClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters PolicyContract) (result PolicyContract, err error) { +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client PolicyClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters PolicyContract, ifMatch string) (result PolicyContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PolicyClient.CreateOrUpdate") defer func() { @@ -65,11 +66,11 @@ func (client PolicyClient) CreateOrUpdate(ctx context.Context, resourceGroupName {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.PolicyContractProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.PolicyContractProperties.PolicyContent", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + Chain: []validation.Constraint{{Target: "parameters.PolicyContractProperties.Value", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { return result, validation.NewError("apimanagement.PolicyClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, parameters) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, parameters, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.PolicyClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -91,7 +92,7 @@ func (client PolicyClient) CreateOrUpdate(ctx context.Context, resourceGroupName } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client PolicyClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters PolicyContract) (*http.Request, error) { +func (client PolicyClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters PolicyContract, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ "policyId": autorest.Encode("path", "policy"), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -99,7 +100,7 @@ func (client PolicyClient) CreateOrUpdatePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -111,6 +112,10 @@ func (client PolicyClient) CreateOrUpdatePreparer(ctx context.Context, resourceG autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -188,7 +193,7 @@ func (client PolicyClient) DeletePreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -224,7 +229,8 @@ func (client PolicyClient) DeleteResponder(resp *http.Response) (result autorest // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -func (client PolicyClient) Get(ctx context.Context, resourceGroupName string, serviceName string) (result PolicyContract, err error) { +// formatParameter - policy Export Format. +func (client PolicyClient) Get(ctx context.Context, resourceGroupName string, serviceName string, formatParameter PolicyExportFormat) (result PolicyContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PolicyClient.Get") defer func() { @@ -243,7 +249,7 @@ func (client PolicyClient) Get(ctx context.Context, resourceGroupName string, se return result, validation.NewError("apimanagement.PolicyClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, serviceName) + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, formatParameter) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.PolicyClient", "Get", nil, "Failure preparing request") return @@ -265,7 +271,7 @@ func (client PolicyClient) Get(ctx context.Context, resourceGroupName string, se } // GetPreparer prepares the Get request. -func (client PolicyClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { +func (client PolicyClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, formatParameter PolicyExportFormat) (*http.Request, error) { pathParameters := map[string]interface{}{ "policyId": autorest.Encode("path", "policy"), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -273,10 +279,15 @@ func (client PolicyClient) GetPreparer(ctx context.Context, resourceGroupName st "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if len(string(formatParameter)) > 0 { + queryParameters["format"] = autorest.Encode("query", formatParameter) + } else { + queryParameters["format"] = autorest.Encode("query", "xml") + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -358,7 +369,7 @@ func (client PolicyClient) GetEntityTagPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -393,8 +404,7 @@ func (client PolicyClient) GetEntityTagResponder(resp *http.Response) (result au // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// scope - policy scope. -func (client PolicyClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, scope PolicyScopeContract) (result PolicyCollection, err error) { +func (client PolicyClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string) (result PolicyCollection, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PolicyClient.ListByService") defer func() { @@ -413,7 +423,7 @@ func (client PolicyClient) ListByService(ctx context.Context, resourceGroupName return result, validation.NewError("apimanagement.PolicyClient", "ListByService", err.Error()) } - req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, scope) + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.PolicyClient", "ListByService", nil, "Failure preparing request") return @@ -435,20 +445,17 @@ func (client PolicyClient) ListByService(ctx context.Context, resourceGroupName } // ListByServicePreparer prepares the ListByService request. -func (client PolicyClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, scope PolicyScopeContract) (*http.Request, error) { +func (client PolicyClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } - if len(string(scope)) > 0 { - queryParameters["scope"] = autorest.Encode("query", scope) - } preparer := autorest.CreatePreparer( autorest.AsGet(), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/policysnippets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/policydescription.go similarity index 62% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/policysnippets.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/policydescription.go index 949a4d62c939..bdefd3f94aba 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/policysnippets.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/policydescription.go @@ -26,30 +26,31 @@ import ( "net/http" ) -// PolicySnippetsClient is the apiManagement Client -type PolicySnippetsClient struct { +// PolicyDescriptionClient is the apiManagement Client +type PolicyDescriptionClient struct { BaseClient } -// NewPolicySnippetsClient creates an instance of the PolicySnippetsClient client. -func NewPolicySnippetsClient(subscriptionID string) PolicySnippetsClient { - return NewPolicySnippetsClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewPolicyDescriptionClient creates an instance of the PolicyDescriptionClient client. +func NewPolicyDescriptionClient(subscriptionID string) PolicyDescriptionClient { + return NewPolicyDescriptionClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewPolicySnippetsClientWithBaseURI creates an instance of the PolicySnippetsClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewPolicySnippetsClientWithBaseURI(baseURI string, subscriptionID string) PolicySnippetsClient { - return PolicySnippetsClient{NewWithBaseURI(baseURI, subscriptionID)} +// NewPolicyDescriptionClientWithBaseURI creates an instance of the PolicyDescriptionClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewPolicyDescriptionClientWithBaseURI(baseURI string, subscriptionID string) PolicyDescriptionClient { + return PolicyDescriptionClient{NewWithBaseURI(baseURI, subscriptionID)} } -// ListByService lists all policy snippets. +// ListByService lists all policy descriptions. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // scope - policy scope. -func (client PolicySnippetsClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, scope PolicyScopeContract) (result PolicySnippetsCollection, err error) { +func (client PolicyDescriptionClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, scope PolicyScopeContract) (result PolicyDescriptionCollection, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PolicySnippetsClient.ListByService") + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyDescriptionClient.ListByService") defer func() { sc := -1 if result.Response.Response != nil { @@ -63,39 +64,39 @@ func (client PolicySnippetsClient) ListByService(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("apimanagement.PolicySnippetsClient", "ListByService", err.Error()) + return result, validation.NewError("apimanagement.PolicyDescriptionClient", "ListByService", err.Error()) } req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, scope) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.PolicySnippetsClient", "ListByService", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "apimanagement.PolicyDescriptionClient", "ListByService", nil, "Failure preparing request") return } resp, err := client.ListByServiceSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "apimanagement.PolicySnippetsClient", "ListByService", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "apimanagement.PolicyDescriptionClient", "ListByService", resp, "Failure sending request") return } result, err = client.ListByServiceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.PolicySnippetsClient", "ListByService", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "apimanagement.PolicyDescriptionClient", "ListByService", resp, "Failure responding to request") } return } // ListByServicePreparer prepares the ListByService request. -func (client PolicySnippetsClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, scope PolicyScopeContract) (*http.Request, error) { +func (client PolicyDescriptionClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, scope PolicyScopeContract) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -106,20 +107,20 @@ func (client PolicySnippetsClient) ListByServicePreparer(ctx context.Context, re preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policySnippets", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyDescriptions", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // ListByServiceSender sends the ListByService request. The method will close the // http.Response Body if it receives an error. -func (client PolicySnippetsClient) ListByServiceSender(req *http.Request) (*http.Response, error) { +func (client PolicyDescriptionClient) ListByServiceSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByServiceResponder handles the response to the ListByService request. The method always // closes the http.Response Body. -func (client PolicySnippetsClient) ListByServiceResponder(resp *http.Response) (result PolicySnippetsCollection, err error) { +func (client PolicyDescriptionClient) ListByServiceResponder(resp *http.Response) (result PolicyDescriptionCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/product.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/product.go similarity index 76% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/product.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/product.go index 4494fcc597d8..805dff8375b4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/product.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/product.go @@ -66,9 +66,8 @@ func (client ProductClient) CreateOrUpdate(ctx context.Context, resourceGroupNam {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.ProductContractProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.ProductContractProperties.DisplayName", Name: validation.Null, Rule: true, @@ -109,7 +108,7 @@ func (client ProductClient) CreateOrUpdatePreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -172,9 +171,8 @@ func (client ProductClient) Delete(ctx context.Context, resourceGroupName string {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.ProductClient", "Delete", err.Error()) } @@ -208,7 +206,7 @@ func (client ProductClient) DeletePreparer(ctx context.Context, resourceGroupNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -265,9 +263,8 @@ func (client ProductClient) Get(ctx context.Context, resourceGroupName string, s {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.ProductClient", "Get", err.Error()) } @@ -301,7 +298,7 @@ func (client ProductClient) GetPreparer(ctx context.Context, resourceGroupName s "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -355,9 +352,8 @@ func (client ProductClient) GetEntityTag(ctx context.Context, resourceGroupName {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.ProductClient", "GetEntityTag", err.Error()) } @@ -391,7 +387,7 @@ func (client ProductClient) GetEntityTagPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -426,18 +422,19 @@ func (client ProductClient) GetEntityTagResponder(resp *http.Response) (result a // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | terms | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | state | eq | | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| terms | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
| state | filter | eq | |
| groups | expand | | | +//
// top - number of records to return. // skip - number of records to skip. // expandGroups - when set to true, the response contains an array of groups that have visibility to the // product. The default is false. -func (client ProductClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, expandGroups *bool) (result ProductCollectionPage, err error) { +// tags - products which are part of a specific tag. +func (client ProductClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, expandGroups *bool, tags string) (result ProductCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ProductClient.ListByService") defer func() { @@ -463,7 +460,7 @@ func (client ProductClient) ListByService(ctx context.Context, resourceGroupName } result.fn = client.listByServiceNextResults - req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip, expandGroups) + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip, expandGroups, tags) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.ProductClient", "ListByService", nil, "Failure preparing request") return @@ -485,14 +482,14 @@ func (client ProductClient) ListByService(ctx context.Context, resourceGroupName } // ListByServicePreparer prepares the ListByService request. -func (client ProductClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, expandGroups *bool) (*http.Request, error) { +func (client ProductClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, expandGroups *bool, tags string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -508,6 +505,9 @@ func (client ProductClient) ListByServicePreparer(ctx context.Context, resourceG if expandGroups != nil { queryParameters["expandGroups"] = autorest.Encode("query", *expandGroups) } + if len(tags) > 0 { + queryParameters["tags"] = autorest.Encode("query", tags) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -558,7 +558,7 @@ func (client ProductClient) listByServiceNextResults(ctx context.Context, lastRe } // ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. -func (client ProductClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, expandGroups *bool) (result ProductCollectionIterator, err error) { +func (client ProductClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, expandGroups *bool, tags string) (result ProductCollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ProductClient.ListByService") defer func() { @@ -569,11 +569,161 @@ func (client ProductClient) ListByServiceComplete(ctx context.Context, resourceG tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip, expandGroups) + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip, expandGroups, tags) + return +} + +// ListByTags lists a collection of products associated with tags. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| terms | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
| state | filter | eq | substringof, contains, startswith, endswith | +//
+// top - number of records to return. +// skip - number of records to skip. +// includeNotTaggedProducts - include not tagged Products. +func (client ProductClient) ListByTags(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, includeNotTaggedProducts *bool) (result TagResourceCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProductClient.ListByTags") + defer func() { + sc := -1 + if result.trc.Response.Response != nil { + sc = result.trc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.ProductClient", "ListByTags", err.Error()) + } + + result.fn = client.listByTagsNextResults + req, err := client.ListByTagsPreparer(ctx, resourceGroupName, serviceName, filter, top, skip, includeNotTaggedProducts) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductClient", "ListByTags", nil, "Failure preparing request") + return + } + + resp, err := client.ListByTagsSender(req) + if err != nil { + result.trc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.ProductClient", "ListByTags", resp, "Failure sending request") + return + } + + result.trc, err = client.ListByTagsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductClient", "ListByTags", resp, "Failure responding to request") + } + + return +} + +// ListByTagsPreparer prepares the ListByTags request. +func (client ProductClient) ListByTagsPreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, includeNotTaggedProducts *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + if includeNotTaggedProducts != nil { + queryParameters["includeNotTaggedProducts"] = autorest.Encode("query", *includeNotTaggedProducts) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/productsByTags", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByTagsSender sends the ListByTags request. The method will close the +// http.Response Body if it receives an error. +func (client ProductClient) ListByTagsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByTagsResponder handles the response to the ListByTags request. The method always +// closes the http.Response Body. +func (client ProductClient) ListByTagsResponder(resp *http.Response) (result TagResourceCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByTagsNextResults retrieves the next set of results, if any. +func (client ProductClient) listByTagsNextResults(ctx context.Context, lastResults TagResourceCollection) (result TagResourceCollection, err error) { + req, err := lastResults.tagResourceCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.ProductClient", "listByTagsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByTagsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.ProductClient", "listByTagsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByTagsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductClient", "listByTagsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByTagsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ProductClient) ListByTagsComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, includeNotTaggedProducts *bool) (result TagResourceCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProductClient.ListByTags") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByTags(ctx, resourceGroupName, serviceName, filter, top, skip, includeNotTaggedProducts) return } -// Update update product. +// Update update existing product details. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. @@ -598,9 +748,8 @@ func (client ProductClient) Update(ctx context.Context, resourceGroupName string {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.ProductClient", "Update", err.Error()) } @@ -634,7 +783,7 @@ func (client ProductClient) UpdatePreparer(ctx context.Context, resourceGroupNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/productapi.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/productapi.go similarity index 93% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/productapi.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/productapi.go index fc534c75cd78..19b962a5dd6a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/productapi.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/productapi.go @@ -66,9 +66,8 @@ func (client ProductAPIClient) CheckEntityExists(ctx context.Context, resourceGr {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -107,7 +106,7 @@ func (client ProductAPIClient) CheckEntityExistsPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -132,7 +131,7 @@ func (client ProductAPIClient) CheckEntityExistsResponder(resp *http.Response) ( err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp return @@ -162,9 +161,8 @@ func (client ProductAPIClient) CreateOrUpdate(ctx context.Context, resourceGroup {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -203,7 +201,7 @@ func (client ProductAPIClient) CreateOrUpdatePreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -259,9 +257,8 @@ func (client ProductAPIClient) Delete(ctx context.Context, resourceGroupName str {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -300,7 +297,7 @@ func (client ProductAPIClient) DeletePreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -336,13 +333,13 @@ func (client ProductAPIClient) DeleteResponder(resp *http.Response) (result auto // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // productID - product identifier. Must be unique in the current API Management service instance. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | serviceUrl | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | path | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| serviceUrl | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| path | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. func (client ProductAPIClient) ListByProduct(ctx context.Context, resourceGroupName string, serviceName string, productID string, filter string, top *int32, skip *int32) (result APICollectionPage, err error) { @@ -362,9 +359,8 @@ func (client ProductAPIClient) ListByProduct(ctx context.Context, resourceGroupN {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, @@ -405,7 +401,7 @@ func (client ProductAPIClient) ListByProductPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/productgroup.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/productgroup.go similarity index 91% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/productgroup.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/productgroup.go index 55e600182e07..18874c9b9f64 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/productgroup.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/productgroup.go @@ -65,13 +65,11 @@ func (client ProductGroupClient) CheckEntityExists(ctx context.Context, resource {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: groupID, - Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "groupID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.ProductGroupClient", "CheckEntityExists", err.Error()) } @@ -106,7 +104,7 @@ func (client ProductGroupClient) CheckEntityExistsPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -131,7 +129,7 @@ func (client ProductGroupClient) CheckEntityExistsResponder(resp *http.Response) err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp return @@ -160,13 +158,11 @@ func (client ProductGroupClient) CreateOrUpdate(ctx context.Context, resourceGro {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: groupID, - Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "groupID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.ProductGroupClient", "CreateOrUpdate", err.Error()) } @@ -201,7 +197,7 @@ func (client ProductGroupClient) CreateOrUpdatePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -256,13 +252,11 @@ func (client ProductGroupClient) Delete(ctx context.Context, resourceGroupName s {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: groupID, - Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "groupID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.ProductGroupClient", "Delete", err.Error()) } @@ -297,7 +291,7 @@ func (client ProductGroupClient) DeletePreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -333,12 +327,9 @@ func (client ProductGroupClient) DeleteResponder(resp *http.Response) (result au // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // productID - product identifier. Must be unique in the current API Management service instance. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | type | eq, ne | N/A | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | |
| displayName | filter | eq, ne | |
| description | filter | eq, ne | |
// top - number of records to return. // skip - number of records to skip. func (client ProductGroupClient) ListByProduct(ctx context.Context, resourceGroupName string, serviceName string, productID string, filter string, top *int32, skip *int32) (result GroupCollectionPage, err error) { @@ -358,9 +349,8 @@ func (client ProductGroupClient) ListByProduct(ctx context.Context, resourceGrou {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, @@ -401,7 +391,7 @@ func (client ProductGroupClient) ListByProductPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/productpolicy.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/productpolicy.go similarity index 94% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/productpolicy.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/productpolicy.go index 619b9c1859a6..662b26a98f75 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/productpolicy.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/productpolicy.go @@ -66,12 +66,11 @@ func (client ProductPolicyClient) CreateOrUpdate(ctx context.Context, resourceGr {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.PolicyContractProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.PolicyContractProperties.PolicyContent", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + Chain: []validation.Constraint{{Target: "parameters.PolicyContractProperties.Value", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { return result, validation.NewError("apimanagement.ProductPolicyClient", "CreateOrUpdate", err.Error()) } @@ -106,7 +105,7 @@ func (client ProductPolicyClient) CreateOrUpdatePreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -168,9 +167,8 @@ func (client ProductPolicyClient) Delete(ctx context.Context, resourceGroupName {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.ProductPolicyClient", "Delete", err.Error()) } @@ -205,7 +203,7 @@ func (client ProductPolicyClient) DeletePreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -242,7 +240,8 @@ func (client ProductPolicyClient) DeleteResponder(resp *http.Response) (result a // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // productID - product identifier. Must be unique in the current API Management service instance. -func (client ProductPolicyClient) Get(ctx context.Context, resourceGroupName string, serviceName string, productID string) (result PolicyContract, err error) { +// formatParameter - policy Export Format. +func (client ProductPolicyClient) Get(ctx context.Context, resourceGroupName string, serviceName string, productID string, formatParameter PolicyExportFormat) (result PolicyContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ProductPolicyClient.Get") defer func() { @@ -259,13 +258,12 @@ func (client ProductPolicyClient) Get(ctx context.Context, resourceGroupName str {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.ProductPolicyClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, productID) + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, productID, formatParameter) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.ProductPolicyClient", "Get", nil, "Failure preparing request") return @@ -287,7 +285,7 @@ func (client ProductPolicyClient) Get(ctx context.Context, resourceGroupName str } // GetPreparer prepares the Get request. -func (client ProductPolicyClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, productID string) (*http.Request, error) { +func (client ProductPolicyClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, productID string, formatParameter PolicyExportFormat) (*http.Request, error) { pathParameters := map[string]interface{}{ "policyId": autorest.Encode("path", "policy"), "productId": autorest.Encode("path", productID), @@ -296,10 +294,15 @@ func (client ProductPolicyClient) GetPreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if len(string(formatParameter)) > 0 { + queryParameters["format"] = autorest.Encode("query", formatParameter) + } else { + queryParameters["format"] = autorest.Encode("query", "xml") + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -350,9 +353,8 @@ func (client ProductPolicyClient) GetEntityTag(ctx context.Context, resourceGrou {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.ProductPolicyClient", "GetEntityTag", err.Error()) } @@ -387,7 +389,7 @@ func (client ProductPolicyClient) GetEntityTagPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -440,9 +442,8 @@ func (client ProductPolicyClient) ListByProduct(ctx context.Context, resourceGro {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.ProductPolicyClient", "ListByProduct", err.Error()) } @@ -476,7 +477,7 @@ func (client ProductPolicyClient) ListByProductPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/productsubscriptions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/productsubscriptions.go similarity index 88% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/productsubscriptions.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/productsubscriptions.go index c3a05795f4f3..5b16d7c2b819 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/productsubscriptions.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/productsubscriptions.go @@ -48,14 +48,15 @@ func NewProductSubscriptionsClientWithBaseURI(baseURI string, subscriptionID str // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // productID - product identifier. Must be unique in the current API Management service instance. -// filter - | Field | Supported operators | Supported functions | -// |--------------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | stateComment | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | userId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | productId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | state | eq | | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| stateComment | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| ownerId | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| scope | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
| userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, +// startswith, endswith |
| productId | filter | ge, le, eq, ne, gt, lt | substringof, contains, +// startswith, endswith |
| state | filter | eq | |
| user | expand | | |
// top - number of records to return. // skip - number of records to skip. func (client ProductSubscriptionsClient) List(ctx context.Context, resourceGroupName string, serviceName string, productID string, filter string, top *int32, skip *int32) (result SubscriptionCollectionPage, err error) { @@ -75,9 +76,8 @@ func (client ProductSubscriptionsClient) List(ctx context.Context, resourceGroup {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, @@ -118,7 +118,7 @@ func (client ProductSubscriptionsClient) ListPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/quotabycounterkeys.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/quotabycounterkeys.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/quotabycounterkeys.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/quotabycounterkeys.go index a76f3cfd5e68..4574daf7fac1 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/quotabycounterkeys.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/quotabycounterkeys.go @@ -101,7 +101,7 @@ func (client QuotaByCounterKeysClient) ListByServicePreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -192,7 +192,7 @@ func (client QuotaByCounterKeysClient) UpdatePreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/quotabyperiodkeys.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/quotabyperiodkeys.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/quotabyperiodkeys.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/quotabyperiodkeys.go index 298294eb08cc..aa010661566f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/quotabyperiodkeys.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/quotabyperiodkeys.go @@ -103,7 +103,7 @@ func (client QuotaByPeriodKeysClient) GetPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -195,7 +195,7 @@ func (client QuotaByPeriodKeysClient) UpdatePreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/regions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/region.go similarity index 66% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/regions.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/region.go index 04e737c72de3..59802c723495 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/regions.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/region.go @@ -26,29 +26,29 @@ import ( "net/http" ) -// RegionsClient is the apiManagement Client -type RegionsClient struct { +// RegionClient is the apiManagement Client +type RegionClient struct { BaseClient } -// NewRegionsClient creates an instance of the RegionsClient client. -func NewRegionsClient(subscriptionID string) RegionsClient { - return NewRegionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewRegionClient creates an instance of the RegionClient client. +func NewRegionClient(subscriptionID string) RegionClient { + return NewRegionClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewRegionsClientWithBaseURI creates an instance of the RegionsClient client using a custom endpoint. Use this when +// NewRegionClientWithBaseURI creates an instance of the RegionClient client using a custom endpoint. Use this when // interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewRegionsClientWithBaseURI(baseURI string, subscriptionID string) RegionsClient { - return RegionsClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewRegionClientWithBaseURI(baseURI string, subscriptionID string) RegionClient { + return RegionClient{NewWithBaseURI(baseURI, subscriptionID)} } // ListByService lists all azure regions in which the service exists. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -func (client RegionsClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string) (result RegionListResultPage, err error) { +func (client RegionClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string) (result RegionListResultPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RegionsClient.ListByService") + ctx = tracing.StartSpan(ctx, fqdn+"/RegionClient.ListByService") defer func() { sc := -1 if result.rlr.Response.Response != nil { @@ -62,40 +62,40 @@ func (client RegionsClient) ListByService(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("apimanagement.RegionsClient", "ListByService", err.Error()) + return result, validation.NewError("apimanagement.RegionClient", "ListByService", err.Error()) } result.fn = client.listByServiceNextResults req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.RegionsClient", "ListByService", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "apimanagement.RegionClient", "ListByService", nil, "Failure preparing request") return } resp, err := client.ListByServiceSender(req) if err != nil { result.rlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "apimanagement.RegionsClient", "ListByService", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "apimanagement.RegionClient", "ListByService", resp, "Failure sending request") return } result.rlr, err = client.ListByServiceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.RegionsClient", "ListByService", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "apimanagement.RegionClient", "ListByService", resp, "Failure responding to request") } return } // ListByServicePreparer prepares the ListByService request. -func (client RegionsClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { +func (client RegionClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -110,13 +110,13 @@ func (client RegionsClient) ListByServicePreparer(ctx context.Context, resourceG // ListByServiceSender sends the ListByService request. The method will close the // http.Response Body if it receives an error. -func (client RegionsClient) ListByServiceSender(req *http.Request) (*http.Response, error) { +func (client RegionClient) ListByServiceSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByServiceResponder handles the response to the ListByService request. The method always // closes the http.Response Body. -func (client RegionsClient) ListByServiceResponder(resp *http.Response) (result RegionListResult, err error) { +func (client RegionClient) ListByServiceResponder(resp *http.Response) (result RegionListResult, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -128,10 +128,10 @@ func (client RegionsClient) ListByServiceResponder(resp *http.Response) (result } // listByServiceNextResults retrieves the next set of results, if any. -func (client RegionsClient) listByServiceNextResults(ctx context.Context, lastResults RegionListResult) (result RegionListResult, err error) { +func (client RegionClient) listByServiceNextResults(ctx context.Context, lastResults RegionListResult) (result RegionListResult, err error) { req, err := lastResults.regionListResultPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "apimanagement.RegionsClient", "listByServiceNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "apimanagement.RegionClient", "listByServiceNextResults", nil, "Failure preparing next results request") } if req == nil { return @@ -139,19 +139,19 @@ func (client RegionsClient) listByServiceNextResults(ctx context.Context, lastRe resp, err := client.ListByServiceSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "apimanagement.RegionsClient", "listByServiceNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "apimanagement.RegionClient", "listByServiceNextResults", resp, "Failure sending next results request") } result, err = client.ListByServiceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.RegionsClient", "listByServiceNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "apimanagement.RegionClient", "listByServiceNextResults", resp, "Failure responding to next results request") } return } // ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. -func (client RegionsClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string) (result RegionListResultIterator, err error) { +func (client RegionClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string) (result RegionListResultIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RegionsClient.ListByService") + ctx = tracing.StartSpan(ctx, fqdn+"/RegionClient.ListByService") defer func() { sc := -1 if result.Response().Response.Response != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/reports.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/reports.go similarity index 81% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/reports.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/reports.go index 87dc96743996..3ae3a62d3b24 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/reports.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/reports.go @@ -49,7 +49,8 @@ func NewReportsClientWithBaseURI(baseURI string, subscriptionID string) ReportsC // filter - the filter to apply on the operation. // top - number of records to return. // skip - number of records to skip. -func (client ReportsClient) ListByAPI(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result ReportCollectionPage, err error) { +// orderby - oData order by query option. +func (client ReportsClient) ListByAPI(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, orderby string) (result ReportCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ReportsClient.ListByAPI") defer func() { @@ -75,7 +76,7 @@ func (client ReportsClient) ListByAPI(ctx context.Context, resourceGroupName str } result.fn = client.listByAPINextResults - req, err := client.ListByAPIPreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + req, err := client.ListByAPIPreparer(ctx, resourceGroupName, serviceName, filter, top, skip, orderby) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListByAPI", nil, "Failure preparing request") return @@ -97,14 +98,14 @@ func (client ReportsClient) ListByAPI(ctx context.Context, resourceGroupName str } // ListByAPIPreparer prepares the ListByAPI request. -func (client ReportsClient) ListByAPIPreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { +func (client ReportsClient) ListByAPIPreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, orderby string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "$filter": autorest.Encode("query", filter), "api-version": APIVersion, @@ -115,6 +116,9 @@ func (client ReportsClient) ListByAPIPreparer(ctx context.Context, resourceGroup if skip != nil { queryParameters["$skip"] = autorest.Encode("query", *skip) } + if len(orderby) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderby) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -165,7 +169,7 @@ func (client ReportsClient) listByAPINextResults(ctx context.Context, lastResult } // ListByAPIComplete enumerates all values, automatically crossing page boundaries as required. -func (client ReportsClient) ListByAPIComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result ReportCollectionIterator, err error) { +func (client ReportsClient) ListByAPIComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, orderby string) (result ReportCollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ReportsClient.ListByAPI") defer func() { @@ -176,7 +180,7 @@ func (client ReportsClient) ListByAPIComplete(ctx context.Context, resourceGroup tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByAPI(ctx, resourceGroupName, serviceName, filter, top, skip) + result.page, err = client.ListByAPI(ctx, resourceGroupName, serviceName, filter, top, skip, orderby) return } @@ -184,7 +188,17 @@ func (client ReportsClient) ListByAPIComplete(ctx context.Context, resourceGroup // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - the filter to apply on the operation. +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| timestamp | filter | ge, le | | +//
| country | select | | |
| region | select | | |
| zip | select | | | +//
| apiRegion | filter | eq | |
| userId | filter | eq | |
| productId | filter | eq | +// |
| subscriptionId | filter | eq | |
| apiId | filter | eq | |
| operationId | filter +// | eq | |
| callCountSuccess | select | | |
| callCountBlocked | select | | | +//
| callCountFailed | select | | |
| callCountOther | select | | |
| bandwidth +// | select, orderBy | | |
| cacheHitsCount | select | | |
| cacheMissCount | select +// | | |
| apiTimeAvg | select | | |
| apiTimeMin | select | | |
| +// apiTimeMax | select | | |
| serviceTimeAvg | select | | |
| serviceTimeMin | +// select | | |
| serviceTimeMax | select | | |
// top - number of records to return. // skip - number of records to skip. func (client ReportsClient) ListByGeo(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result ReportCollectionPage, err error) { @@ -242,13 +256,11 @@ func (client ReportsClient) ListByGeoPreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), "api-version": APIVersion, } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } if top != nil { queryParameters["$top"] = autorest.Encode("query", *top) } @@ -324,10 +336,22 @@ func (client ReportsClient) ListByGeoComplete(ctx context.Context, resourceGroup // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - the filter to apply on the operation. +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| timestamp | filter | ge, le | | +//
| displayName | select, orderBy | | |
| apiRegion | filter | eq | |
| userId | +// filter | eq | |
| productId | filter | eq | |
| subscriptionId | filter | eq | | +//
| apiId | filter | eq | |
| operationId | select, filter | eq | |
| callCountSuccess +// | select, orderBy | | |
| callCountBlocked | select, orderBy | | |
| +// callCountFailed | select, orderBy | | |
| callCountOther | select, orderBy | | |
| +// callCountTotal | select, orderBy | | |
| bandwidth | select, orderBy | | |
| +// cacheHitsCount | select | | |
| cacheMissCount | select | | |
| apiTimeAvg | +// select, orderBy | | |
| apiTimeMin | select | | |
| apiTimeMax | select | | +// |
| serviceTimeAvg | select | | |
| serviceTimeMin | select | | |
| +// serviceTimeMax | select | | |
// top - number of records to return. // skip - number of records to skip. -func (client ReportsClient) ListByOperation(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result ReportCollectionPage, err error) { +// orderby - oData order by query option. +func (client ReportsClient) ListByOperation(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, orderby string) (result ReportCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ReportsClient.ListByOperation") defer func() { @@ -353,7 +377,7 @@ func (client ReportsClient) ListByOperation(ctx context.Context, resourceGroupNa } result.fn = client.listByOperationNextResults - req, err := client.ListByOperationPreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + req, err := client.ListByOperationPreparer(ctx, resourceGroupName, serviceName, filter, top, skip, orderby) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListByOperation", nil, "Failure preparing request") return @@ -375,14 +399,14 @@ func (client ReportsClient) ListByOperation(ctx context.Context, resourceGroupNa } // ListByOperationPreparer prepares the ListByOperation request. -func (client ReportsClient) ListByOperationPreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { +func (client ReportsClient) ListByOperationPreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, orderby string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "$filter": autorest.Encode("query", filter), "api-version": APIVersion, @@ -393,6 +417,9 @@ func (client ReportsClient) ListByOperationPreparer(ctx context.Context, resourc if skip != nil { queryParameters["$skip"] = autorest.Encode("query", *skip) } + if len(orderby) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderby) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -443,7 +470,7 @@ func (client ReportsClient) listByOperationNextResults(ctx context.Context, last } // ListByOperationComplete enumerates all values, automatically crossing page boundaries as required. -func (client ReportsClient) ListByOperationComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result ReportCollectionIterator, err error) { +func (client ReportsClient) ListByOperationComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, orderby string) (result ReportCollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ReportsClient.ListByOperation") defer func() { @@ -454,7 +481,7 @@ func (client ReportsClient) ListByOperationComplete(ctx context.Context, resourc tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByOperation(ctx, resourceGroupName, serviceName, filter, top, skip) + result.page, err = client.ListByOperation(ctx, resourceGroupName, serviceName, filter, top, skip, orderby) return } @@ -462,10 +489,21 @@ func (client ReportsClient) ListByOperationComplete(ctx context.Context, resourc // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - the filter to apply on the operation. +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| timestamp | filter | ge, le | | +//
| displayName | select, orderBy | | |
| apiRegion | filter | eq | |
| userId | +// filter | eq | |
| productId | select, filter | eq | |
| subscriptionId | filter | eq | +// |
| callCountSuccess | select, orderBy | | |
| callCountBlocked | select, orderBy | | +// |
| callCountFailed | select, orderBy | | |
| callCountOther | select, orderBy | | +// |
| callCountTotal | select, orderBy | | |
| bandwidth | select, orderBy | | | +//
| cacheHitsCount | select | | |
| cacheMissCount | select | | |
| apiTimeAvg +// | select, orderBy | | |
| apiTimeMin | select | | |
| apiTimeMax | select | | +// |
| serviceTimeAvg | select | | |
| serviceTimeMin | select | | |
| +// serviceTimeMax | select | | |
// top - number of records to return. // skip - number of records to skip. -func (client ReportsClient) ListByProduct(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result ReportCollectionPage, err error) { +// orderby - oData order by query option. +func (client ReportsClient) ListByProduct(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, orderby string) (result ReportCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ReportsClient.ListByProduct") defer func() { @@ -491,7 +529,7 @@ func (client ReportsClient) ListByProduct(ctx context.Context, resourceGroupName } result.fn = client.listByProductNextResults - req, err := client.ListByProductPreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + req, err := client.ListByProductPreparer(ctx, resourceGroupName, serviceName, filter, top, skip, orderby) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListByProduct", nil, "Failure preparing request") return @@ -513,14 +551,14 @@ func (client ReportsClient) ListByProduct(ctx context.Context, resourceGroupName } // ListByProductPreparer prepares the ListByProduct request. -func (client ReportsClient) ListByProductPreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { +func (client ReportsClient) ListByProductPreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, orderby string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "$filter": autorest.Encode("query", filter), "api-version": APIVersion, @@ -531,6 +569,9 @@ func (client ReportsClient) ListByProductPreparer(ctx context.Context, resourceG if skip != nil { queryParameters["$skip"] = autorest.Encode("query", *skip) } + if len(orderby) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderby) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -581,7 +622,7 @@ func (client ReportsClient) listByProductNextResults(ctx context.Context, lastRe } // ListByProductComplete enumerates all values, automatically crossing page boundaries as required. -func (client ReportsClient) ListByProductComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result ReportCollectionIterator, err error) { +func (client ReportsClient) ListByProductComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, orderby string) (result ReportCollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ReportsClient.ListByProduct") defer func() { @@ -592,7 +633,7 @@ func (client ReportsClient) ListByProductComplete(ctx context.Context, resourceG tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByProduct(ctx, resourceGroupName, serviceName, filter, top, skip) + result.page, err = client.ListByProduct(ctx, resourceGroupName, serviceName, filter, top, skip, orderby) return } @@ -600,7 +641,11 @@ func (client ReportsClient) ListByProductComplete(ctx context.Context, resourceG // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - the filter to apply on the operation. +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| timestamp | filter | ge, le | | +//
| apiId | filter | eq | |
| operationId | filter | eq | |
| productId | filter | eq | +// |
| userId | filter | eq | |
| apiRegion | filter | eq | |
| subscriptionId | filter +// | eq | |
// top - number of records to return. // skip - number of records to skip. func (client ReportsClient) ListByRequest(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result RequestReportCollection, err error) { @@ -657,7 +702,7 @@ func (client ReportsClient) ListByRequestPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "$filter": autorest.Encode("query", filter), "api-version": APIVersion, @@ -700,10 +745,21 @@ func (client ReportsClient) ListByRequestResponder(resp *http.Response) (result // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - the filter to apply on the operation. +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| timestamp | filter | ge, le | | +//
| displayName | select, orderBy | | |
| apiRegion | filter | eq | |
| userId | +// select, filter | eq | |
| productId | select, filter | eq | |
| subscriptionId | select, +// filter | eq | |
| callCountSuccess | select, orderBy | | |
| callCountBlocked | +// select, orderBy | | |
| callCountFailed | select, orderBy | | |
| callCountOther | +// select, orderBy | | |
| callCountTotal | select, orderBy | | |
| bandwidth | +// select, orderBy | | |
| cacheHitsCount | select | | |
| cacheMissCount | select | +// | |
| apiTimeAvg | select, orderBy | | |
| apiTimeMin | select | | |
| +// apiTimeMax | select | | |
| serviceTimeAvg | select | | |
| serviceTimeMin | +// select | | |
| serviceTimeMax | select | | |
// top - number of records to return. // skip - number of records to skip. -func (client ReportsClient) ListBySubscription(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result ReportCollectionPage, err error) { +// orderby - oData order by query option. +func (client ReportsClient) ListBySubscription(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, orderby string) (result ReportCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ReportsClient.ListBySubscription") defer func() { @@ -729,7 +785,7 @@ func (client ReportsClient) ListBySubscription(ctx context.Context, resourceGrou } result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + req, err := client.ListBySubscriptionPreparer(ctx, resourceGroupName, serviceName, filter, top, skip, orderby) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListBySubscription", nil, "Failure preparing request") return @@ -751,26 +807,27 @@ func (client ReportsClient) ListBySubscription(ctx context.Context, resourceGrou } // ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client ReportsClient) ListBySubscriptionPreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { +func (client ReportsClient) ListBySubscriptionPreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, orderby string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), "api-version": APIVersion, } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } if top != nil { queryParameters["$top"] = autorest.Encode("query", *top) } if skip != nil { queryParameters["$skip"] = autorest.Encode("query", *skip) } + if len(orderby) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderby) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -821,7 +878,7 @@ func (client ReportsClient) listBySubscriptionNextResults(ctx context.Context, l } // ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client ReportsClient) ListBySubscriptionComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result ReportCollectionIterator, err error) { +func (client ReportsClient) ListBySubscriptionComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, orderby string) (result ReportCollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ReportsClient.ListBySubscription") defer func() { @@ -832,7 +889,7 @@ func (client ReportsClient) ListBySubscriptionComplete(ctx context.Context, reso tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListBySubscription(ctx, resourceGroupName, serviceName, filter, top, skip) + result.page, err = client.ListBySubscription(ctx, resourceGroupName, serviceName, filter, top, skip, orderby) return } @@ -840,13 +897,24 @@ func (client ReportsClient) ListBySubscriptionComplete(ctx context.Context, reso // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| timestamp | filter, select | ge, le | +// |
| interval | select | | |
| apiRegion | filter | eq | |
| userId | filter | eq +// | |
| productId | filter | eq | |
| subscriptionId | filter | eq | |
| apiId | +// filter | eq | |
| operationId | filter | eq | |
| callCountSuccess | select | | | +//
| callCountBlocked | select | | |
| callCountFailed | select | | |
| +// callCountOther | select | | |
| bandwidth | select, orderBy | | |
| cacheHitsCount +// | select | | |
| cacheMissCount | select | | |
| apiTimeAvg | select | | | +//
| apiTimeMin | select | | |
| apiTimeMax | select | | |
| serviceTimeAvg | +// select | | |
| serviceTimeMin | select | | |
| serviceTimeMax | select | | +// |
// interval - by time interval. 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).This code can be used to convert -// TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)) -// filter - the filter to apply on the operation. +// TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)). // top - number of records to return. // skip - number of records to skip. -func (client ReportsClient) ListByTime(ctx context.Context, resourceGroupName string, serviceName string, interval string, filter string, top *int32, skip *int32) (result ReportCollectionPage, err error) { +// orderby - oData order by query option. +func (client ReportsClient) ListByTime(ctx context.Context, resourceGroupName string, serviceName string, filter string, interval string, top *int32, skip *int32, orderby string) (result ReportCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ReportsClient.ListByTime") defer func() { @@ -872,7 +940,7 @@ func (client ReportsClient) ListByTime(ctx context.Context, resourceGroupName st } result.fn = client.listByTimeNextResults - req, err := client.ListByTimePreparer(ctx, resourceGroupName, serviceName, interval, filter, top, skip) + req, err := client.ListByTimePreparer(ctx, resourceGroupName, serviceName, filter, interval, top, skip, orderby) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListByTime", nil, "Failure preparing request") return @@ -894,27 +962,28 @@ func (client ReportsClient) ListByTime(ctx context.Context, resourceGroupName st } // ListByTimePreparer prepares the ListByTime request. -func (client ReportsClient) ListByTimePreparer(ctx context.Context, resourceGroupName string, serviceName string, interval string, filter string, top *int32, skip *int32) (*http.Request, error) { +func (client ReportsClient) ListByTimePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, interval string, top *int32, skip *int32, orderby string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), "api-version": APIVersion, "interval": autorest.Encode("query", interval), } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } if top != nil { queryParameters["$top"] = autorest.Encode("query", *top) } if skip != nil { queryParameters["$skip"] = autorest.Encode("query", *skip) } + if len(orderby) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderby) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -965,7 +1034,7 @@ func (client ReportsClient) listByTimeNextResults(ctx context.Context, lastResul } // ListByTimeComplete enumerates all values, automatically crossing page boundaries as required. -func (client ReportsClient) ListByTimeComplete(ctx context.Context, resourceGroupName string, serviceName string, interval string, filter string, top *int32, skip *int32) (result ReportCollectionIterator, err error) { +func (client ReportsClient) ListByTimeComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, interval string, top *int32, skip *int32, orderby string) (result ReportCollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ReportsClient.ListByTime") defer func() { @@ -976,7 +1045,7 @@ func (client ReportsClient) ListByTimeComplete(ctx context.Context, resourceGrou tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByTime(ctx, resourceGroupName, serviceName, interval, filter, top, skip) + result.page, err = client.ListByTime(ctx, resourceGroupName, serviceName, filter, interval, top, skip, orderby) return } @@ -984,10 +1053,22 @@ func (client ReportsClient) ListByTimeComplete(ctx context.Context, resourceGrou // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - the filter to apply on the operation. +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| timestamp | filter | ge, le | | +//
| displayName | select, orderBy | | |
| userId | select, filter | eq | |
| +// apiRegion | filter | eq | |
| productId | filter | eq | |
| subscriptionId | filter | eq | +// |
| apiId | filter | eq | |
| operationId | filter | eq | |
| callCountSuccess | +// select, orderBy | | |
| callCountBlocked | select, orderBy | | |
| callCountFailed +// | select, orderBy | | |
| callCountOther | select, orderBy | | |
| callCountTotal +// | select, orderBy | | |
| bandwidth | select, orderBy | | |
| cacheHitsCount | +// select | | |
| cacheMissCount | select | | |
| apiTimeAvg | select, orderBy | +// | |
| apiTimeMin | select | | |
| apiTimeMax | select | | |
| +// serviceTimeAvg | select | | |
| serviceTimeMin | select | | |
| serviceTimeMax | +// select | | |
// top - number of records to return. // skip - number of records to skip. -func (client ReportsClient) ListByUser(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result ReportCollectionPage, err error) { +// orderby - oData order by query option. +func (client ReportsClient) ListByUser(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, orderby string) (result ReportCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ReportsClient.ListByUser") defer func() { @@ -1013,7 +1094,7 @@ func (client ReportsClient) ListByUser(ctx context.Context, resourceGroupName st } result.fn = client.listByUserNextResults - req, err := client.ListByUserPreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + req, err := client.ListByUserPreparer(ctx, resourceGroupName, serviceName, filter, top, skip, orderby) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListByUser", nil, "Failure preparing request") return @@ -1035,14 +1116,14 @@ func (client ReportsClient) ListByUser(ctx context.Context, resourceGroupName st } // ListByUserPreparer prepares the ListByUser request. -func (client ReportsClient) ListByUserPreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { +func (client ReportsClient) ListByUserPreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, orderby string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "$filter": autorest.Encode("query", filter), "api-version": APIVersion, @@ -1053,6 +1134,9 @@ func (client ReportsClient) ListByUserPreparer(ctx context.Context, resourceGrou if skip != nil { queryParameters["$skip"] = autorest.Encode("query", *skip) } + if len(orderby) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderby) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -1103,7 +1187,7 @@ func (client ReportsClient) listByUserNextResults(ctx context.Context, lastResul } // ListByUserComplete enumerates all values, automatically crossing page boundaries as required. -func (client ReportsClient) ListByUserComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result ReportCollectionIterator, err error) { +func (client ReportsClient) ListByUserComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, orderby string) (result ReportCollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ReportsClient.ListByUser") defer func() { @@ -1114,6 +1198,6 @@ func (client ReportsClient) ListByUserComplete(ctx context.Context, resourceGrou tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByUser(ctx, resourceGroupName, serviceName, filter, top, skip) + result.page, err = client.ListByUser(ctx, resourceGroupName, serviceName, filter, top, skip, orderby) return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/service.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/service.go similarity index 82% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/service.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/service.go index 3bbf589f6c0e..dde5f5e9622b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/service.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/service.go @@ -92,7 +92,7 @@ func (client ServiceClient) ApplyNetworkConfigurationUpdatesPreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -188,7 +188,7 @@ func (client ServiceClient) BackupPreparer(ctx context.Context, resourceGroupNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -275,7 +275,7 @@ func (client ServiceClient) CheckNameAvailabilityPreparer(ctx context.Context, p "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -338,9 +338,8 @@ func (client ServiceClient) CreateOrUpdate(ctx context.Context, resourceGroupNam {Target: "parameters.ServiceProperties.PublisherName", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.ServiceProperties.PublisherName", Name: validation.MaxLength, Rule: 100, Chain: nil}}}, }}, - {Target: "parameters.Sku", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Identity", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Identity.Type", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.Sku", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Sku.Capacity", Name: validation.Null, Rule: true, Chain: nil}}}, {Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.ServiceClient", "CreateOrUpdate", err.Error()) } @@ -368,7 +367,7 @@ func (client ServiceClient) CreateOrUpdatePreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -413,13 +412,13 @@ func (client ServiceClient) CreateOrUpdateResponder(resp *http.Response) (result // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -func (client ServiceClient) Delete(ctx context.Context, resourceGroupName string, serviceName string) (result autorest.Response, err error) { +func (client ServiceClient) Delete(ctx context.Context, resourceGroupName string, serviceName string) (result ServiceDeleteFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ServiceClient.Delete") defer func() { sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode + if result.Response() != nil { + sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -438,18 +437,12 @@ func (client ServiceClient) Delete(ctx context.Context, resourceGroupName string return } - resp, err := client.DeleteSender(req) + result, err = client.DeleteSender(req) if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "Delete", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "Delete", result.Response(), "Failure sending request") return } - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "Delete", resp, "Failure responding to request") - } - return } @@ -461,7 +454,7 @@ func (client ServiceClient) DeletePreparer(ctx context.Context, resourceGroupNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -476,19 +469,26 @@ func (client ServiceClient) DeletePreparer(ctx context.Context, resourceGroupNam // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. -func (client ServiceClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +func (client ServiceClient) DeleteSender(req *http.Request) (future ServiceDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return } // DeleteResponder handles the response to the Delete request. The method always // closes the http.Response Body. -func (client ServiceClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { +func (client ServiceClient) DeleteResponder(resp *http.Response) (result ServiceResource, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) - result.Response = resp + result.Response = autorest.Response{Response: resp} return } @@ -544,7 +544,7 @@ func (client ServiceClient) GetPreparer(ctx context.Context, resourceGroupName s "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -628,7 +628,7 @@ func (client ServiceClient) GetSsoTokenPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -700,7 +700,7 @@ func (client ServiceClient) ListPreparer(ctx context.Context) (*http.Request, er "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -812,7 +812,7 @@ func (client ServiceClient) ListByResourceGroupPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -934,7 +934,7 @@ func (client ServiceClient) RestorePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1021,7 +1021,7 @@ func (client ServiceClient) UpdatePreparer(ctx context.Context, resourceGroupNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1061,183 +1061,3 @@ func (client ServiceClient) UpdateResponder(resp *http.Response) (result Service result.Response = autorest.Response{Response: resp} return } - -// UpdateHostname creates, updates, or deletes the custom hostnames for an API Management service. The custom hostname -// can be applied to the Proxy and Portal endpoint. This is a long running operation and could take several minutes to -// complete. This operation will be deprecated in the next version update. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceName - the name of the API Management service. -// parameters - parameters supplied to the UpdateHostname operation. -func (client ServiceClient) UpdateHostname(ctx context.Context, resourceGroupName string, serviceName string, parameters ServiceUpdateHostnameParameters) (result ServiceUpdateHostnameFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceClient.UpdateHostname") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: serviceName, - Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, - {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("apimanagement.ServiceClient", "UpdateHostname", err.Error()) - } - - req, err := client.UpdateHostnamePreparer(ctx, resourceGroupName, serviceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "UpdateHostname", nil, "Failure preparing request") - return - } - - result, err = client.UpdateHostnameSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "UpdateHostname", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdateHostnamePreparer prepares the UpdateHostname request. -func (client ServiceClient) UpdateHostnamePreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters ServiceUpdateHostnameParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-01-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/updatehostname", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateHostnameSender sends the UpdateHostname request. The method will close the -// http.Response Body if it receives an error. -func (client ServiceClient) UpdateHostnameSender(req *http.Request) (future ServiceUpdateHostnameFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - future.Future, err = azure.NewFutureFromResponse(resp) - return -} - -// UpdateHostnameResponder handles the response to the UpdateHostname request. The method always -// closes the http.Response Body. -func (client ServiceClient) UpdateHostnameResponder(resp *http.Response) (result ServiceResource, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// UploadCertificate upload Custom Domain SSL certificate for an API Management service. This operation will be -// deprecated in future releases. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceName - the name of the API Management service. -// parameters - parameters supplied to the Upload SSL certificate for an API Management service operation. -func (client ServiceClient) UploadCertificate(ctx context.Context, resourceGroupName string, serviceName string, parameters ServiceUploadCertificateParameters) (result CertificateInformation, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceClient.UploadCertificate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: serviceName, - Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, - {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Certificate", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.CertificatePassword", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("apimanagement.ServiceClient", "UploadCertificate", err.Error()) - } - - req, err := client.UploadCertificatePreparer(ctx, resourceGroupName, serviceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "UploadCertificate", nil, "Failure preparing request") - return - } - - resp, err := client.UploadCertificateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "UploadCertificate", resp, "Failure sending request") - return - } - - result, err = client.UploadCertificateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "UploadCertificate", resp, "Failure responding to request") - } - - return -} - -// UploadCertificatePreparer prepares the UploadCertificate request. -func (client ServiceClient) UploadCertificatePreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters ServiceUploadCertificateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-01-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/updatecertificate", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UploadCertificateSender sends the UploadCertificate request. The method will close the -// http.Response Body if it receives an error. -func (client ServiceClient) UploadCertificateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UploadCertificateResponder handles the response to the UploadCertificate request. The method always -// closes the http.Response Body. -func (client ServiceClient) UploadCertificateResponder(resp *http.Response) (result CertificateInformation, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/serviceskus.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/serviceskus.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/serviceskus.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/serviceskus.go index 6b3540f383c2..c3c17473b5db 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/serviceskus.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/serviceskus.go @@ -95,7 +95,7 @@ func (client ServiceSkusClient) ListAvailableServiceSkusPreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/signinsettings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/signinsettings.go similarity index 96% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/signinsettings.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/signinsettings.go index 931c31185682..cf617ede92b3 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/signinsettings.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/signinsettings.go @@ -47,7 +47,8 @@ func NewSignInSettingsClientWithBaseURI(baseURI string, subscriptionID string) S // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // parameters - create or update parameters. -func (client SignInSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalSigninSettings) (result PortalSigninSettings, err error) { +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client SignInSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalSigninSettings, ifMatch string) (result PortalSigninSettings, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SignInSettingsClient.CreateOrUpdate") defer func() { @@ -66,7 +67,7 @@ func (client SignInSettingsClient) CreateOrUpdate(ctx context.Context, resourceG return result, validation.NewError("apimanagement.SignInSettingsClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, parameters) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, parameters, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.SignInSettingsClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -88,14 +89,14 @@ func (client SignInSettingsClient) CreateOrUpdate(ctx context.Context, resourceG } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client SignInSettingsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalSigninSettings) (*http.Request, error) { +func (client SignInSettingsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalSigninSettings, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -107,6 +108,10 @@ func (client SignInSettingsClient) CreateOrUpdatePreparer(ctx context.Context, r autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -129,7 +134,7 @@ func (client SignInSettingsClient) CreateOrUpdateResponder(resp *http.Response) return } -// Get get Sign-In settings. +// Get get Sign In Settings for the Portal // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. @@ -181,7 +186,7 @@ func (client SignInSettingsClient) GetPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -265,7 +270,7 @@ func (client SignInSettingsClient) GetEntityTagPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -351,7 +356,7 @@ func (client SignInSettingsClient) UpdatePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/signupsettings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/signupsettings.go similarity index 96% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/signupsettings.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/signupsettings.go index 94f5f7009f76..68fbe636935d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/signupsettings.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/signupsettings.go @@ -47,7 +47,8 @@ func NewSignUpSettingsClientWithBaseURI(baseURI string, subscriptionID string) S // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // parameters - create or update parameters. -func (client SignUpSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalSignupSettings) (result PortalSignupSettings, err error) { +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client SignUpSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalSignupSettings, ifMatch string) (result PortalSignupSettings, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SignUpSettingsClient.CreateOrUpdate") defer func() { @@ -66,7 +67,7 @@ func (client SignUpSettingsClient) CreateOrUpdate(ctx context.Context, resourceG return result, validation.NewError("apimanagement.SignUpSettingsClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, parameters) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, parameters, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.SignUpSettingsClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -88,14 +89,14 @@ func (client SignUpSettingsClient) CreateOrUpdate(ctx context.Context, resourceG } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client SignUpSettingsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalSignupSettings) (*http.Request, error) { +func (client SignUpSettingsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalSignupSettings, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -107,6 +108,10 @@ func (client SignUpSettingsClient) CreateOrUpdatePreparer(ctx context.Context, r autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -129,7 +134,7 @@ func (client SignUpSettingsClient) CreateOrUpdateResponder(resp *http.Response) return } -// Get get Sign-Up settings. +// Get get Sign Up Settings for the Portal // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. @@ -181,7 +186,7 @@ func (client SignUpSettingsClient) GetPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -265,7 +270,7 @@ func (client SignUpSettingsClient) GetEntityTagPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -351,7 +356,7 @@ func (client SignUpSettingsClient) UpdatePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/subscription.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/subscription.go similarity index 85% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/subscription.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/subscription.go index 08ef61b82217..f026e7eef3ef 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/subscription.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/subscription.go @@ -70,12 +70,11 @@ func (client SubscriptionClient) CreateOrUpdate(ctx context.Context, resourceGro {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: sid, - Constraints: []validation.Constraint{{Target: "sid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "sid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "sid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "sid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.SubscriptionCreateParameterProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.SubscriptionCreateParameterProperties.UserID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.SubscriptionCreateParameterProperties.ProductID", Name: validation.Null, Rule: true, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.SubscriptionCreateParameterProperties.Scope", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.SubscriptionCreateParameterProperties.DisplayName", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.SubscriptionCreateParameterProperties.DisplayName", Name: validation.MaxLength, Rule: 100, Chain: nil}, {Target: "parameters.SubscriptionCreateParameterProperties.DisplayName", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -122,7 +121,7 @@ func (client SubscriptionClient) CreateOrUpdatePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -188,8 +187,8 @@ func (client SubscriptionClient) Delete(ctx context.Context, resourceGroupName s {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: sid, - Constraints: []validation.Constraint{{Target: "sid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "sid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "sid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "sid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.SubscriptionClient", "Delete", err.Error()) } @@ -223,7 +222,7 @@ func (client SubscriptionClient) DeletePreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -278,8 +277,8 @@ func (client SubscriptionClient) Get(ctx context.Context, resourceGroupName stri {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: sid, - Constraints: []validation.Constraint{{Target: "sid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "sid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "sid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "sid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.SubscriptionClient", "Get", err.Error()) } @@ -313,7 +312,7 @@ func (client SubscriptionClient) GetPreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -368,8 +367,8 @@ func (client SubscriptionClient) GetEntityTag(ctx context.Context, resourceGroup {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: sid, - Constraints: []validation.Constraint{{Target: "sid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "sid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "sid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "sid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.SubscriptionClient", "GetEntityTag", err.Error()) } @@ -403,7 +402,7 @@ func (client SubscriptionClient) GetEntityTagPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -438,14 +437,15 @@ func (client SubscriptionClient) GetEntityTagResponder(resp *http.Response) (res // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - | Field | Supported operators | Supported functions | -// |--------------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | stateComment | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | userId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | productId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | state | eq | | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| stateComment | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| ownerId | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| scope | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
| userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, +// startswith, endswith |
| productId | filter | ge, le, eq, ne, gt, lt | substringof, contains, +// startswith, endswith |
| state | filter | eq | |
| user | expand | | |
// top - number of records to return. // skip - number of records to skip. func (client SubscriptionClient) List(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result SubscriptionCollectionPage, err error) { @@ -503,7 +503,7 @@ func (client SubscriptionClient) ListPreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -581,6 +581,96 @@ func (client SubscriptionClient) ListComplete(ctx context.Context, resourceGroup return } +// ListSecrets gets the subscription keys. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// sid - subscription entity Identifier. The entity represents the association between a user and a product in +// API Management. +func (client SubscriptionClient) ListSecrets(ctx context.Context, resourceGroupName string, serviceName string, sid string) (result SubscriptionKeysContract, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionClient.ListSecrets") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: sid, + Constraints: []validation.Constraint{{Target: "sid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "sid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.SubscriptionClient", "ListSecrets", err.Error()) + } + + req, err := client.ListSecretsPreparer(ctx, resourceGroupName, serviceName, sid) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.SubscriptionClient", "ListSecrets", nil, "Failure preparing request") + return + } + + resp, err := client.ListSecretsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.SubscriptionClient", "ListSecrets", resp, "Failure sending request") + return + } + + result, err = client.ListSecretsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.SubscriptionClient", "ListSecrets", resp, "Failure responding to request") + } + + return +} + +// ListSecretsPreparer prepares the ListSecrets request. +func (client SubscriptionClient) ListSecretsPreparer(ctx context.Context, resourceGroupName string, serviceName string, sid string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "sid": autorest.Encode("path", sid), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}/listSecrets", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSecretsSender sends the ListSecrets request. The method will close the +// http.Response Body if it receives an error. +func (client SubscriptionClient) ListSecretsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSecretsResponder handles the response to the ListSecrets request. The method always +// closes the http.Response Body. +func (client SubscriptionClient) ListSecretsResponder(resp *http.Response) (result SubscriptionKeysContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // RegeneratePrimaryKey regenerates primary key of existing subscription of the API Management service instance. // Parameters: // resourceGroupName - the name of the resource group. @@ -604,8 +694,8 @@ func (client SubscriptionClient) RegeneratePrimaryKey(ctx context.Context, resou {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: sid, - Constraints: []validation.Constraint{{Target: "sid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "sid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "sid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "sid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.SubscriptionClient", "RegeneratePrimaryKey", err.Error()) } @@ -639,7 +729,7 @@ func (client SubscriptionClient) RegeneratePrimaryKeyPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -693,8 +783,8 @@ func (client SubscriptionClient) RegenerateSecondaryKey(ctx context.Context, res {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: sid, - Constraints: []validation.Constraint{{Target: "sid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "sid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "sid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "sid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.SubscriptionClient", "RegenerateSecondaryKey", err.Error()) } @@ -728,7 +818,7 @@ func (client SubscriptionClient) RegenerateSecondaryKeyPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -788,8 +878,8 @@ func (client SubscriptionClient) Update(ctx context.Context, resourceGroupName s {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: sid, - Constraints: []validation.Constraint{{Target: "sid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "sid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "sid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "sid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.SubscriptionClient", "Update", err.Error()) } @@ -823,7 +913,7 @@ func (client SubscriptionClient) UpdatePreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/tag.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/tag.go similarity index 92% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/tag.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/tag.go index 719743e71181..6b08874f5e5e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/tag.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/tag.go @@ -49,8 +49,7 @@ func NewTagClientWithBaseURI(baseURI string, subscriptionID string) TagClient { // apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current // revision has ;rev=n as a suffix where n is the revision number. // tagID - tag identifier. Must be unique in the current API Management service instance. -// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. -func (client TagClient) AssignToAPI(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string, ifMatch string) (result TagContract, err error) { +func (client TagClient) AssignToAPI(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string) (result TagContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TagClient.AssignToAPI") defer func() { @@ -73,11 +72,11 @@ func (client TagClient) AssignToAPI(ctx context.Context, resourceGroupName strin {TargetValue: tagID, Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "tagID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.TagClient", "AssignToAPI", err.Error()) } - req, err := client.AssignToAPIPreparer(ctx, resourceGroupName, serviceName, apiid, tagID, ifMatch) + req, err := client.AssignToAPIPreparer(ctx, resourceGroupName, serviceName, apiid, tagID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "AssignToAPI", nil, "Failure preparing request") return @@ -99,7 +98,7 @@ func (client TagClient) AssignToAPI(ctx context.Context, resourceGroupName strin } // AssignToAPIPreparer prepares the AssignToAPI request. -func (client TagClient) AssignToAPIPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string, ifMatch string) (*http.Request, error) { +func (client TagClient) AssignToAPIPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -108,7 +107,7 @@ func (client TagClient) AssignToAPIPreparer(ctx context.Context, resourceGroupNa "tagId": autorest.Encode("path", tagID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -118,10 +117,6 @@ func (client TagClient) AssignToAPIPreparer(ctx context.Context, resourceGroupNa autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}", pathParameters), autorest.WithQueryParameters(queryParameters)) - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -153,8 +148,7 @@ func (client TagClient) AssignToAPIResponder(resp *http.Response) (result TagCon // operationID - operation identifier within an API. Must be unique in the current API Management service // instance. // tagID - tag identifier. Must be unique in the current API Management service instance. -// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. -func (client TagClient) AssignToOperation(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, tagID string, ifMatch string) (result TagContract, err error) { +func (client TagClient) AssignToOperation(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, tagID string) (result TagContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TagClient.AssignToOperation") defer func() { @@ -176,16 +170,15 @@ func (client TagClient) AssignToOperation(ctx context.Context, resourceGroupName {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: operationID, Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: tagID, Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "tagID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.TagClient", "AssignToOperation", err.Error()) } - req, err := client.AssignToOperationPreparer(ctx, resourceGroupName, serviceName, apiid, operationID, tagID, ifMatch) + req, err := client.AssignToOperationPreparer(ctx, resourceGroupName, serviceName, apiid, operationID, tagID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "AssignToOperation", nil, "Failure preparing request") return @@ -207,7 +200,7 @@ func (client TagClient) AssignToOperation(ctx context.Context, resourceGroupName } // AssignToOperationPreparer prepares the AssignToOperation request. -func (client TagClient) AssignToOperationPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, tagID string, ifMatch string) (*http.Request, error) { +func (client TagClient) AssignToOperationPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, tagID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "operationId": autorest.Encode("path", operationID), @@ -217,7 +210,7 @@ func (client TagClient) AssignToOperationPreparer(ctx context.Context, resourceG "tagId": autorest.Encode("path", tagID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -227,10 +220,6 @@ func (client TagClient) AssignToOperationPreparer(ctx context.Context, resourceG autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}", pathParameters), autorest.WithQueryParameters(queryParameters)) - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -259,8 +248,7 @@ func (client TagClient) AssignToOperationResponder(resp *http.Response) (result // serviceName - the name of the API Management service. // productID - product identifier. Must be unique in the current API Management service instance. // tagID - tag identifier. Must be unique in the current API Management service instance. -// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. -func (client TagClient) AssignToProduct(ctx context.Context, resourceGroupName string, serviceName string, productID string, tagID string, ifMatch string) (result TagContract, err error) { +func (client TagClient) AssignToProduct(ctx context.Context, resourceGroupName string, serviceName string, productID string, tagID string) (result TagContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TagClient.AssignToProduct") defer func() { @@ -277,17 +265,16 @@ func (client TagClient) AssignToProduct(ctx context.Context, resourceGroupName s {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: tagID, Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "tagID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.TagClient", "AssignToProduct", err.Error()) } - req, err := client.AssignToProductPreparer(ctx, resourceGroupName, serviceName, productID, tagID, ifMatch) + req, err := client.AssignToProductPreparer(ctx, resourceGroupName, serviceName, productID, tagID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "AssignToProduct", nil, "Failure preparing request") return @@ -309,7 +296,7 @@ func (client TagClient) AssignToProduct(ctx context.Context, resourceGroupName s } // AssignToProductPreparer prepares the AssignToProduct request. -func (client TagClient) AssignToProductPreparer(ctx context.Context, resourceGroupName string, serviceName string, productID string, tagID string, ifMatch string) (*http.Request, error) { +func (client TagClient) AssignToProductPreparer(ctx context.Context, resourceGroupName string, serviceName string, productID string, tagID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "productId": autorest.Encode("path", productID), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -318,7 +305,7 @@ func (client TagClient) AssignToProductPreparer(ctx context.Context, resourceGro "tagId": autorest.Encode("path", tagID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -328,10 +315,6 @@ func (client TagClient) AssignToProductPreparer(ctx context.Context, resourceGro autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}", pathParameters), autorest.WithQueryParameters(queryParameters)) - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -360,7 +343,8 @@ func (client TagClient) AssignToProductResponder(resp *http.Response) (result Ta // serviceName - the name of the API Management service. // tagID - tag identifier. Must be unique in the current API Management service instance. // parameters - create parameters. -func (client TagClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, tagID string, parameters TagCreateUpdateParameters) (result TagContract, err error) { +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client TagClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, tagID string, parameters TagCreateUpdateParameters, ifMatch string) (result TagContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TagClient.CreateOrUpdate") defer func() { @@ -379,7 +363,7 @@ func (client TagClient) CreateOrUpdate(ctx context.Context, resourceGroupName st {TargetValue: tagID, Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "tagID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.TagContractProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.TagContractProperties.DisplayName", Name: validation.Null, Rule: true, @@ -390,7 +374,7 @@ func (client TagClient) CreateOrUpdate(ctx context.Context, resourceGroupName st return result, validation.NewError("apimanagement.TagClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, tagID, parameters) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, tagID, parameters, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -412,7 +396,7 @@ func (client TagClient) CreateOrUpdate(ctx context.Context, resourceGroupName st } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client TagClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, tagID string, parameters TagCreateUpdateParameters) (*http.Request, error) { +func (client TagClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, tagID string, parameters TagCreateUpdateParameters, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), @@ -420,7 +404,7 @@ func (client TagClient) CreateOrUpdatePreparer(ctx context.Context, resourceGrou "tagId": autorest.Encode("path", tagID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -432,6 +416,10 @@ func (client TagClient) CreateOrUpdatePreparer(ctx context.Context, resourceGrou autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -480,7 +468,7 @@ func (client TagClient) Delete(ctx context.Context, resourceGroupName string, se {TargetValue: tagID, Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "tagID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.TagClient", "Delete", err.Error()) } @@ -514,7 +502,7 @@ func (client TagClient) DeletePreparer(ctx context.Context, resourceGroupName st "tagId": autorest.Encode("path", tagID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -553,9 +541,7 @@ func (client TagClient) DeleteResponder(resp *http.Response) (result autorest.Re // apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current // revision has ;rev=n as a suffix where n is the revision number. // tagID - tag identifier. Must be unique in the current API Management service instance. -// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET -// request or it should be * for unconditional update. -func (client TagClient) DetachFromAPI(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string, ifMatch string) (result autorest.Response, err error) { +func (client TagClient) DetachFromAPI(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TagClient.DetachFromAPI") defer func() { @@ -578,11 +564,11 @@ func (client TagClient) DetachFromAPI(ctx context.Context, resourceGroupName str {TargetValue: tagID, Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "tagID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.TagClient", "DetachFromAPI", err.Error()) } - req, err := client.DetachFromAPIPreparer(ctx, resourceGroupName, serviceName, apiid, tagID, ifMatch) + req, err := client.DetachFromAPIPreparer(ctx, resourceGroupName, serviceName, apiid, tagID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "DetachFromAPI", nil, "Failure preparing request") return @@ -604,7 +590,7 @@ func (client TagClient) DetachFromAPI(ctx context.Context, resourceGroupName str } // DetachFromAPIPreparer prepares the DetachFromAPI request. -func (client TagClient) DetachFromAPIPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string, ifMatch string) (*http.Request, error) { +func (client TagClient) DetachFromAPIPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -613,7 +599,7 @@ func (client TagClient) DetachFromAPIPreparer(ctx context.Context, resourceGroup "tagId": autorest.Encode("path", tagID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -622,8 +608,7 @@ func (client TagClient) DetachFromAPIPreparer(ctx context.Context, resourceGroup autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}", pathParameters), - autorest.WithQueryParameters(queryParameters), - autorest.WithHeader("If-Match", autorest.String(ifMatch))) + autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -654,9 +639,7 @@ func (client TagClient) DetachFromAPIResponder(resp *http.Response) (result auto // operationID - operation identifier within an API. Must be unique in the current API Management service // instance. // tagID - tag identifier. Must be unique in the current API Management service instance. -// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET -// request or it should be * for unconditional update. -func (client TagClient) DetachFromOperation(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, tagID string, ifMatch string) (result autorest.Response, err error) { +func (client TagClient) DetachFromOperation(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, tagID string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TagClient.DetachFromOperation") defer func() { @@ -678,16 +661,15 @@ func (client TagClient) DetachFromOperation(ctx context.Context, resourceGroupNa {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: operationID, Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: tagID, Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "tagID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.TagClient", "DetachFromOperation", err.Error()) } - req, err := client.DetachFromOperationPreparer(ctx, resourceGroupName, serviceName, apiid, operationID, tagID, ifMatch) + req, err := client.DetachFromOperationPreparer(ctx, resourceGroupName, serviceName, apiid, operationID, tagID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "DetachFromOperation", nil, "Failure preparing request") return @@ -709,7 +691,7 @@ func (client TagClient) DetachFromOperation(ctx context.Context, resourceGroupNa } // DetachFromOperationPreparer prepares the DetachFromOperation request. -func (client TagClient) DetachFromOperationPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, tagID string, ifMatch string) (*http.Request, error) { +func (client TagClient) DetachFromOperationPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, tagID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "operationId": autorest.Encode("path", operationID), @@ -719,7 +701,7 @@ func (client TagClient) DetachFromOperationPreparer(ctx context.Context, resourc "tagId": autorest.Encode("path", tagID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -728,8 +710,7 @@ func (client TagClient) DetachFromOperationPreparer(ctx context.Context, resourc autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}", pathParameters), - autorest.WithQueryParameters(queryParameters), - autorest.WithHeader("If-Match", autorest.String(ifMatch))) + autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -757,9 +738,7 @@ func (client TagClient) DetachFromOperationResponder(resp *http.Response) (resul // serviceName - the name of the API Management service. // productID - product identifier. Must be unique in the current API Management service instance. // tagID - tag identifier. Must be unique in the current API Management service instance. -// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET -// request or it should be * for unconditional update. -func (client TagClient) DetachFromProduct(ctx context.Context, resourceGroupName string, serviceName string, productID string, tagID string, ifMatch string) (result autorest.Response, err error) { +func (client TagClient) DetachFromProduct(ctx context.Context, resourceGroupName string, serviceName string, productID string, tagID string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TagClient.DetachFromProduct") defer func() { @@ -776,17 +755,16 @@ func (client TagClient) DetachFromProduct(ctx context.Context, resourceGroupName {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: tagID, Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "tagID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.TagClient", "DetachFromProduct", err.Error()) } - req, err := client.DetachFromProductPreparer(ctx, resourceGroupName, serviceName, productID, tagID, ifMatch) + req, err := client.DetachFromProductPreparer(ctx, resourceGroupName, serviceName, productID, tagID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "DetachFromProduct", nil, "Failure preparing request") return @@ -808,7 +786,7 @@ func (client TagClient) DetachFromProduct(ctx context.Context, resourceGroupName } // DetachFromProductPreparer prepares the DetachFromProduct request. -func (client TagClient) DetachFromProductPreparer(ctx context.Context, resourceGroupName string, serviceName string, productID string, tagID string, ifMatch string) (*http.Request, error) { +func (client TagClient) DetachFromProductPreparer(ctx context.Context, resourceGroupName string, serviceName string, productID string, tagID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "productId": autorest.Encode("path", productID), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -817,7 +795,7 @@ func (client TagClient) DetachFromProductPreparer(ctx context.Context, resourceG "tagId": autorest.Encode("path", tagID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -826,8 +804,7 @@ func (client TagClient) DetachFromProductPreparer(ctx context.Context, resourceG autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}", pathParameters), - autorest.WithQueryParameters(queryParameters), - autorest.WithHeader("If-Match", autorest.String(ifMatch))) + autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -873,7 +850,7 @@ func (client TagClient) Get(ctx context.Context, resourceGroupName string, servi {TargetValue: tagID, Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "tagID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.TagClient", "Get", err.Error()) } @@ -907,7 +884,7 @@ func (client TagClient) GetPreparer(ctx context.Context, resourceGroupName strin "tagId": autorest.Encode("path", tagID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -969,7 +946,7 @@ func (client TagClient) GetByAPI(ctx context.Context, resourceGroupName string, {TargetValue: tagID, Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "tagID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.TagClient", "GetByAPI", err.Error()) } @@ -1004,7 +981,7 @@ func (client TagClient) GetByAPIPreparer(ctx context.Context, resourceGroupName "tagId": autorest.Encode("path", tagID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1067,12 +1044,11 @@ func (client TagClient) GetByOperation(ctx context.Context, resourceGroupName st {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: operationID, Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: tagID, Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "tagID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.TagClient", "GetByOperation", err.Error()) } @@ -1108,7 +1084,7 @@ func (client TagClient) GetByOperationPreparer(ctx context.Context, resourceGrou "tagId": autorest.Encode("path", tagID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1163,13 +1139,12 @@ func (client TagClient) GetByProduct(ctx context.Context, resourceGroupName stri {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: tagID, Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "tagID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.TagClient", "GetByProduct", err.Error()) } @@ -1204,7 +1179,7 @@ func (client TagClient) GetByProductPreparer(ctx context.Context, resourceGroupN "tagId": autorest.Encode("path", tagID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1260,7 +1235,7 @@ func (client TagClient) GetEntityState(ctx context.Context, resourceGroupName st {TargetValue: tagID, Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "tagID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.TagClient", "GetEntityState", err.Error()) } @@ -1294,7 +1269,7 @@ func (client TagClient) GetEntityStatePreparer(ctx context.Context, resourceGrou "tagId": autorest.Encode("path", tagID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1355,7 +1330,7 @@ func (client TagClient) GetEntityStateByAPI(ctx context.Context, resourceGroupNa {TargetValue: tagID, Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "tagID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.TagClient", "GetEntityStateByAPI", err.Error()) } @@ -1390,7 +1365,7 @@ func (client TagClient) GetEntityStateByAPIPreparer(ctx context.Context, resourc "tagId": autorest.Encode("path", tagID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1452,12 +1427,11 @@ func (client TagClient) GetEntityStateByOperation(ctx context.Context, resourceG {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: operationID, Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: tagID, Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "tagID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.TagClient", "GetEntityStateByOperation", err.Error()) } @@ -1493,7 +1467,7 @@ func (client TagClient) GetEntityStateByOperationPreparer(ctx context.Context, r "tagId": autorest.Encode("path", tagID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1547,13 +1521,12 @@ func (client TagClient) GetEntityStateByProduct(ctx context.Context, resourceGro {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: tagID, Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "tagID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.TagClient", "GetEntityStateByProduct", err.Error()) } @@ -1588,7 +1561,7 @@ func (client TagClient) GetEntityStateByProductPreparer(ctx context.Context, res "tagId": autorest.Encode("path", tagID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1625,10 +1598,10 @@ func (client TagClient) GetEntityStateByProductResponder(resp *http.Response) (r // serviceName - the name of the API Management service. // apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current // revision has ;rev=n as a suffix where n is the revision number. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| displayName | filter | ge, le, eq, ne, +// gt, lt | substringof, contains, startswith, endswith |
| name | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. func (client TagClient) ListByAPI(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result TagCollectionPage, err error) { @@ -1691,7 +1664,7 @@ func (client TagClient) ListByAPIPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1777,13 +1750,10 @@ func (client TagClient) ListByAPIComplete(ctx context.Context, resourceGroupName // revision has ;rev=n as a suffix where n is the revision number. // operationID - operation identifier within an API. Must be unique in the current API Management service // instance. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | method | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | urlTemplate | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| displayName | filter | ge, le, eq, ne, +// gt, lt | substringof, contains, startswith, endswith |
| name | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. func (client TagClient) ListByOperation(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, filter string, top *int32, skip *int32) (result TagCollectionPage, err error) { @@ -1808,8 +1778,7 @@ func (client TagClient) ListByOperation(ctx context.Context, resourceGroupName s {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: operationID, Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, @@ -1851,7 +1820,7 @@ func (client TagClient) ListByOperationPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1934,10 +1903,10 @@ func (client TagClient) ListByOperationComplete(ctx context.Context, resourceGro // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // productID - product identifier. Must be unique in the current API Management service instance. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| displayName | filter | ge, le, eq, ne, +// gt, lt | substringof, contains, startswith, endswith |
| name | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. func (client TagClient) ListByProduct(ctx context.Context, resourceGroupName string, serviceName string, productID string, filter string, top *int32, skip *int32) (result TagCollectionPage, err error) { @@ -1957,9 +1926,8 @@ func (client TagClient) ListByProduct(ctx context.Context, resourceGroupName str {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, @@ -2000,7 +1968,7 @@ func (client TagClient) ListByProductPreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -2082,13 +2050,14 @@ func (client TagClient) ListByProductComplete(ctx context.Context, resourceGroup // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. -func (client TagClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result TagCollectionPage, err error) { +// scope - scope like 'apis', 'products' or 'apis/{apiId} +func (client TagClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, scope string) (result TagCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TagClient.ListByService") defer func() { @@ -2114,7 +2083,7 @@ func (client TagClient) ListByService(ctx context.Context, resourceGroupName str } result.fn = client.listByServiceNextResults - req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip, scope) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "ListByService", nil, "Failure preparing request") return @@ -2136,14 +2105,14 @@ func (client TagClient) ListByService(ctx context.Context, resourceGroupName str } // ListByServicePreparer prepares the ListByService request. -func (client TagClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { +func (client TagClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, scope string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -2156,6 +2125,9 @@ func (client TagClient) ListByServicePreparer(ctx context.Context, resourceGroup if skip != nil { queryParameters["$skip"] = autorest.Encode("query", *skip) } + if len(scope) > 0 { + queryParameters["scope"] = autorest.Encode("query", scope) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -2206,7 +2178,7 @@ func (client TagClient) listByServiceNextResults(ctx context.Context, lastResult } // ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. -func (client TagClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result TagCollectionIterator, err error) { +func (client TagClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, scope string) (result TagCollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TagClient.ListByService") defer func() { @@ -2217,7 +2189,7 @@ func (client TagClient) ListByServiceComplete(ctx context.Context, resourceGroup tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip) + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip, scope) return } @@ -2248,7 +2220,7 @@ func (client TagClient) Update(ctx context.Context, resourceGroupName string, se {TargetValue: tagID, Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "tagID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.TagClient", "Update", err.Error()) } @@ -2282,7 +2254,7 @@ func (client TagClient) UpdatePreparer(ctx context.Context, resourceGroupName st "tagId": autorest.Encode("path", tagID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/tagresource.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/tagresource.go similarity index 85% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/tagresource.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/tagresource.go index 62061d0a10d9..e57157bb3d3d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/tagresource.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/tagresource.go @@ -46,21 +46,19 @@ func NewTagResourceClientWithBaseURI(baseURI string, subscriptionID string) TagR // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | aid | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | apiName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | apiRevision | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | path | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | serviceUrl | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | method | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | urlTemplate | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | terms | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | state | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | isCurrent | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| aid | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| name | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
| apiName | filter | ge, le, eq, ne, gt, lt | substringof, contains, +// startswith, endswith |
| apiRevision | filter | ge, le, eq, ne, gt, lt | substringof, contains, +// startswith, endswith |
| path | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, +// endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, +// endswith |
| serviceUrl | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith +// |
| method | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| +// urlTemplate | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| terms | +// filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| state | filter | eq | +// |
| isCurrent | filter | eq | |
// top - number of records to return. // skip - number of records to skip. func (client TagResourceClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result TagResourceCollectionPage, err error) { @@ -118,7 +116,7 @@ func (client TagResourceClient) ListByServicePreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/tenantaccess.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/tenantaccess.go similarity index 68% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/tenantaccess.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/tenantaccess.go index db66e144ee93..6373c5a369ee 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/tenantaccess.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/tenantaccess.go @@ -42,7 +42,7 @@ func NewTenantAccessClientWithBaseURI(baseURI string, subscriptionID string) Ten return TenantAccessClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Get get tenant access information details. +// Get get tenant access information details without secrets. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. @@ -95,7 +95,7 @@ func (client TenantAccessClient) GetPreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -127,7 +127,176 @@ func (client TenantAccessClient) GetResponder(resp *http.Response) (result Acces return } -// RegeneratePrimaryKey regenerate primary access key. +// GetEntityTag tenant access metadata +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +func (client TenantAccessClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TenantAccessClient.GetEntityTag") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.TenantAccessClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client TenantAccessClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accessName": autorest.Encode("path", "access"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client TenantAccessClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client TenantAccessClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListSecrets get tenant access information details. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +func (client TenantAccessClient) ListSecrets(ctx context.Context, resourceGroupName string, serviceName string) (result AccessInformationContract, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TenantAccessClient.ListSecrets") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.TenantAccessClient", "ListSecrets", err.Error()) + } + + req, err := client.ListSecretsPreparer(ctx, resourceGroupName, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessClient", "ListSecrets", nil, "Failure preparing request") + return + } + + resp, err := client.ListSecretsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessClient", "ListSecrets", resp, "Failure sending request") + return + } + + result, err = client.ListSecretsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessClient", "ListSecrets", resp, "Failure responding to request") + } + + return +} + +// ListSecretsPreparer prepares the ListSecrets request. +func (client TenantAccessClient) ListSecretsPreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accessName": autorest.Encode("path", "access"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/listSecrets", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSecretsSender sends the ListSecrets request. The method will close the +// http.Response Body if it receives an error. +func (client TenantAccessClient) ListSecretsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSecretsResponder handles the response to the ListSecrets request. The method always +// closes the http.Response Body. +func (client TenantAccessClient) ListSecretsResponder(resp *http.Response) (result AccessInformationContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RegeneratePrimaryKey regenerate primary access key // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. @@ -180,7 +349,7 @@ func (client TenantAccessClient) RegeneratePrimaryKeyPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -211,7 +380,7 @@ func (client TenantAccessClient) RegeneratePrimaryKeyResponder(resp *http.Respon return } -// RegenerateSecondaryKey regenerate secondary access key. +// RegenerateSecondaryKey regenerate secondary access key // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. @@ -264,7 +433,7 @@ func (client TenantAccessClient) RegenerateSecondaryKeyPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -351,7 +520,7 @@ func (client TenantAccessClient) UpdatePreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/tenantaccessgit.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/tenantaccessgit.go similarity index 76% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/tenantaccessgit.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/tenantaccessgit.go index 70f26d6af527..896449968747 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/tenantaccessgit.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/tenantaccessgit.go @@ -42,7 +42,7 @@ func NewTenantAccessGitClientWithBaseURI(baseURI string, subscriptionID string) return TenantAccessGitClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Get gets the Git access configuration for the tenant. +// Get gets the Git access configuration for the tenant. Without secrets. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. @@ -95,7 +95,7 @@ func (client TenantAccessGitClient) GetPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -127,6 +127,91 @@ func (client TenantAccessGitClient) GetResponder(resp *http.Response) (result Ac return } +// ListSecrets gets the Git access configuration for the tenant. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +func (client TenantAccessGitClient) ListSecrets(ctx context.Context, resourceGroupName string, serviceName string) (result AccessInformationContract, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TenantAccessGitClient.ListSecrets") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.TenantAccessGitClient", "ListSecrets", err.Error()) + } + + req, err := client.ListSecretsPreparer(ctx, resourceGroupName, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessGitClient", "ListSecrets", nil, "Failure preparing request") + return + } + + resp, err := client.ListSecretsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessGitClient", "ListSecrets", resp, "Failure sending request") + return + } + + result, err = client.ListSecretsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessGitClient", "ListSecrets", resp, "Failure responding to request") + } + + return +} + +// ListSecretsPreparer prepares the ListSecrets request. +func (client TenantAccessGitClient) ListSecretsPreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accessName": autorest.Encode("path", "access"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/git/listSecrets", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSecretsSender sends the ListSecrets request. The method will close the +// http.Response Body if it receives an error. +func (client TenantAccessGitClient) ListSecretsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSecretsResponder handles the response to the ListSecrets request. The method always +// closes the http.Response Body. +func (client TenantAccessGitClient) ListSecretsResponder(resp *http.Response) (result AccessInformationContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // RegeneratePrimaryKey regenerate primary access key for GIT. // Parameters: // resourceGroupName - the name of the resource group. @@ -180,7 +265,7 @@ func (client TenantAccessGitClient) RegeneratePrimaryKeyPreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -264,7 +349,7 @@ func (client TenantAccessGitClient) RegenerateSecondaryKeyPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/tenantconfiguration.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/tenantconfiguration.go similarity index 94% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/tenantconfiguration.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/tenantconfiguration.go index d546ef6c6559..a943e10becad 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/tenantconfiguration.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/tenantconfiguration.go @@ -66,7 +66,8 @@ func (client TenantConfigurationClient) Deploy(ctx context.Context, resourceGrou {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Branch", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "parameters.DeployConfigurationParameterProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DeployConfigurationParameterProperties.Branch", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { return result, validation.NewError("apimanagement.TenantConfigurationClient", "Deploy", err.Error()) } @@ -94,7 +95,7 @@ func (client TenantConfigurationClient) DeployPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -188,7 +189,7 @@ func (client TenantConfigurationClient) GetSyncStatePreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -243,7 +244,8 @@ func (client TenantConfigurationClient) Save(ctx context.Context, resourceGroupN {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Branch", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "parameters.SaveConfigurationParameterProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.SaveConfigurationParameterProperties.Branch", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { return result, validation.NewError("apimanagement.TenantConfigurationClient", "Save", err.Error()) } @@ -271,7 +273,7 @@ func (client TenantConfigurationClient) SavePreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -334,7 +336,8 @@ func (client TenantConfigurationClient) Validate(ctx context.Context, resourceGr {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Branch", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "parameters.DeployConfigurationParameterProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DeployConfigurationParameterProperties.Branch", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { return result, validation.NewError("apimanagement.TenantConfigurationClient", "Validate", err.Error()) } @@ -362,7 +365,7 @@ func (client TenantConfigurationClient) ValidatePreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/user.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/user.go similarity index 75% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/user.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/user.go index 768fa15d6c35..f53a321e7639 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/user.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/user.go @@ -46,10 +46,10 @@ func NewUserClientWithBaseURI(baseURI string, subscriptionID string) UserClient // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// UID - user identifier. Must be unique in the current API Management service instance. +// userID - user identifier. Must be unique in the current API Management service instance. // parameters - create or update parameters. // ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. -func (client UserClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, UID string, parameters UserCreateParameters, ifMatch string) (result UserContract, err error) { +func (client UserClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, userID string, parameters UserCreateParameters, ifMatch string) (result UserContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/UserClient.CreateOrUpdate") defer func() { @@ -65,10 +65,9 @@ func (client UserClient) CreateOrUpdate(ctx context.Context, resourceGroupName s Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: UID, - Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: userID, + Constraints: []validation.Constraint{{Target: "userID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "userID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.UserCreateParameterProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.UserCreateParameterProperties.Email", Name: validation.Null, Rule: true, @@ -87,7 +86,7 @@ func (client UserClient) CreateOrUpdate(ctx context.Context, resourceGroupName s return result, validation.NewError("apimanagement.UserClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, UID, parameters, ifMatch) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, userID, parameters, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -109,15 +108,15 @@ func (client UserClient) CreateOrUpdate(ctx context.Context, resourceGroupName s } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client UserClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, UID string, parameters UserCreateParameters, ifMatch string) (*http.Request, error) { +func (client UserClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, userID string, parameters UserCreateParameters, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "uid": autorest.Encode("path", UID), + "userId": autorest.Encode("path", userID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -126,7 +125,7 @@ func (client UserClient) CreateOrUpdatePreparer(ctx context.Context, resourceGro autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) if len(ifMatch) > 0 { @@ -159,12 +158,12 @@ func (client UserClient) CreateOrUpdateResponder(resp *http.Response) (result Us // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// UID - user identifier. Must be unique in the current API Management service instance. +// userID - user identifier. Must be unique in the current API Management service instance. // ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET // request or it should be * for unconditional update. // deleteSubscriptions - whether to delete user's subscription or not. // notify - send an Account Closed Email notification to the User. -func (client UserClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, UID string, ifMatch string, deleteSubscriptions *bool, notify *bool) (result autorest.Response, err error) { +func (client UserClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, userID string, ifMatch string, deleteSubscriptions *bool, notify *bool) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/UserClient.Delete") defer func() { @@ -180,14 +179,13 @@ func (client UserClient) Delete(ctx context.Context, resourceGroupName string, s Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: UID, - Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {TargetValue: userID, + Constraints: []validation.Constraint{{Target: "userID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "userID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.UserClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, UID, ifMatch, deleteSubscriptions, notify) + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, userID, ifMatch, deleteSubscriptions, notify) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "Delete", nil, "Failure preparing request") return @@ -209,15 +207,15 @@ func (client UserClient) Delete(ctx context.Context, resourceGroupName string, s } // DeletePreparer prepares the Delete request. -func (client UserClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, UID string, ifMatch string, deleteSubscriptions *bool, notify *bool) (*http.Request, error) { +func (client UserClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, userID string, ifMatch string, deleteSubscriptions *bool, notify *bool) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "uid": autorest.Encode("path", UID), + "userId": autorest.Encode("path", userID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -231,7 +229,7 @@ func (client UserClient) DeletePreparer(ctx context.Context, resourceGroupName s preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}", pathParameters), autorest.WithQueryParameters(queryParameters), autorest.WithHeader("If-Match", autorest.String(ifMatch))) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -260,8 +258,8 @@ func (client UserClient) DeleteResponder(resp *http.Response) (result autorest.R // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// UID - user identifier. Must be unique in the current API Management service instance. -func (client UserClient) GenerateSsoURL(ctx context.Context, resourceGroupName string, serviceName string, UID string) (result GenerateSsoURLResult, err error) { +// userID - user identifier. Must be unique in the current API Management service instance. +func (client UserClient) GenerateSsoURL(ctx context.Context, resourceGroupName string, serviceName string, userID string) (result GenerateSsoURLResult, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/UserClient.GenerateSsoURL") defer func() { @@ -277,14 +275,13 @@ func (client UserClient) GenerateSsoURL(ctx context.Context, resourceGroupName s Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: UID, - Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {TargetValue: userID, + Constraints: []validation.Constraint{{Target: "userID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "userID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.UserClient", "GenerateSsoURL", err.Error()) } - req, err := client.GenerateSsoURLPreparer(ctx, resourceGroupName, serviceName, UID) + req, err := client.GenerateSsoURLPreparer(ctx, resourceGroupName, serviceName, userID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "GenerateSsoURL", nil, "Failure preparing request") return @@ -306,15 +303,15 @@ func (client UserClient) GenerateSsoURL(ctx context.Context, resourceGroupName s } // GenerateSsoURLPreparer prepares the GenerateSsoURL request. -func (client UserClient) GenerateSsoURLPreparer(ctx context.Context, resourceGroupName string, serviceName string, UID string) (*http.Request, error) { +func (client UserClient) GenerateSsoURLPreparer(ctx context.Context, resourceGroupName string, serviceName string, userID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "uid": autorest.Encode("path", UID), + "userId": autorest.Encode("path", userID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -322,7 +319,7 @@ func (client UserClient) GenerateSsoURLPreparer(ctx context.Context, resourceGro preparer := autorest.CreatePreparer( autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}/generateSsoUrl", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/generateSsoUrl", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -350,8 +347,8 @@ func (client UserClient) GenerateSsoURLResponder(resp *http.Response) (result Ge // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// UID - user identifier. Must be unique in the current API Management service instance. -func (client UserClient) Get(ctx context.Context, resourceGroupName string, serviceName string, UID string) (result UserContract, err error) { +// userID - user identifier. Must be unique in the current API Management service instance. +func (client UserClient) Get(ctx context.Context, resourceGroupName string, serviceName string, userID string) (result UserContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/UserClient.Get") defer func() { @@ -367,14 +364,13 @@ func (client UserClient) Get(ctx context.Context, resourceGroupName string, serv Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: UID, - Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {TargetValue: userID, + Constraints: []validation.Constraint{{Target: "userID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "userID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.UserClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, UID) + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, userID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "Get", nil, "Failure preparing request") return @@ -396,15 +392,15 @@ func (client UserClient) Get(ctx context.Context, resourceGroupName string, serv } // GetPreparer prepares the Get request. -func (client UserClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, UID string) (*http.Request, error) { +func (client UserClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, userID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "uid": autorest.Encode("path", UID), + "userId": autorest.Encode("path", userID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -412,7 +408,7 @@ func (client UserClient) GetPreparer(ctx context.Context, resourceGroupName stri preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -440,8 +436,8 @@ func (client UserClient) GetResponder(resp *http.Response) (result UserContract, // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// UID - user identifier. Must be unique in the current API Management service instance. -func (client UserClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, UID string) (result autorest.Response, err error) { +// userID - user identifier. Must be unique in the current API Management service instance. +func (client UserClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, userID string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/UserClient.GetEntityTag") defer func() { @@ -457,14 +453,13 @@ func (client UserClient) GetEntityTag(ctx context.Context, resourceGroupName str Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: UID, - Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {TargetValue: userID, + Constraints: []validation.Constraint{{Target: "userID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "userID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.UserClient", "GetEntityTag", err.Error()) } - req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, UID) + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, userID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "GetEntityTag", nil, "Failure preparing request") return @@ -486,15 +481,15 @@ func (client UserClient) GetEntityTag(ctx context.Context, resourceGroupName str } // GetEntityTagPreparer prepares the GetEntityTag request. -func (client UserClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, UID string) (*http.Request, error) { +func (client UserClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, userID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "uid": autorest.Encode("path", UID), + "userId": autorest.Encode("path", userID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -502,7 +497,7 @@ func (client UserClient) GetEntityTagPreparer(ctx context.Context, resourceGroup preparer := autorest.CreatePreparer( autorest.AsHead(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -525,97 +520,13 @@ func (client UserClient) GetEntityTagResponder(resp *http.Response) (result auto return } -// GetIdentity returns calling user identity information. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceName - the name of the API Management service. -func (client UserClient) GetIdentity(ctx context.Context, resourceGroupName string, serviceName string) (result CurrentUserIdentity, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/UserClient.GetIdentity") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: serviceName, - Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, - {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("apimanagement.UserClient", "GetIdentity", err.Error()) - } - - req, err := client.GetIdentityPreparer(ctx, resourceGroupName, serviceName) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "GetIdentity", nil, "Failure preparing request") - return - } - - resp, err := client.GetIdentitySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "GetIdentity", resp, "Failure sending request") - return - } - - result, err = client.GetIdentityResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "GetIdentity", resp, "Failure responding to request") - } - - return -} - -// GetIdentityPreparer prepares the GetIdentity request. -func (client UserClient) GetIdentityPreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-01-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identity", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetIdentitySender sends the GetIdentity request. The method will close the -// http.Response Body if it receives an error. -func (client UserClient) GetIdentitySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetIdentityResponder handles the response to the GetIdentity request. The method always -// closes the http.Response Body. -func (client UserClient) GetIdentityResponder(resp *http.Response) (result CurrentUserIdentity, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - // GetSharedAccessToken gets the Shared Access Authorization Token for the User. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// UID - user identifier. Must be unique in the current API Management service instance. +// userID - user identifier. Must be unique in the current API Management service instance. // parameters - create Authorization Token parameters. -func (client UserClient) GetSharedAccessToken(ctx context.Context, resourceGroupName string, serviceName string, UID string, parameters UserTokenParameters) (result UserTokenResult, err error) { +func (client UserClient) GetSharedAccessToken(ctx context.Context, resourceGroupName string, serviceName string, userID string, parameters UserTokenParameters) (result UserTokenResult, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/UserClient.GetSharedAccessToken") defer func() { @@ -631,16 +542,16 @@ func (client UserClient) GetSharedAccessToken(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: UID, - Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: userID, + Constraints: []validation.Constraint{{Target: "userID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "userID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Expiry", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "parameters.UserTokenParameterProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.UserTokenParameterProperties.Expiry", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { return result, validation.NewError("apimanagement.UserClient", "GetSharedAccessToken", err.Error()) } - req, err := client.GetSharedAccessTokenPreparer(ctx, resourceGroupName, serviceName, UID, parameters) + req, err := client.GetSharedAccessTokenPreparer(ctx, resourceGroupName, serviceName, userID, parameters) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "GetSharedAccessToken", nil, "Failure preparing request") return @@ -662,15 +573,15 @@ func (client UserClient) GetSharedAccessToken(ctx context.Context, resourceGroup } // GetSharedAccessTokenPreparer prepares the GetSharedAccessToken request. -func (client UserClient) GetSharedAccessTokenPreparer(ctx context.Context, resourceGroupName string, serviceName string, UID string, parameters UserTokenParameters) (*http.Request, error) { +func (client UserClient) GetSharedAccessTokenPreparer(ctx context.Context, resourceGroupName string, serviceName string, userID string, parameters UserTokenParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "uid": autorest.Encode("path", UID), + "userId": autorest.Encode("path", userID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -679,7 +590,7 @@ func (client UserClient) GetSharedAccessTokenPreparer(ctx context.Context, resou autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}/token", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/token", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -708,18 +619,18 @@ func (client UserClient) GetSharedAccessTokenResponder(resp *http.Response) (res // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - | Field | Supported operators | Supported functions | -// |------------------|------------------------|-----------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | firstName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | lastName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | email | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | state | eq | N/A | -// | registrationDate | ge, le, eq, ne, gt, lt | N/A | -// | note | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| firstName | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| lastName | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| email | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
| state | filter | eq | |
| registrationDate | filter | ge, +// le, eq, ne, gt, lt | |
| note | filter | ge, le, eq, ne, gt, lt | substringof, contains, +// startswith, endswith |
| groups | expand | | |
// top - number of records to return. // skip - number of records to skip. -func (client UserClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result UserCollectionPage, err error) { +// expandGroups - detailed Group in response. +func (client UserClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, expandGroups *bool) (result UserCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/UserClient.ListByService") defer func() { @@ -745,7 +656,7 @@ func (client UserClient) ListByService(ctx context.Context, resourceGroupName st } result.fn = client.listByServiceNextResults - req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip, expandGroups) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "ListByService", nil, "Failure preparing request") return @@ -767,14 +678,14 @@ func (client UserClient) ListByService(ctx context.Context, resourceGroupName st } // ListByServicePreparer prepares the ListByService request. -func (client UserClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { +func (client UserClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, expandGroups *bool) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -787,6 +698,9 @@ func (client UserClient) ListByServicePreparer(ctx context.Context, resourceGrou if skip != nil { queryParameters["$skip"] = autorest.Encode("query", *skip) } + if expandGroups != nil { + queryParameters["expandGroups"] = autorest.Encode("query", *expandGroups) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -837,7 +751,7 @@ func (client UserClient) listByServiceNextResults(ctx context.Context, lastResul } // ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. -func (client UserClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result UserCollectionIterator, err error) { +func (client UserClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, expandGroups *bool) (result UserCollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/UserClient.ListByService") defer func() { @@ -848,7 +762,7 @@ func (client UserClient) ListByServiceComplete(ctx context.Context, resourceGrou tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip) + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip, expandGroups) return } @@ -856,11 +770,11 @@ func (client UserClient) ListByServiceComplete(ctx context.Context, resourceGrou // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// UID - user identifier. Must be unique in the current API Management service instance. +// userID - user identifier. Must be unique in the current API Management service instance. // parameters - update parameters. // ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET // request or it should be * for unconditional update. -func (client UserClient) Update(ctx context.Context, resourceGroupName string, serviceName string, UID string, parameters UserUpdateParameters, ifMatch string) (result autorest.Response, err error) { +func (client UserClient) Update(ctx context.Context, resourceGroupName string, serviceName string, userID string, parameters UserUpdateParameters, ifMatch string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/UserClient.Update") defer func() { @@ -876,14 +790,13 @@ func (client UserClient) Update(ctx context.Context, resourceGroupName string, s Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: UID, - Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {TargetValue: userID, + Constraints: []validation.Constraint{{Target: "userID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "userID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.UserClient", "Update", err.Error()) } - req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, UID, parameters, ifMatch) + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, userID, parameters, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "Update", nil, "Failure preparing request") return @@ -905,15 +818,15 @@ func (client UserClient) Update(ctx context.Context, resourceGroupName string, s } // UpdatePreparer prepares the Update request. -func (client UserClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, UID string, parameters UserUpdateParameters, ifMatch string) (*http.Request, error) { +func (client UserClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, userID string, parameters UserUpdateParameters, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "uid": autorest.Encode("path", UID), + "userId": autorest.Encode("path", userID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -922,7 +835,7 @@ func (client UserClient) UpdatePreparer(ctx context.Context, resourceGroupName s autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters), autorest.WithHeader("If-Match", autorest.String(ifMatch))) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/userconfirmationpassword.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/userconfirmationpassword.go new file mode 100644 index 000000000000..f432d059dc5e --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/userconfirmationpassword.go @@ -0,0 +1,132 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// UserConfirmationPasswordClient is the apiManagement Client +type UserConfirmationPasswordClient struct { + BaseClient +} + +// NewUserConfirmationPasswordClient creates an instance of the UserConfirmationPasswordClient client. +func NewUserConfirmationPasswordClient(subscriptionID string) UserConfirmationPasswordClient { + return NewUserConfirmationPasswordClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewUserConfirmationPasswordClientWithBaseURI creates an instance of the UserConfirmationPasswordClient client using +// a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewUserConfirmationPasswordClientWithBaseURI(baseURI string, subscriptionID string) UserConfirmationPasswordClient { + return UserConfirmationPasswordClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// SendMethod sends confirmation +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// userID - user identifier. Must be unique in the current API Management service instance. +func (client UserConfirmationPasswordClient) SendMethod(ctx context.Context, resourceGroupName string, serviceName string, userID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UserConfirmationPasswordClient.SendMethod") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: userID, + Constraints: []validation.Constraint{{Target: "userID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "userID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.UserConfirmationPasswordClient", "SendMethod", err.Error()) + } + + req, err := client.SendMethodPreparer(ctx, resourceGroupName, serviceName, userID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.UserConfirmationPasswordClient", "SendMethod", nil, "Failure preparing request") + return + } + + resp, err := client.SendMethodSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.UserConfirmationPasswordClient", "SendMethod", resp, "Failure sending request") + return + } + + result, err = client.SendMethodResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.UserConfirmationPasswordClient", "SendMethod", resp, "Failure responding to request") + } + + return +} + +// SendMethodPreparer prepares the SendMethod request. +func (client UserConfirmationPasswordClient) SendMethodPreparer(ctx context.Context, resourceGroupName string, serviceName string, userID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userId": autorest.Encode("path", userID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/confirmations/password/send", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SendMethodSender sends the SendMethod request. The method will close the +// http.Response Body if it receives an error. +func (client UserConfirmationPasswordClient) SendMethodSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// SendMethodResponder handles the response to the SendMethod request. The method always +// closes the http.Response Body. +func (client UserConfirmationPasswordClient) SendMethodResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/usergroup.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/usergroup.go similarity index 82% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/usergroup.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/usergroup.go index e4e781f86520..b2e738d40845 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/usergroup.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/usergroup.go @@ -46,15 +46,15 @@ func NewUserGroupClientWithBaseURI(baseURI string, subscriptionID string) UserGr // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// UID - user identifier. Must be unique in the current API Management service instance. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// userID - user identifier. Must be unique in the current API Management service instance. +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. -func (client UserGroupClient) List(ctx context.Context, resourceGroupName string, serviceName string, UID string, filter string, top *int32, skip *int32) (result GroupCollectionPage, err error) { +func (client UserGroupClient) List(ctx context.Context, resourceGroupName string, serviceName string, userID string, filter string, top *int32, skip *int32) (result GroupCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/UserGroupClient.List") defer func() { @@ -70,10 +70,9 @@ func (client UserGroupClient) List(ctx context.Context, resourceGroupName string Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: UID, - Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: userID, + Constraints: []validation.Constraint{{Target: "userID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "userID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, @@ -84,7 +83,7 @@ func (client UserGroupClient) List(ctx context.Context, resourceGroupName string } result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, serviceName, UID, filter, top, skip) + req, err := client.ListPreparer(ctx, resourceGroupName, serviceName, userID, filter, top, skip) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.UserGroupClient", "List", nil, "Failure preparing request") return @@ -106,15 +105,15 @@ func (client UserGroupClient) List(ctx context.Context, resourceGroupName string } // ListPreparer prepares the List request. -func (client UserGroupClient) ListPreparer(ctx context.Context, resourceGroupName string, serviceName string, UID string, filter string, top *int32, skip *int32) (*http.Request, error) { +func (client UserGroupClient) ListPreparer(ctx context.Context, resourceGroupName string, serviceName string, userID string, filter string, top *int32, skip *int32) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "uid": autorest.Encode("path", UID), + "userId": autorest.Encode("path", userID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -131,7 +130,7 @@ func (client UserGroupClient) ListPreparer(ctx context.Context, resourceGroupNam preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}/groups", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/groups", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -177,7 +176,7 @@ func (client UserGroupClient) listNextResults(ctx context.Context, lastResults G } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client UserGroupClient) ListComplete(ctx context.Context, resourceGroupName string, serviceName string, UID string, filter string, top *int32, skip *int32) (result GroupCollectionIterator, err error) { +func (client UserGroupClient) ListComplete(ctx context.Context, resourceGroupName string, serviceName string, userID string, filter string, top *int32, skip *int32) (result GroupCollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/UserGroupClient.List") defer func() { @@ -188,6 +187,6 @@ func (client UserGroupClient) ListComplete(ctx context.Context, resourceGroupNam tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.List(ctx, resourceGroupName, serviceName, UID, filter, top, skip) + result.page, err = client.List(ctx, resourceGroupName, serviceName, userID, filter, top, skip) return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/useridentities.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/useridentities.go similarity index 87% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/useridentities.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/useridentities.go index f0d5b0f4c636..2c8a979b642a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/useridentities.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/useridentities.go @@ -42,12 +42,12 @@ func NewUserIdentitiesClientWithBaseURI(baseURI string, subscriptionID string) U return UserIdentitiesClient{NewWithBaseURI(baseURI, subscriptionID)} } -// List lists all user identities. +// List list of all user identities. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// UID - user identifier. Must be unique in the current API Management service instance. -func (client UserIdentitiesClient) List(ctx context.Context, resourceGroupName string, serviceName string, UID string) (result UserIdentityCollectionPage, err error) { +// userID - user identifier. Must be unique in the current API Management service instance. +func (client UserIdentitiesClient) List(ctx context.Context, resourceGroupName string, serviceName string, userID string) (result UserIdentityCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/UserIdentitiesClient.List") defer func() { @@ -63,15 +63,14 @@ func (client UserIdentitiesClient) List(ctx context.Context, resourceGroupName s Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: UID, - Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {TargetValue: userID, + Constraints: []validation.Constraint{{Target: "userID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "userID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.UserIdentitiesClient", "List", err.Error()) } result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, serviceName, UID) + req, err := client.ListPreparer(ctx, resourceGroupName, serviceName, userID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.UserIdentitiesClient", "List", nil, "Failure preparing request") return @@ -93,15 +92,15 @@ func (client UserIdentitiesClient) List(ctx context.Context, resourceGroupName s } // ListPreparer prepares the List request. -func (client UserIdentitiesClient) ListPreparer(ctx context.Context, resourceGroupName string, serviceName string, UID string) (*http.Request, error) { +func (client UserIdentitiesClient) ListPreparer(ctx context.Context, resourceGroupName string, serviceName string, userID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "uid": autorest.Encode("path", UID), + "userId": autorest.Encode("path", userID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -109,7 +108,7 @@ func (client UserIdentitiesClient) ListPreparer(ctx context.Context, resourceGro preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}/identities", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/identities", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -155,7 +154,7 @@ func (client UserIdentitiesClient) listNextResults(ctx context.Context, lastResu } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client UserIdentitiesClient) ListComplete(ctx context.Context, resourceGroupName string, serviceName string, UID string) (result UserIdentityCollectionIterator, err error) { +func (client UserIdentitiesClient) ListComplete(ctx context.Context, resourceGroupName string, serviceName string, userID string) (result UserIdentityCollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/UserIdentitiesClient.List") defer func() { @@ -166,6 +165,6 @@ func (client UserIdentitiesClient) ListComplete(ctx context.Context, resourceGro tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.List(ctx, resourceGroupName, serviceName, UID) + result.page, err = client.List(ctx, resourceGroupName, serviceName, userID) return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/usersubscription.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/usersubscription.go similarity index 79% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/usersubscription.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/usersubscription.go index 8ac49f338d51..62f52e349c5e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/usersubscription.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/usersubscription.go @@ -47,18 +47,19 @@ func NewUserSubscriptionClientWithBaseURI(baseURI string, subscriptionID string) // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// UID - user identifier. Must be unique in the current API Management service instance. -// filter - | Field | Supported operators | Supported functions | -// |--------------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | stateComment | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | userId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | productId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | state | eq | | +// userID - user identifier. Must be unique in the current API Management service instance. +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| stateComment | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| ownerId | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| scope | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
| userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, +// startswith, endswith |
| productId | filter | ge, le, eq, ne, gt, lt | substringof, contains, +// startswith, endswith |
// top - number of records to return. // skip - number of records to skip. -func (client UserSubscriptionClient) List(ctx context.Context, resourceGroupName string, serviceName string, UID string, filter string, top *int32, skip *int32) (result SubscriptionCollectionPage, err error) { +func (client UserSubscriptionClient) List(ctx context.Context, resourceGroupName string, serviceName string, userID string, filter string, top *int32, skip *int32) (result SubscriptionCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/UserSubscriptionClient.List") defer func() { @@ -74,10 +75,9 @@ func (client UserSubscriptionClient) List(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: UID, - Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: userID, + Constraints: []validation.Constraint{{Target: "userID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "userID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, @@ -88,7 +88,7 @@ func (client UserSubscriptionClient) List(ctx context.Context, resourceGroupName } result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, serviceName, UID, filter, top, skip) + req, err := client.ListPreparer(ctx, resourceGroupName, serviceName, userID, filter, top, skip) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.UserSubscriptionClient", "List", nil, "Failure preparing request") return @@ -110,15 +110,15 @@ func (client UserSubscriptionClient) List(ctx context.Context, resourceGroupName } // ListPreparer prepares the List request. -func (client UserSubscriptionClient) ListPreparer(ctx context.Context, resourceGroupName string, serviceName string, UID string, filter string, top *int32, skip *int32) (*http.Request, error) { +func (client UserSubscriptionClient) ListPreparer(ctx context.Context, resourceGroupName string, serviceName string, userID string, filter string, top *int32, skip *int32) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "uid": autorest.Encode("path", UID), + "userId": autorest.Encode("path", userID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -135,7 +135,7 @@ func (client UserSubscriptionClient) ListPreparer(ctx context.Context, resourceG preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}/subscriptions", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/subscriptions", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -181,7 +181,7 @@ func (client UserSubscriptionClient) listNextResults(ctx context.Context, lastRe } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client UserSubscriptionClient) ListComplete(ctx context.Context, resourceGroupName string, serviceName string, UID string, filter string, top *int32, skip *int32) (result SubscriptionCollectionIterator, err error) { +func (client UserSubscriptionClient) ListComplete(ctx context.Context, resourceGroupName string, serviceName string, userID string, filter string, top *int32, skip *int32) (result SubscriptionCollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/UserSubscriptionClient.List") defer func() { @@ -192,6 +192,6 @@ func (client UserSubscriptionClient) ListComplete(ctx context.Context, resourceG tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.List(ctx, resourceGroupName, serviceName, UID, filter, top, skip) + result.page, err = client.List(ctx, resourceGroupName, serviceName, userID, filter, top, skip) return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/version.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/version.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/version.go index 9147ce76f472..271f72ceb60d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/version.go @@ -21,7 +21,7 @@ import "github.com/Azure/azure-sdk-for-go/version" // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/" + version.Number + " apimanagement/2018-01-01" + return "Azure-SDK-For-Go/" + version.Number + " apimanagement/2019-12-01" } // Version returns the semantic version (see http://semver.org) of the client. diff --git a/vendor/modules.txt b/vendor/modules.txt index 42aa5743b21f..265b3242490b 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -9,7 +9,7 @@ cloud.google.com/go/storage # github.com/Azure/azure-sdk-for-go v41.2.0+incompatible github.com/Azure/azure-sdk-for-go/profiles/2017-03-09/resources/mgmt/resources github.com/Azure/azure-sdk-for-go/services/analysisservices/mgmt/2017-08-01/analysisservices -github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement +github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement github.com/Azure/azure-sdk-for-go/services/appconfiguration/mgmt/2019-10-01/appconfiguration github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation diff --git a/website/azurerm.erb b/website/azurerm.erb index 506f7eaf9332..9b2850c031b7 100644 --- a/website/azurerm.erb +++ b/website/azurerm.erb @@ -693,6 +693,10 @@ azurerm_api_management_logger +
  • + azurerm_api_management_named_value +
  • +
  • azurerm_api_management_openid_connect_provider
  • diff --git a/website/docs/r/api_management_named_value.html.markdown b/website/docs/r/api_management_named_value.html.markdown new file mode 100644 index 000000000000..c64ddeaba934 --- /dev/null +++ b/website/docs/r/api_management_named_value.html.markdown @@ -0,0 +1,83 @@ +--- +subcategory: "API Management" +layout: "azurerm" +page_title: "Azure Resource Manager: azurerm_api_management_named_value" +description: |- + Manages an API Management Named Value. +--- + +# azurerm_api_management_named_value + +Manages an API Management Named Value. + + +## Example Usage + +```hcl +resource "azurerm_resource_group" "example" { + name = "example-resources" + location = "West US" +} + +resource "azurerm_api_management" "example" { + name = "example-apim" + location = azurerm_resource_group.example.location + resource_group_name = azurerm_resource_group.example.name + publisher_name = "pub1" + publisher_email = "pub1@email.com" + + sku_name = "Developer_1" +} + +resource "azurerm_api_management_named_value" "example" { + name = "example-apimg" + resource_group_name = azurerm_resource_group.example.name + api_management_name = azurerm_api_management.example.name + display_name = "ExampleProperty" + value = "Example Value" +} +``` + + +## Argument Reference + +The following arguments are supported: + +* `name` - (Required) The name of the API Management Named Value. Changing this forces a new resource to be created. + +* `resource_group_name` - (Required) The name of the Resource Group in which the API Management Named Value should exist. Changing this forces a new resource to be created. + +* `api_management_name` - (Required) The name of the [API Management Service](api_management.html) in which the API Management Named Value should exist. Changing this forces a new resource to be created. + +* `display_name` - (Required) The display name of this API Management Named Value. + +* `value` - (Required) The value of this API Management Named Value. + +* `secret` - (Optional) Specifies whether the API Management Named Value is secret. Valid values are `true` or `false`. The default value is `false`. + +~> **NOTE:** setting the field `secret` to `true` doesn't make this field sensitive in Terraform, instead it marks the value as secret and encrypts the value in Azure. + +* `tags` - (Optional) A list of tags to be applied to the API Management Named Value. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The ID of the API Management Named Value. + +## Timeouts + +The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/docs/configuration/resources.html#timeouts) for certain actions: + +* `create` - (Defaults to 30 minutes) Used when creating the API Management Named Value. +* `update` - (Defaults to 30 minutes) Used when updating the API Management Named Value. +* `read` - (Defaults to 5 minutes) Used when retrieving the API Management Named Value. +* `delete` - (Defaults to 30 minutes) Used when deleting the API Management Named Value. + +## Import + +API Management Properties can be imported using the `resource id`, e.g. + +```shell +terraform import azurerm_api_management_named_value.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example-resources/providers/Microsoft.ApiManagement/service/example-apim/namedValues/example-apimp +``` diff --git a/website/docs/r/api_management_property.html.markdown b/website/docs/r/api_management_property.html.markdown index 73f7a2fe7f59..3143cfb2daf3 100644 --- a/website/docs/r/api_management_property.html.markdown +++ b/website/docs/r/api_management_property.html.markdown @@ -79,5 +79,5 @@ The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/d API Management Properties can be imported using the `resource id`, e.g. ```shell -terraform import azurerm_api_management_property.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example-resources/providers/Microsoft.ApiManagement/service/example-apim/properties/example-apimp +terraform import azurerm_api_management_property.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example-resources/providers/Microsoft.ApiManagement/service/example-apim/namedValues/example-apimp ```