diff --git a/profiles/preview/apimanagement/mgmt/apimanagement/models.go b/profiles/preview/apimanagement/mgmt/apimanagement/models.go index 431efa467967..301c9adda38b 100644 --- a/profiles/preview/apimanagement/mgmt/apimanagement/models.go +++ b/profiles/preview/apimanagement/mgmt/apimanagement/models.go @@ -419,6 +419,7 @@ type CertificateCreateOrUpdateParameters = original.CertificateCreateOrUpdatePar type CertificateCreateOrUpdateProperties = original.CertificateCreateOrUpdateProperties type CertificateInformation = original.CertificateInformation type ConnectivityStatusContract = original.ConnectivityStatusContract +type CurrentUserIdentity = original.CurrentUserIdentity type DeployConfigurationParameters = original.DeployConfigurationParameters type DiagnosticCollection = original.DiagnosticCollection type DiagnosticCollectionIterator = original.DiagnosticCollectionIterator @@ -470,7 +471,10 @@ type IssueCommentCollectionPage = original.IssueCommentCollectionPage type IssueCommentContract = original.IssueCommentContract type IssueCommentContractProperties = original.IssueCommentContractProperties type IssueContract = original.IssueContract +type IssueContractBaseProperties = original.IssueContractBaseProperties type IssueContractProperties = original.IssueContractProperties +type IssueUpdateContract = original.IssueUpdateContract +type IssueUpdateContractProperties = original.IssueUpdateContractProperties type ListNetworkStatusContractByLocation = original.ListNetworkStatusContractByLocation type LoggerCollection = original.LoggerCollection type LoggerCollectionIterator = original.LoggerCollectionIterator diff --git a/profiles/preview/preview/apimanagement/mgmt/apimanagement/models.go b/profiles/preview/preview/apimanagement/mgmt/apimanagement/models.go index 540ad8538c19..2c3197aa26bd 100644 --- a/profiles/preview/preview/apimanagement/mgmt/apimanagement/models.go +++ b/profiles/preview/preview/apimanagement/mgmt/apimanagement/models.go @@ -430,6 +430,7 @@ type CertificateCreateOrUpdateParameters = original.CertificateCreateOrUpdatePar type CertificateCreateOrUpdateProperties = original.CertificateCreateOrUpdateProperties type CertificateInformation = original.CertificateInformation type ConnectivityStatusContract = original.ConnectivityStatusContract +type CurrentUserIdentity = original.CurrentUserIdentity type DeployConfigurationParameters = original.DeployConfigurationParameters type DiagnosticCollection = original.DiagnosticCollection type DiagnosticCollectionIterator = original.DiagnosticCollectionIterator @@ -482,7 +483,10 @@ type IssueCommentCollectionPage = original.IssueCommentCollectionPage type IssueCommentContract = original.IssueCommentContract type IssueCommentContractProperties = original.IssueCommentContractProperties type IssueContract = original.IssueContract +type IssueContractBaseProperties = original.IssueContractBaseProperties type IssueContractProperties = original.IssueContractProperties +type IssueUpdateContract = original.IssueUpdateContract +type IssueUpdateContractProperties = original.IssueUpdateContractProperties type ListNetworkStatusContractByLocation = original.ListNetworkStatusContractByLocation type LoggerCollection = original.LoggerCollection type LoggerCollectionIterator = original.LoggerCollectionIterator diff --git a/services/apimanagement/mgmt/2016-07-07/apimanagement/models.go b/services/apimanagement/mgmt/2016-07-07/apimanagement/models.go index 5bcd7184a4cd..1c5fd217f754 100644 --- a/services/apimanagement/mgmt/2016-07-07/apimanagement/models.go +++ b/services/apimanagement/mgmt/2016-07-07/apimanagement/models.go @@ -1325,7 +1325,7 @@ func NewGroupCollectionPage(getNextPage func(context.Context, GroupCollection) ( // GroupContract developer group. type GroupContract struct { autorest.Response `json:"-"` - // ID - Uniquely identifies the group within the current API Management service instance. The value is a valid relative URL in the format of /groups/{groupid} where {groupid} is a group identifier. + // ID - Uniquely identifies the group within the current API Management service instance. The value is a valid relative URL in the format of /groups/{groupId} where {groupId} is a group identifier. ID *string `json:"id,omitempty"` // Name - Group name. Name *string `json:"name,omitempty"` @@ -2738,7 +2738,7 @@ type ReportRecordContract struct { Name *string `json:"name,omitempty"` // Timestamp - Start of aggregation period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. Timestamp *date.Time `json:"timestamp,omitempty"` - // Interval - Length of agregation period. + // Interval - Length of aggregation period. Interval *int64 `json:"interval,omitempty"` // Country - Country to which this record data is related. Country *string `json:"country,omitempty"` @@ -2758,7 +2758,7 @@ type ReportRecordContract struct { APIRegion *string `json:"apiRegion,omitempty"` // SubscriptionID - Subscription identifier path. /subscriptions/{subscriptionId} SubscriptionID *string `json:"subscriptionId,omitempty"` - // CallCountSuccess - Number of succesful calls. + // CallCountSuccess - Number of successful calls. CallCountSuccess *int32 `json:"callCountSuccess,omitempty"` // CallCountBlocked - Number of calls blocked due to invalid credentials. CallCountBlocked *int32 `json:"callCountBlocked,omitempty"` @@ -3077,7 +3077,7 @@ type ServiceManageDeploymentsParameters struct { AdditionalLocations *[]AdditionalRegion `json:"additionalLocations,omitempty"` // VpnConfiguration - Virtual network configuration. VpnConfiguration *VirtualNetworkConfiguration `json:"vpnConfiguration,omitempty"` - // VpnType - The type of VPN in which API Managemet 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 the API Management service deployment is set up inside a Virtual Network having an Intranet Facing Endpoint only. When vpnConfiguration is specified, vpnType must be specified. Possible values include: 'VirtualNetworkTypeNone', 'VirtualNetworkTypeExternal', 'VirtualNetworkTypeInternal' + // VpnType - 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 the API Management service deployment is set up inside a Virtual Network having an Intranet Facing Endpoint only. When vpnConfiguration is specified, vpnType must be specified. Possible values include: 'VirtualNetworkTypeNone', 'VirtualNetworkTypeExternal', 'VirtualNetworkTypeInternal' VpnType VirtualNetworkType `json:"vpnType,omitempty"` } @@ -3124,7 +3124,7 @@ type ServiceProperties struct { AdditionalLocations *[]AdditionalRegion `json:"additionalLocations,omitempty"` // CustomProperties - Custom properties of the API Management service, like disabling TLS 1.0. CustomProperties map[string]*string `json:"customProperties"` - // VpnType - The type of VPN in which API Managemet 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' + // VpnType - 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' VpnType VirtualNetworkType `json:"vpnType,omitempty"` } @@ -3411,7 +3411,7 @@ type SetObject struct { Value interface{} `json:"value,omitempty"` } -// SubscriptionCollection paged Subsctions list representation. +// SubscriptionCollection paged Subscriptions list representation. type SubscriptionCollection struct { autorest.Response `json:"-"` // Value - Page values. @@ -3594,7 +3594,7 @@ type SubscriptionContract struct { type SubscriptionCreateParameters 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 - Product (product id path) for which subscription is being created in form /products/{productId} ProductID *string `json:"productId,omitempty"` // Name - Subscription name. Name *string `json:"name,omitempty"` @@ -3977,7 +3977,7 @@ type VirtualNetworkConfiguration struct { Vnetid *string `json:"vnetid,omitempty"` // Subnetname - The name of the subnet. Subnetname *string `json:"subnetname,omitempty"` - // SubnetResourceID - The name of the subnet Resource ID. This has format /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/{virtual network name}/subnets/{subnet name}. + // SubnetResourceID - The name of the subnet Resource ID. This has format /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/{virtual network name}/subnets/{subnet name}. SubnetResourceID *string `json:"subnetResourceId,omitempty"` // Location - The location of the virtual network. Location *string `json:"location,omitempty"` diff --git a/services/apimanagement/mgmt/2016-07-07/apimanagement/property.go b/services/apimanagement/mgmt/2016-07-07/apimanagement/property.go index 52ff8e25a89f..282e097e1bcd 100644 --- a/services/apimanagement/mgmt/2016-07-07/apimanagement/property.go +++ b/services/apimanagement/mgmt/2016-07-07/apimanagement/property.go @@ -145,7 +145,7 @@ func (client PropertyClient) CreateOrUpdateResponder(resp *http.Response) (resul return } -// Delete deletes specific property from the the API Management service instance. +// Delete deletes specific property from the API Management service instance. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. diff --git a/services/apimanagement/mgmt/2016-07-07/apimanagement/reports.go b/services/apimanagement/mgmt/2016-07-07/apimanagement/reports.go index 59b83385874b..52ee1aee8819 100644 --- a/services/apimanagement/mgmt/2016-07-07/apimanagement/reports.go +++ b/services/apimanagement/mgmt/2016-07-07/apimanagement/reports.go @@ -52,7 +52,7 @@ func NewReportsClientWithBaseURI(baseURI string, subscriptionID string) ReportsC // interval - by time interval. This value is only applicable to ByTime aggregation. 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 TimSpan to a valid -// interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, secconds)) +// interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)) func (client ReportsClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, aggregation ReportsAggregation, filter string, top *int32, skip *int32, interval string) (result ReportCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ReportsClient.ListByService") diff --git a/services/apimanagement/mgmt/2016-07-07/apimanagement/subscriptions.go b/services/apimanagement/mgmt/2016-07-07/apimanagement/subscriptions.go index edd1b76fffa0..1ca5ff921e01 100644 --- a/services/apimanagement/mgmt/2016-07-07/apimanagement/subscriptions.go +++ b/services/apimanagement/mgmt/2016-07-07/apimanagement/subscriptions.go @@ -645,7 +645,7 @@ func (client SubscriptionsClient) RegenerateSecondaryKeyResponder(resp *http.Res return } -// Update updates the details of a subscription specificied by its identifier. +// Update updates the details of a subscription specified by its identifier. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. diff --git a/services/apimanagement/mgmt/2016-10-10/apimanagement/models.go b/services/apimanagement/mgmt/2016-10-10/apimanagement/models.go index c6a7ecafb8b1..67480f82f475 100644 --- a/services/apimanagement/mgmt/2016-10-10/apimanagement/models.go +++ b/services/apimanagement/mgmt/2016-10-10/apimanagement/models.go @@ -1806,7 +1806,7 @@ func NewGroupCollectionPage(getNextPage func(context.Context, GroupCollection) ( // GroupContract developer group. type GroupContract struct { autorest.Response `json:"-"` - // ID - Uniquely identifies the group within the current API Management service instance. The value is a valid relative URL in the format of /groups/{groupid} where {groupid} is a group identifier. + // ID - Uniquely identifies the group within the current API Management service instance. The value is a valid relative URL in the format of /groups/{groupId} where {groupId} is a group identifier. ID *string `json:"id,omitempty"` // Name - Group name. Name *string `json:"name,omitempty"` @@ -3422,7 +3422,7 @@ type ReportRecordContract struct { Name *string `json:"name,omitempty"` // Timestamp - Start of aggregation period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. Timestamp *date.Time `json:"timestamp,omitempty"` - // Interval - Length of agregation period. + // Interval - Length of aggregation period. Interval *int64 `json:"interval,omitempty"` // Country - Country to which this record data is related. Country *string `json:"country,omitempty"` @@ -3442,9 +3442,9 @@ type ReportRecordContract struct { APIRegion *string `json:"apiRegion,omitempty"` // SubscriptionID - Subscription identifier path. /subscriptions/{subscriptionId} SubscriptionID *string `json:"subscriptionId,omitempty"` - // CallCountSuccess - Number of succesful calls. This includes calls returning HttpStatusCode <= 301 and HttpStatusCode.NotModified and HttpStatusCode.TemporaryRedirect + // CallCountSuccess - Number of successful calls. This includes calls returning HttpStatusCode <= 301 and HttpStatusCode.NotModified and HttpStatusCode.TemporaryRedirect CallCountSuccess *int32 `json:"callCountSuccess,omitempty"` - // CallCountBlocked - Number of calls blocked due to invalid credentials. This includes calls returning HttpStatusCode.Unauthorize and HttpStatusCode.Forbidden and HttpStatusCode.TooManyRequests + // CallCountBlocked - Number of calls blocked due to invalid credentials. This includes calls returning HttpStatusCode.Unauthorized and HttpStatusCode.Forbidden and HttpStatusCode.TooManyRequests CallCountBlocked *int32 `json:"callCountBlocked,omitempty"` // CallCountFailed - Number of calls failed due to proxy or backend errors. This includes calls returning HttpStatusCode.BadRequest(400) and any Code between HttpStatusCode.InternalServerError (500) and 600 CallCountFailed *int32 `json:"callCountFailed,omitempty"` @@ -3729,7 +3729,7 @@ type ServiceManageDeploymentsParameters struct { AdditionalLocations *[]AdditionalRegion `json:"additionalLocations,omitempty"` // VpnConfiguration - Virtual network configuration. VpnConfiguration *VirtualNetworkConfiguration `json:"vpnConfiguration,omitempty"` - // VpnType - The type of VPN in which API Managemet 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 the API Management service deployment is set up inside a Virtual Network having an Intranet Facing Endpoint only. When vpnConfiguration is specified, vpnType must be specified. Possible values include: 'VirtualNetworkTypeNone', 'VirtualNetworkTypeExternal', 'VirtualNetworkTypeInternal' + // VpnType - 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 the API Management service deployment is set up inside a Virtual Network having an Intranet Facing Endpoint only. When vpnConfiguration is specified, vpnType must be specified. Possible values include: 'VirtualNetworkTypeNone', 'VirtualNetworkTypeExternal', 'VirtualNetworkTypeInternal' VpnType VirtualNetworkType `json:"vpnType,omitempty"` } @@ -3776,7 +3776,7 @@ type ServiceProperties struct { AdditionalLocations *[]AdditionalRegion `json:"additionalLocations,omitempty"` // CustomProperties - Custom properties of the API Management service, like disabling TLS 1.0. CustomProperties map[string]*string `json:"customProperties"` - // VpnType - The type of VPN in which API Managemet 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' + // VpnType - 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' VpnType VirtualNetworkType `json:"vpnType,omitempty"` } @@ -4423,7 +4423,7 @@ type SubscriptionContract struct { type SubscriptionCreateParameters 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 - Product (product id path) for which subscription is being created in form /products/{productId} ProductID *string `json:"productId,omitempty"` // Name - Subscription name. Name *string `json:"name,omitempty"` diff --git a/services/apimanagement/mgmt/2016-10-10/apimanagement/property.go b/services/apimanagement/mgmt/2016-10-10/apimanagement/property.go index abc27ff09fe3..40fe3190003a 100644 --- a/services/apimanagement/mgmt/2016-10-10/apimanagement/property.go +++ b/services/apimanagement/mgmt/2016-10-10/apimanagement/property.go @@ -145,7 +145,7 @@ func (client PropertyClient) CreateOrUpdateResponder(resp *http.Response) (resul return } -// Delete deletes specific property from the the API Management service instance. +// Delete deletes specific property from the API Management service instance. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. diff --git a/services/apimanagement/mgmt/2016-10-10/apimanagement/reports.go b/services/apimanagement/mgmt/2016-10-10/apimanagement/reports.go index 4363458ae918..fa93f52565c2 100644 --- a/services/apimanagement/mgmt/2016-10-10/apimanagement/reports.go +++ b/services/apimanagement/mgmt/2016-10-10/apimanagement/reports.go @@ -52,7 +52,7 @@ func NewReportsClientWithBaseURI(baseURI string, subscriptionID string) ReportsC // interval - by time interval. This value is only applicable to ByTime aggregation. 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 TimSpan to a valid -// interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, secconds)) +// interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)) func (client ReportsClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, aggregation ReportsAggregation, filter string, top *int32, skip *int32, interval *string) (result ReportCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ReportsClient.ListByService") diff --git a/services/apimanagement/mgmt/2016-10-10/apimanagement/subscriptions.go b/services/apimanagement/mgmt/2016-10-10/apimanagement/subscriptions.go index 56e84a31f063..b639483de351 100644 --- a/services/apimanagement/mgmt/2016-10-10/apimanagement/subscriptions.go +++ b/services/apimanagement/mgmt/2016-10-10/apimanagement/subscriptions.go @@ -661,7 +661,7 @@ func (client SubscriptionsClient) RegenerateSecondaryKeyResponder(resp *http.Res return } -// Update updates the details of a subscription specificied by its identifier. +// Update updates the details of a subscription specified by its identifier. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. diff --git a/services/apimanagement/mgmt/2017-03-01/apimanagement/diagnosticlogger.go b/services/apimanagement/mgmt/2017-03-01/apimanagement/diagnosticlogger.go index 59ad83f13132..9ee7681d2c29 100644 --- a/services/apimanagement/mgmt/2017-03-01/apimanagement/diagnosticlogger.go +++ b/services/apimanagement/mgmt/2017-03-01/apimanagement/diagnosticlogger.go @@ -136,7 +136,7 @@ func (client DiagnosticLoggerClient) CheckEntityExistsResponder(resp *http.Respo return } -// CreateOrUpdate attaches a logger to a dignostic. +// CreateOrUpdate attaches a logger to a diagnostic. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. @@ -327,7 +327,7 @@ func (client DiagnosticLoggerClient) DeleteResponder(resp *http.Response) (resul return } -// ListByService lists all loggers assosiated with the specified Diagnostic of the API Management service instance. +// 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. diff --git a/services/apimanagement/mgmt/2017-03-01/apimanagement/models.go b/services/apimanagement/mgmt/2017-03-01/apimanagement/models.go index d128ea1da24d..f098e525c725 100644 --- a/services/apimanagement/mgmt/2017-03-01/apimanagement/models.go +++ b/services/apimanagement/mgmt/2017-03-01/apimanagement/models.go @@ -2728,7 +2728,7 @@ type BackendReconnectProperties struct { type BackendServiceFabricClusterProperties struct { // ClientCertificatethumbprint - The client certificate thumbprint for the management endpoint. ClientCertificatethumbprint *string `json:"clientCertificatethumbprint,omitempty"` - // MaxPartitionResolutionRetries - Maximum number of retries while attempting resolve the parition. + // MaxPartitionResolutionRetries - Maximum number of retries while attempting resolve the partition. MaxPartitionResolutionRetries *int32 `json:"maxPartitionResolutionRetries,omitempty"` // ManagementEndpoints - The cluster management endpoint. ManagementEndpoints *[]string `json:"managementEndpoints,omitempty"` @@ -5257,7 +5257,7 @@ func (lcp LoggerContractProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// LoggerSamplingContract sampling settigs contract. +// LoggerSamplingContract sampling settings contract. type LoggerSamplingContract struct { // LoggerSamplingProperties - Sampling settings entity contract properties. *LoggerSamplingProperties `json:"properties,omitempty"` @@ -8039,7 +8039,7 @@ type ReportRecordContract struct { Name *string `json:"name,omitempty"` // Timestamp - Start of aggregation period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. Timestamp *date.Time `json:"timestamp,omitempty"` - // Interval - Length of agregation period. Interval must be multiple of 15 minutes and may not be zero. The value should be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations). + // Interval - Length of aggregation period. Interval must be multiple of 15 minutes and may not be zero. The value should be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations). Interval *string `json:"interval,omitempty"` // Country - Country to which this record data is related. Country *string `json:"country,omitempty"` @@ -8059,9 +8059,9 @@ type ReportRecordContract struct { APIRegion *string `json:"apiRegion,omitempty"` // SubscriptionID - Subscription identifier path. /subscriptions/{subscriptionId} SubscriptionID *string `json:"subscriptionId,omitempty"` - // CallCountSuccess - Number of succesful calls. This includes calls returning HttpStatusCode <= 301 and HttpStatusCode.NotModified and HttpStatusCode.TemporaryRedirect + // CallCountSuccess - Number of successful calls. This includes calls returning HttpStatusCode <= 301 and HttpStatusCode.NotModified and HttpStatusCode.TemporaryRedirect CallCountSuccess *int32 `json:"callCountSuccess,omitempty"` - // CallCountBlocked - Number of calls blocked due to invalid credentials. This includes calls returning HttpStatusCode.Unauthorize and HttpStatusCode.Forbidden and HttpStatusCode.TooManyRequests + // CallCountBlocked - Number of calls blocked due to invalid credentials. This includes calls returning HttpStatusCode.Unauthorized and HttpStatusCode.Forbidden and HttpStatusCode.TooManyRequests CallCountBlocked *int32 `json:"callCountBlocked,omitempty"` // CallCountFailed - Number of calls failed due to proxy or backend errors. This includes calls returning HttpStatusCode.BadRequest(400) and any Code between HttpStatusCode.InternalServerError (500) and 600 CallCountFailed *int32 `json:"callCountFailed,omitempty"` @@ -8148,7 +8148,7 @@ type RequestReportRecordContract struct { ResponseSize *int32 `json:"responseSize,omitempty"` // Timestamp - The date and time when this request was received by the gateway in ISO 8601 format. Timestamp *date.Time `json:"timestamp,omitempty"` - // Cache - Specifies if response cache was involved in generating the response. If the value is none, the cache was not used. If the value is hit, cached response was returned. If the value is miss, the cache was used but lookup resulted in a miss and request was fullfilled by the backend. + // Cache - Specifies if response cache was involved in generating the response. If the value is none, the cache was not used. If the value is hit, cached response was returned. If the value is miss, the cache was used but lookup resulted in a miss and request was fulfilled by the backend. Cache *string `json:"cache,omitempty"` // APITime - The total time it took to process this request. APITime *float64 `json:"apiTime,omitempty"` @@ -8591,7 +8591,7 @@ type ServiceBaseProperties struct { 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"` - // VirtualNetworkType - The type of VPN in which API Managemet 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 - 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"` } @@ -8894,7 +8894,7 @@ type ServiceProperties struct { 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"` - // VirtualNetworkType - The type of VPN in which API Managemet 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 - 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"` } @@ -9386,7 +9386,7 @@ type ServiceUpdateProperties struct { 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"` - // VirtualNetworkType - The type of VPN in which API Managemet 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 - 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"` } @@ -9721,7 +9721,7 @@ type SubscriptionContractProperties struct { 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 - Product (product id path) for which subscription is being created in form /products/{productId} ProductID *string `json:"productId,omitempty"` // DisplayName - Subscription name. DisplayName *string `json:"displayName,omitempty"` @@ -10758,7 +10758,7 @@ type TermsOfServiceProperties struct { Text *string `json:"text,omitempty"` // Enabled - Display terms of service during a sign-up process. Enabled *bool `json:"enabled,omitempty"` - // ConsentRequired - Ask user for concent. + // ConsentRequired - Ask user for consent. ConsentRequired *bool `json:"consentRequired,omitempty"` } diff --git a/services/apimanagement/mgmt/2017-03-01/apimanagement/property.go b/services/apimanagement/mgmt/2017-03-01/apimanagement/property.go index 67ecd742f049..4a31d5ad8483 100644 --- a/services/apimanagement/mgmt/2017-03-01/apimanagement/property.go +++ b/services/apimanagement/mgmt/2017-03-01/apimanagement/property.go @@ -146,7 +146,7 @@ func (client PropertyClient) CreateOrUpdateResponder(resp *http.Response) (resul return } -// Delete deletes specific property from the the API Management service instance. +// Delete deletes specific property from the API Management service instance. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. diff --git a/services/apimanagement/mgmt/2017-03-01/apimanagement/reports.go b/services/apimanagement/mgmt/2017-03-01/apimanagement/reports.go index d89ab416e297..b07f66bc4930 100644 --- a/services/apimanagement/mgmt/2017-03-01/apimanagement/reports.go +++ b/services/apimanagement/mgmt/2017-03-01/apimanagement/reports.go @@ -180,7 +180,7 @@ func (client ReportsClient) ListByAPIComplete(ctx context.Context, resourceGroup return } -// ListByGeo lists report records by GeoGraphy. +// ListByGeo lists report records by geography. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. @@ -847,7 +847,7 @@ func (client ReportsClient) ListBySubscriptionComplete(ctx context.Context, reso // serviceName - the name of the API Management service. // 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, secconds)) +// TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)) // filter - the filter to apply on the operation. // top - number of records to return. // skip - number of records to skip. diff --git a/services/apimanagement/mgmt/2017-03-01/apimanagement/subscription.go b/services/apimanagement/mgmt/2017-03-01/apimanagement/subscription.go index 737528fa7693..b342a4ea465c 100644 --- a/services/apimanagement/mgmt/2017-03-01/apimanagement/subscription.go +++ b/services/apimanagement/mgmt/2017-03-01/apimanagement/subscription.go @@ -754,7 +754,7 @@ func (client SubscriptionClient) RegenerateSecondaryKeyResponder(resp *http.Resp return } -// Update updates the details of a subscription specificied by its identifier. +// Update updates the details of a subscription specified by its identifier. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. diff --git a/services/apimanagement/mgmt/2017-03-01/apimanagement/tagdescription.go b/services/apimanagement/mgmt/2017-03-01/apimanagement/tagdescription.go index b7768d193f12..7131709dc293 100644 --- a/services/apimanagement/mgmt/2017-03-01/apimanagement/tagdescription.go +++ b/services/apimanagement/mgmt/2017-03-01/apimanagement/tagdescription.go @@ -41,7 +41,7 @@ func NewTagDescriptionClientWithBaseURI(baseURI string, subscriptionID string) T return TagDescriptionClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate create/Update tag fescription in scope of the Api. +// CreateOrUpdate create/Update tag description in scope of the Api. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. diff --git a/services/apimanagement/mgmt/2018-01-01/apimanagement/apidiagnosticlogger.go b/services/apimanagement/mgmt/2018-01-01/apimanagement/apidiagnosticlogger.go index b2275d6a34d8..39adb12ed735 100644 --- a/services/apimanagement/mgmt/2018-01-01/apimanagement/apidiagnosticlogger.go +++ b/services/apimanagement/mgmt/2018-01-01/apimanagement/apidiagnosticlogger.go @@ -142,7 +142,7 @@ func (client APIDiagnosticLoggerClient) CheckEntityExistsResponder(resp *http.Re return } -// CreateOrUpdate attaches a logger to a dignostic for an API. +// 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. @@ -345,7 +345,7 @@ func (client APIDiagnosticLoggerClient) DeleteResponder(resp *http.Response) (re return } -// ListByService lists all loggers assosiated with the specified Diagnostic of an API. +// 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. diff --git a/services/apimanagement/mgmt/2018-01-01/apimanagement/apiissue.go b/services/apimanagement/mgmt/2018-01-01/apimanagement/apiissue.go index 4a8154dfffc0..518bf144696e 100644 --- a/services/apimanagement/mgmt/2018-01-01/apimanagement/apiissue.go +++ b/services/apimanagement/mgmt/2018-01-01/apimanagement/apiissue.go @@ -445,7 +445,7 @@ func (client APIIssueClient) GetEntityTagResponder(resp *http.Response) (result return } -// ListByService lists all issues assosiated with the specified API. +// ListByService lists all issues associated with the specified API. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. @@ -595,3 +595,108 @@ func (client APIIssueClient) ListByServiceComplete(ctx context.Context, resource result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) return } + +// Update updates an existing issue 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. +// 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. +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") + 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: 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.APIIssueClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, apiid, issueID, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client APIIssueClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, parameters IssueUpdateContract, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "issueId": autorest.Encode("path", issueID), + "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.AsPatch(), + 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))) + } + 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 APIIssueClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client APIIssueClient) 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/services/apimanagement/mgmt/2018-01-01/apimanagement/apiissueattachment.go b/services/apimanagement/mgmt/2018-01-01/apimanagement/apiissueattachment.go index e113e8042e88..29a371da081f 100644 --- a/services/apimanagement/mgmt/2018-01-01/apimanagement/apiissueattachment.go +++ b/services/apimanagement/mgmt/2018-01-01/apimanagement/apiissueattachment.go @@ -469,7 +469,7 @@ func (client APIIssueAttachmentClient) GetEntityTagResponder(resp *http.Response return } -// ListByService lists all comments for the Issue assosiated with the specified API. +// ListByService lists all comments for the Issue associated with the specified API. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. diff --git a/services/apimanagement/mgmt/2018-01-01/apimanagement/apiissuecomment.go b/services/apimanagement/mgmt/2018-01-01/apimanagement/apiissuecomment.go index f843401e4333..25bfa4cf393f 100644 --- a/services/apimanagement/mgmt/2018-01-01/apimanagement/apiissuecomment.go +++ b/services/apimanagement/mgmt/2018-01-01/apimanagement/apiissuecomment.go @@ -468,7 +468,7 @@ func (client APIIssueCommentClient) GetEntityTagResponder(resp *http.Response) ( return } -// ListByService lists all comments for the Issue assosiated with the specified API. +// ListByService lists all comments for the Issue associated with the specified API. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. diff --git a/services/apimanagement/mgmt/2018-01-01/apimanagement/apimanagementapi/interfaces.go b/services/apimanagement/mgmt/2018-01-01/apimanagement/apimanagementapi/interfaces.go index 40beed733bd0..455582740838 100644 --- a/services/apimanagement/mgmt/2018-01-01/apimanagement/apimanagementapi/interfaces.go +++ b/services/apimanagement/mgmt/2018-01-01/apimanagement/apimanagementapi/interfaces.go @@ -161,6 +161,7 @@ type APIIssueClientAPI interface { Get(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string) (result apimanagement.IssueContract, err error) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string) (result autorest.Response, err error) ListByService(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result apimanagement.IssueCollectionPage, err error) + Update(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, parameters apimanagement.IssueUpdateContract, ifMatch string) (result autorest.Response, err error) } var _ APIIssueClientAPI = (*apimanagement.APIIssueClient)(nil) @@ -602,6 +603,7 @@ type UserClientAPI interface { GenerateSsoURL(ctx context.Context, resourceGroupName string, serviceName string, UID string) (result apimanagement.GenerateSsoURLResult, err error) Get(ctx context.Context, resourceGroupName string, serviceName string, UID string) (result apimanagement.UserContract, err error) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, UID string) (result autorest.Response, err error) + GetIdentity(ctx context.Context, resourceGroupName string, serviceName string) (result apimanagement.CurrentUserIdentity, err error) GetSharedAccessToken(ctx context.Context, resourceGroupName string, serviceName string, UID string, parameters apimanagement.UserTokenParameters) (result apimanagement.UserTokenResult, err error) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result apimanagement.UserCollectionPage, err error) Update(ctx context.Context, resourceGroupName string, serviceName string, UID string, parameters apimanagement.UserUpdateParameters, ifMatch string) (result autorest.Response, err error) diff --git a/services/apimanagement/mgmt/2018-01-01/apimanagement/diagnosticlogger.go b/services/apimanagement/mgmt/2018-01-01/apimanagement/diagnosticlogger.go index ae70691ff46f..45d6f3b4e6a4 100644 --- a/services/apimanagement/mgmt/2018-01-01/apimanagement/diagnosticlogger.go +++ b/services/apimanagement/mgmt/2018-01-01/apimanagement/diagnosticlogger.go @@ -136,7 +136,7 @@ func (client DiagnosticLoggerClient) CheckEntityExistsResponder(resp *http.Respo return } -// CreateOrUpdate attaches a logger to a dignostic. +// CreateOrUpdate attaches a logger to a diagnostic. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. @@ -327,7 +327,7 @@ func (client DiagnosticLoggerClient) DeleteResponder(resp *http.Response) (resul return } -// ListByService lists all loggers assosiated with the specified Diagnostic of the API Management service instance. +// 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. diff --git a/services/apimanagement/mgmt/2018-01-01/apimanagement/models.go b/services/apimanagement/mgmt/2018-01-01/apimanagement/models.go index 7b354b09db3d..49e31a25e6e8 100644 --- a/services/apimanagement/mgmt/2018-01-01/apimanagement/models.go +++ b/services/apimanagement/mgmt/2018-01-01/apimanagement/models.go @@ -2788,7 +2788,7 @@ func (brc *BackendReconnectContract) UnmarshalJSON(body []byte) error { // BackendReconnectProperties properties to control reconnect requests. type BackendReconnectProperties struct { - // After - Duration in ISO8601 format after which reconnect will be initiated. Minimum duration of the Reconect is PT2M. + // After - Duration in ISO8601 format after which reconnect will be initiated. Minimum duration of the Reconnect is PT2M. After *string `json:"after,omitempty"` } @@ -2796,7 +2796,7 @@ type BackendReconnectProperties struct { type BackendServiceFabricClusterProperties struct { // ClientCertificatethumbprint - The client certificate thumbprint for the management endpoint. ClientCertificatethumbprint *string `json:"clientCertificatethumbprint,omitempty"` - // MaxPartitionResolutionRetries - Maximum number of retries while attempting resolve the parition. + // MaxPartitionResolutionRetries - Maximum number of retries while attempting resolve the partition. MaxPartitionResolutionRetries *int32 `json:"maxPartitionResolutionRetries,omitempty"` // ManagementEndpoints - The cluster management endpoint. ManagementEndpoints *[]string `json:"managementEndpoints,omitempty"` @@ -3028,7 +3028,7 @@ type CertificateConfiguration struct { 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 - 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"` @@ -3198,6 +3198,13 @@ type ConnectivityStatusContract struct { 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. @@ -5217,18 +5224,83 @@ 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"` +} + // 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 json.Marshal(objectMap) +} + +// 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 +} + +// 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"` } @@ -8317,7 +8389,7 @@ type ReportRecordContract struct { Name *string `json:"name,omitempty"` // Timestamp - Start of aggregation period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. Timestamp *date.Time `json:"timestamp,omitempty"` - // Interval - Length of agregation period. Interval must be multiple of 15 minutes and may not be zero. The value should be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations). + // Interval - Length of aggregation period. Interval must be multiple of 15 minutes and may not be zero. The value should be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations). Interval *string `json:"interval,omitempty"` // Country - Country to which this record data is related. Country *string `json:"country,omitempty"` @@ -8337,9 +8409,9 @@ type ReportRecordContract struct { APIRegion *string `json:"apiRegion,omitempty"` // SubscriptionID - Subscription identifier path. /subscriptions/{subscriptionId} SubscriptionID *string `json:"subscriptionId,omitempty"` - // CallCountSuccess - Number of succesful calls. This includes calls returning HttpStatusCode <= 301 and HttpStatusCode.NotModified and HttpStatusCode.TemporaryRedirect + // CallCountSuccess - Number of successful calls. This includes calls returning HttpStatusCode <= 301 and HttpStatusCode.NotModified and HttpStatusCode.TemporaryRedirect CallCountSuccess *int32 `json:"callCountSuccess,omitempty"` - // CallCountBlocked - Number of calls blocked due to invalid credentials. This includes calls returning HttpStatusCode.Unauthorize and HttpStatusCode.Forbidden and HttpStatusCode.TooManyRequests + // CallCountBlocked - Number of calls blocked due to invalid credentials. This includes calls returning HttpStatusCode.Unauthorized and HttpStatusCode.Forbidden and HttpStatusCode.TooManyRequests CallCountBlocked *int32 `json:"callCountBlocked,omitempty"` // CallCountFailed - Number of calls failed due to proxy or backend errors. This includes calls returning HttpStatusCode.BadRequest(400) and any Code between HttpStatusCode.InternalServerError (500) and 600 CallCountFailed *int32 `json:"callCountFailed,omitempty"` @@ -8426,7 +8498,7 @@ type RequestReportRecordContract struct { ResponseSize *int32 `json:"responseSize,omitempty"` // Timestamp - The date and time when this request was received by the gateway in ISO 8601 format. Timestamp *date.Time `json:"timestamp,omitempty"` - // Cache - Specifies if response cache was involved in generating the response. If the value is none, the cache was not used. If the value is hit, cached response was returned. If the value is miss, the cache was used but lookup resulted in a miss and request was fullfilled by the backend. + // Cache - Specifies if response cache was involved in generating the response. If the value is none, the cache was not used. If the value is hit, cached response was returned. If the value is miss, the cache was used but lookup resulted in a miss and request was fulfilled by the backend. Cache *string `json:"cache,omitempty"` // APITime - The total time it took to process this request. APITime *float64 `json:"apiTime,omitempty"` @@ -8871,7 +8943,7 @@ type ServiceBaseProperties struct { 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"` - // VirtualNetworkType - The type of VPN in which API Managemet 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 - 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"` } @@ -9179,7 +9251,7 @@ type ServiceProperties struct { 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"` - // VirtualNetworkType - The type of VPN in which API Managemet 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 - 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"` } @@ -9676,7 +9748,7 @@ type ServiceUpdateProperties struct { 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"` - // VirtualNetworkType - The type of VPN in which API Managemet 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 - 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"` } @@ -10014,7 +10086,7 @@ type SubscriptionContractProperties struct { 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 - Product (product id path) for which subscription is being created in form /products/{productId} ProductID *string `json:"productId,omitempty"` // DisplayName - Subscription name. DisplayName *string `json:"displayName,omitempty"` diff --git a/services/apimanagement/mgmt/2018-01-01/apimanagement/property.go b/services/apimanagement/mgmt/2018-01-01/apimanagement/property.go index 7b9c9df4f7ee..9de3170f7817 100644 --- a/services/apimanagement/mgmt/2018-01-01/apimanagement/property.go +++ b/services/apimanagement/mgmt/2018-01-01/apimanagement/property.go @@ -151,7 +151,7 @@ func (client PropertyClient) CreateOrUpdateResponder(resp *http.Response) (resul return } -// Delete deletes specific property from the the API Management service instance. +// Delete deletes specific property from the API Management service instance. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. diff --git a/services/apimanagement/mgmt/2018-01-01/apimanagement/reports.go b/services/apimanagement/mgmt/2018-01-01/apimanagement/reports.go index 5ccb3ae2dc97..214970f4baf3 100644 --- a/services/apimanagement/mgmt/2018-01-01/apimanagement/reports.go +++ b/services/apimanagement/mgmt/2018-01-01/apimanagement/reports.go @@ -180,7 +180,7 @@ func (client ReportsClient) ListByAPIComplete(ctx context.Context, resourceGroup return } -// ListByGeo lists report records by GeoGraphy. +// ListByGeo lists report records by geography. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. @@ -847,7 +847,7 @@ func (client ReportsClient) ListBySubscriptionComplete(ctx context.Context, reso // serviceName - the name of the API Management service. // 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, secconds)) +// TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)) // filter - the filter to apply on the operation. // top - number of records to return. // skip - number of records to skip. diff --git a/services/apimanagement/mgmt/2018-01-01/apimanagement/subscription.go b/services/apimanagement/mgmt/2018-01-01/apimanagement/subscription.go index d41f0b5f155e..77dfe38ae184 100644 --- a/services/apimanagement/mgmt/2018-01-01/apimanagement/subscription.go +++ b/services/apimanagement/mgmt/2018-01-01/apimanagement/subscription.go @@ -765,7 +765,7 @@ func (client SubscriptionClient) RegenerateSecondaryKeyResponder(resp *http.Resp return } -// Update updates the details of a subscription specificied by its identifier. +// Update updates the details of a subscription specified by its identifier. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. diff --git a/services/apimanagement/mgmt/2018-01-01/apimanagement/tagdescription.go b/services/apimanagement/mgmt/2018-01-01/apimanagement/tagdescription.go index d88a19115221..f740dfd5ae41 100644 --- a/services/apimanagement/mgmt/2018-01-01/apimanagement/tagdescription.go +++ b/services/apimanagement/mgmt/2018-01-01/apimanagement/tagdescription.go @@ -41,7 +41,7 @@ func NewTagDescriptionClientWithBaseURI(baseURI string, subscriptionID string) T return TagDescriptionClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate create/Update tag fescription in scope of the Api. +// CreateOrUpdate create/Update tag description in scope of the Api. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. diff --git a/services/apimanagement/mgmt/2018-01-01/apimanagement/user.go b/services/apimanagement/mgmt/2018-01-01/apimanagement/user.go index 3f5dd69dc040..1364af2f9fde 100644 --- a/services/apimanagement/mgmt/2018-01-01/apimanagement/user.go +++ b/services/apimanagement/mgmt/2018-01-01/apimanagement/user.go @@ -529,6 +529,91 @@ 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 autorest.SendWithSender(client, 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. diff --git a/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apiissue.go b/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apiissue.go index 2d7dcd9a3ca8..5e1f499c425a 100644 --- a/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apiissue.go +++ b/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apiissue.go @@ -445,7 +445,7 @@ func (client APIIssueClient) GetEntityTagResponder(resp *http.Response) (result return } -// ListByService lists all issues assosiated with the specified API. +// ListByService lists all issues associated with the specified API. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. @@ -595,3 +595,108 @@ func (client APIIssueClient) ListByServiceComplete(ctx context.Context, resource result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) return } + +// Update updates an existing issue 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. +// 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. +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") + 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: 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.APIIssueClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, apiid, issueID, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APIIssueClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client APIIssueClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, parameters IssueUpdateContract, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "issueId": autorest.Encode("path", issueID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-06-01-preview" + 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}/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))) + } + 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 APIIssueClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client APIIssueClient) 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/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apiissueattachment.go b/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apiissueattachment.go index 8a00e205b162..84a019968f90 100644 --- a/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apiissueattachment.go +++ b/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apiissueattachment.go @@ -469,7 +469,7 @@ func (client APIIssueAttachmentClient) GetEntityTagResponder(resp *http.Response return } -// ListByService lists all comments for the Issue assosiated with the specified API. +// ListByService lists all comments for the Issue associated with the specified API. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. diff --git a/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apiissuecomment.go b/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apiissuecomment.go index fcda293b94c6..e556b5bd91ba 100644 --- a/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apiissuecomment.go +++ b/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apiissuecomment.go @@ -468,7 +468,7 @@ func (client APIIssueCommentClient) GetEntityTagResponder(resp *http.Response) ( return } -// ListByService lists all comments for the Issue assosiated with the specified API. +// ListByService lists all comments for the Issue associated with the specified API. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. diff --git a/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apimanagementapi/interfaces.go b/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apimanagementapi/interfaces.go index 1a6819c4234f..33f2b230a42e 100644 --- a/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apimanagementapi/interfaces.go +++ b/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/apimanagementapi/interfaces.go @@ -151,6 +151,7 @@ type APIIssueClientAPI interface { Get(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string) (result apimanagement.IssueContract, err error) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string) (result autorest.Response, err error) ListByService(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result apimanagement.IssueCollectionPage, err error) + Update(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, parameters apimanagement.IssueUpdateContract, ifMatch string) (result autorest.Response, err error) } var _ APIIssueClientAPI = (*apimanagement.APIIssueClient)(nil) @@ -583,6 +584,7 @@ type UserClientAPI interface { GenerateSsoURL(ctx context.Context, resourceGroupName string, serviceName string, UID string) (result apimanagement.GenerateSsoURLResult, err error) Get(ctx context.Context, resourceGroupName string, serviceName string, UID string) (result apimanagement.UserContract, err error) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, UID string) (result autorest.Response, err error) + GetIdentity(ctx context.Context, resourceGroupName string, serviceName string) (result apimanagement.CurrentUserIdentity, err error) GetSharedAccessToken(ctx context.Context, resourceGroupName string, serviceName string, UID string, parameters apimanagement.UserTokenParameters) (result apimanagement.UserTokenResult, err error) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result apimanagement.UserCollectionPage, err error) Update(ctx context.Context, resourceGroupName string, serviceName string, UID string, parameters apimanagement.UserUpdateParameters, ifMatch string) (result autorest.Response, err error) diff --git a/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/models.go b/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/models.go index 736018358c13..80b4ccba2999 100644 --- a/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/models.go +++ b/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/models.go @@ -2824,7 +2824,7 @@ func (brc *BackendReconnectContract) UnmarshalJSON(body []byte) error { // BackendReconnectProperties properties to control reconnect requests. type BackendReconnectProperties struct { - // After - Duration in ISO8601 format after which reconnect will be initiated. Minimum duration of the Reconect is PT2M. + // After - Duration in ISO8601 format after which reconnect will be initiated. Minimum duration of the Reconnect is PT2M. After *string `json:"after,omitempty"` } @@ -2832,7 +2832,7 @@ type BackendReconnectProperties struct { type BackendServiceFabricClusterProperties struct { // ClientCertificatethumbprint - The client certificate thumbprint for the management endpoint. ClientCertificatethumbprint *string `json:"clientCertificatethumbprint,omitempty"` - // MaxPartitionResolutionRetries - Maximum number of retries while attempting resolve the parition. + // MaxPartitionResolutionRetries - Maximum number of retries while attempting resolve the partition. MaxPartitionResolutionRetries *int32 `json:"maxPartitionResolutionRetries,omitempty"` // ManagementEndpoints - The cluster management endpoint. ManagementEndpoints *[]string `json:"managementEndpoints,omitempty"` @@ -3070,7 +3070,7 @@ type CertificateConfiguration struct { 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 - 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"` @@ -3240,6 +3240,13 @@ type ConnectivityStatusContract struct { 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. @@ -3484,9 +3491,9 @@ type DiagnosticContractProperties struct { LoggerID *string `json:"loggerId,omitempty"` // Sampling - Sampling settings for Diagnostic. Sampling *SamplingSettings `json:"sampling,omitempty"` - // Frontend - Diagnostic settings for incoming/outcoming HTTP messages to the Gateway. + // Frontend - Diagnostic settings for incoming/outgoing HTTP messages to the Gateway. Frontend *PipelineDiagnosticSettings `json:"frontend,omitempty"` - // Backend - Diagnostic settings for incoming/outcoming HTTP messages to the Backend + // Backend - Diagnostic settings for incoming/outgoing HTTP messages to the Backend Backend *PipelineDiagnosticSettings `json:"backend,omitempty"` // EnableHTTPCorrelationHeaders - Whether to process Correlation Headers coming to Api Management Service. Only applicable to Application Insights diagnostics. Default is true. EnableHTTPCorrelationHeaders *bool `json:"enableHttpCorrelationHeaders,omitempty"` @@ -5277,18 +5284,83 @@ 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"` +} + // 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 json.Marshal(objectMap) +} + +// 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 +} + +// 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"` } @@ -6761,7 +6833,7 @@ type ParameterContract struct { Values *[]string `json:"values,omitempty"` } -// PipelineDiagnosticSettings diagnostic settings for incoming/outcoming HTTP messages to the Gateway. +// PipelineDiagnosticSettings diagnostic settings for incoming/outgoing HTTP messages to the Gateway. type PipelineDiagnosticSettings struct { // Request - Diagnostic settings for request. Request *HTTPMessageDiagnostic `json:"request,omitempty"` @@ -8390,7 +8462,7 @@ type ReportRecordContract struct { Name *string `json:"name,omitempty"` // Timestamp - Start of aggregation period. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. Timestamp *date.Time `json:"timestamp,omitempty"` - // Interval - Length of agregation period. Interval must be multiple of 15 minutes and may not be zero. The value should be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations). + // Interval - Length of aggregation period. Interval must be multiple of 15 minutes and may not be zero. The value should be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations). Interval *string `json:"interval,omitempty"` // Country - Country to which this record data is related. Country *string `json:"country,omitempty"` @@ -8410,9 +8482,9 @@ type ReportRecordContract struct { APIRegion *string `json:"apiRegion,omitempty"` // SubscriptionID - Subscription identifier path. /subscriptions/{subscriptionId} SubscriptionID *string `json:"subscriptionId,omitempty"` - // CallCountSuccess - Number of succesful calls. This includes calls returning HttpStatusCode <= 301 and HttpStatusCode.NotModified and HttpStatusCode.TemporaryRedirect + // CallCountSuccess - Number of successful calls. This includes calls returning HttpStatusCode <= 301 and HttpStatusCode.NotModified and HttpStatusCode.TemporaryRedirect CallCountSuccess *int32 `json:"callCountSuccess,omitempty"` - // CallCountBlocked - Number of calls blocked due to invalid credentials. This includes calls returning HttpStatusCode.Unauthorize and HttpStatusCode.Forbidden and HttpStatusCode.TooManyRequests + // CallCountBlocked - Number of calls blocked due to invalid credentials. This includes calls returning HttpStatusCode.Unauthorized and HttpStatusCode.Forbidden and HttpStatusCode.TooManyRequests CallCountBlocked *int32 `json:"callCountBlocked,omitempty"` // CallCountFailed - Number of calls failed due to proxy or backend errors. This includes calls returning HttpStatusCode.BadRequest(400) and any Code between HttpStatusCode.InternalServerError (500) and 600 CallCountFailed *int32 `json:"callCountFailed,omitempty"` @@ -8499,7 +8571,7 @@ type RequestReportRecordContract struct { ResponseSize *int32 `json:"responseSize,omitempty"` // Timestamp - The date and time when this request was received by the gateway in ISO 8601 format. Timestamp *date.Time `json:"timestamp,omitempty"` - // Cache - Specifies if response cache was involved in generating the response. If the value is none, the cache was not used. If the value is hit, cached response was returned. If the value is miss, the cache was used but lookup resulted in a miss and request was fullfilled by the backend. + // Cache - Specifies if response cache was involved in generating the response. If the value is none, the cache was not used. If the value is hit, cached response was returned. If the value is miss, the cache was used but lookup resulted in a miss and request was fulfilled by the backend. Cache *string `json:"cache,omitempty"` // APITime - The total time it took to process this request. APITime *float64 `json:"apiTime,omitempty"` @@ -8952,7 +9024,7 @@ type ServiceBaseProperties struct { 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"` - // VirtualNetworkType - The type of VPN in which API Managemet 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 - 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"` } @@ -9260,7 +9332,7 @@ type ServiceProperties struct { 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"` - // VirtualNetworkType - The type of VPN in which API Managemet 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 - 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"` } @@ -9757,7 +9829,7 @@ type ServiceUpdateProperties struct { 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"` - // VirtualNetworkType - The type of VPN in which API Managemet 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 - 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"` } diff --git a/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/property.go b/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/property.go index a761975f8335..3cd4dc95fa80 100644 --- a/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/property.go +++ b/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/property.go @@ -151,7 +151,7 @@ func (client PropertyClient) CreateOrUpdateResponder(resp *http.Response) (resul return } -// Delete deletes specific property from the the API Management service instance. +// Delete deletes specific property from the API Management service instance. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. diff --git a/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/reports.go b/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/reports.go index 3686f1e17f62..5ae24f08cd3b 100644 --- a/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/reports.go +++ b/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/reports.go @@ -180,7 +180,7 @@ func (client ReportsClient) ListByAPIComplete(ctx context.Context, resourceGroup return } -// ListByGeo lists report records by GeoGraphy. +// ListByGeo lists report records by geography. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. @@ -847,7 +847,7 @@ func (client ReportsClient) ListBySubscriptionComplete(ctx context.Context, reso // serviceName - the name of the API Management service. // 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, secconds)) +// TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)) // filter - the filter to apply on the operation. // top - number of records to return. // skip - number of records to skip. diff --git a/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/subscription.go b/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/subscription.go index 007078a5c247..4ec18de23dfc 100644 --- a/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/subscription.go +++ b/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/subscription.go @@ -764,7 +764,7 @@ func (client SubscriptionClient) RegenerateSecondaryKeyResponder(resp *http.Resp return } -// Update updates the details of a subscription specificied by its identifier. +// Update updates the details of a subscription specified by its identifier. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. diff --git a/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/tagdescription.go b/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/tagdescription.go index 72938ba32d93..1d8827822696 100644 --- a/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/tagdescription.go +++ b/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/tagdescription.go @@ -41,7 +41,7 @@ func NewTagDescriptionClientWithBaseURI(baseURI string, subscriptionID string) T return TagDescriptionClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate create/Update tag fescription in scope of the Api. +// CreateOrUpdate create/Update tag description in scope of the Api. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. diff --git a/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/user.go b/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/user.go index 0fa4d3ac8d98..2c17e936e054 100644 --- a/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/user.go +++ b/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/user.go @@ -529,6 +529,91 @@ 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-06-01-preview" + 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 autorest.SendWithSender(client, 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.