From 81463179c2da490afa250292a65c3816c6e66091 Mon Sep 17 00:00:00 2001 From: "openapi-bot[bot]" <37845953+openapi-bot[bot]@users.noreply.github.com> Date: Mon, 16 Sep 2019 06:21:12 +0000 Subject: [PATCH 1/6] [AutoPR preview/appconfiguration/mgmt/2019-02-01-preview] Updated 2019-02-01-preview api version to include the listKeyValue operation. (#393) * Generated from 1baa9a51ee00db62b006b2081d2811297d48d3d4 Updated 2019-02-01-preview api version to include operation.g * Modifications after running after_scripts --- .../mgmt/appconfiguration/models.go | 2 + .../appconfigurationapi/interfaces.go | 1 + .../appconfiguration/configurationstores.go | 90 +++++++++++++++++++ .../appconfiguration/models.go | 39 ++++++++ 4 files changed, 132 insertions(+) diff --git a/profiles/preview/preview/appconfiguration/mgmt/appconfiguration/models.go b/profiles/preview/preview/appconfiguration/mgmt/appconfiguration/models.go index 6ac37bf91349..695ea51ccff1 100644 --- a/profiles/preview/preview/appconfiguration/mgmt/appconfiguration/models.go +++ b/profiles/preview/preview/appconfiguration/mgmt/appconfiguration/models.go @@ -57,6 +57,8 @@ type ConfigurationStoresCreateFuture = original.ConfigurationStoresCreateFuture type ConfigurationStoresDeleteFuture = original.ConfigurationStoresDeleteFuture type ConfigurationStoresUpdateFuture = original.ConfigurationStoresUpdateFuture type Error = original.Error +type KeyValue = original.KeyValue +type ListKeyValueParameters = original.ListKeyValueParameters type NameAvailabilityStatus = original.NameAvailabilityStatus type OperationDefinition = original.OperationDefinition type OperationDefinitionDisplay = original.OperationDefinitionDisplay diff --git a/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/appconfigurationapi/interfaces.go b/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/appconfigurationapi/interfaces.go index 972cd50887f0..b09e153e4a30 100644 --- a/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/appconfigurationapi/interfaces.go +++ b/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/appconfigurationapi/interfaces.go @@ -30,6 +30,7 @@ type ConfigurationStoresClientAPI interface { List(ctx context.Context, skipToken string) (result appconfiguration.ConfigurationStoreListResultPage, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string, skipToken string) (result appconfiguration.ConfigurationStoreListResultPage, err error) ListKeys(ctx context.Context, resourceGroupName string, configStoreName string, skipToken string) (result appconfiguration.APIKeyListResultPage, err error) + ListKeyValue(ctx context.Context, resourceGroupName string, configStoreName string, listKeyValueParameters appconfiguration.ListKeyValueParameters) (result appconfiguration.KeyValue, err error) RegenerateKey(ctx context.Context, resourceGroupName string, configStoreName string, regenerateKeyParameters appconfiguration.RegenerateKeyParameters) (result appconfiguration.APIKey, err error) Update(ctx context.Context, resourceGroupName string, configStoreName string, configStoreUpdateParameters appconfiguration.ConfigurationStoreUpdateParameters) (result appconfiguration.ConfigurationStoresUpdateFuture, err error) } diff --git a/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/configurationstores.go b/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/configurationstores.go index 2549bf8c8d47..d5263579ac0c 100644 --- a/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/configurationstores.go +++ b/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/configurationstores.go @@ -663,6 +663,96 @@ func (client ConfigurationStoresClient) ListKeysComplete(ctx context.Context, re return } +// ListKeyValue lists a configuration store key-value. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// configStoreName - the name of the configuration store. +// listKeyValueParameters - the parameters for retrieving a key-value. +func (client ConfigurationStoresClient) ListKeyValue(ctx context.Context, resourceGroupName string, configStoreName string, listKeyValueParameters ListKeyValueParameters) (result KeyValue, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationStoresClient.ListKeyValue") + 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: configStoreName, + Constraints: []validation.Constraint{{Target: "configStoreName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "configStoreName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "configStoreName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_-]*$`, Chain: nil}}}, + {TargetValue: listKeyValueParameters, + Constraints: []validation.Constraint{{Target: "listKeyValueParameters.Key", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("appconfiguration.ConfigurationStoresClient", "ListKeyValue", err.Error()) + } + + req, err := client.ListKeyValuePreparer(ctx, resourceGroupName, configStoreName, listKeyValueParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "ListKeyValue", nil, "Failure preparing request") + return + } + + resp, err := client.ListKeyValueSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "ListKeyValue", resp, "Failure sending request") + return + } + + result, err = client.ListKeyValueResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "ListKeyValue", resp, "Failure responding to request") + } + + return +} + +// ListKeyValuePreparer prepares the ListKeyValue request. +func (client ConfigurationStoresClient) ListKeyValuePreparer(ctx context.Context, resourceGroupName string, configStoreName string, listKeyValueParameters ListKeyValueParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "configStoreName": autorest.Encode("path", configStoreName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-02-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/listKeyValue", pathParameters), + autorest.WithJSON(listKeyValueParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListKeyValueSender sends the ListKeyValue request. The method will close the +// http.Response Body if it receives an error. +func (client ConfigurationStoresClient) ListKeyValueSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListKeyValueResponder handles the response to the ListKeyValue request. The method always +// closes the http.Response Body. +func (client ConfigurationStoresClient) ListKeyValueResponder(resp *http.Response) (result KeyValue, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // RegenerateKey regenerates an access key for the specified configuration store. // Parameters: // resourceGroupName - the name of the resource group to which the container registry belongs. diff --git a/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/models.go b/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/models.go index 0eee8a1b5870..f3fffbdde3f9 100644 --- a/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/models.go +++ b/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/models.go @@ -592,6 +592,45 @@ type Error struct { Message *string `json:"message,omitempty"` } +// KeyValue the result of a request to retrieve a key-value from the specified configuration store. +type KeyValue struct { + autorest.Response `json:"-"` + // Key - READ-ONLY; The primary identifier of a key-value. + // The key is used in unison with the label to uniquely identify a key-value. + Key *string `json:"key,omitempty"` + // Label - READ-ONLY; A value used to group key-values. + // The label is used in unison with the key to uniquely identify a key-value. + Label *string `json:"label,omitempty"` + // Value - READ-ONLY; The value of the key-value. + Value *string `json:"value,omitempty"` + // ContentType - READ-ONLY; The content type of the key-value's value. + // Providing a proper content-type can enable transformations of values when they are retrieved by applications. + ContentType *string `json:"contentType,omitempty"` + // ETag - READ-ONLY; An ETag indicating the state of a key-value within a configuration store. + ETag *string `json:"eTag,omitempty"` + // LastModified - READ-ONLY; The last time a modifying operation was performed on the given key-value. + LastModified *date.Time `json:"lastModified,omitempty"` + // Locked - READ-ONLY; A value indicating whether the key-value is locked. + // A locked key-value may not be modified until it is unlocked. + Locked *bool `json:"locked,omitempty"` + // Tags - READ-ONLY; A dictionary of tags that can help identify what a key-value may be applicable for. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for KeyValue. +func (kv KeyValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ListKeyValueParameters the parameters used to list a configuration store key-value +type ListKeyValueParameters struct { + // Key - The key to retrieve. + Key *string `json:"key,omitempty"` + // Label - The label of the key. + Label *string `json:"label,omitempty"` +} + // NameAvailabilityStatus the result of a request to check the availability of a resource name. type NameAvailabilityStatus struct { autorest.Response `json:"-"` From 6745ae5828737d1140539a32a91f4dfb51bd52ee Mon Sep 17 00:00:00 2001 From: "openapi-bot[bot]" <37845953+openapi-bot[bot]@users.noreply.github.com> Date: Mon, 16 Sep 2019 06:21:12 +0000 Subject: [PATCH 2/6] [AutoPR preview/appconfiguration/mgmt/2019-02-01-preview] Updated 2019-02-01-preview api version to include the listKeyValue operation. (#393) * Generated from 1baa9a51ee00db62b006b2081d2811297d48d3d4 Updated 2019-02-01-preview api version to include operation.g * Modifications after running after_scripts --- .../mgmt/appconfiguration/models.go | 2 + .../appconfigurationapi/interfaces.go | 1 + .../appconfiguration/configurationstores.go | 90 +++++++++++++++++++ .../appconfiguration/models.go | 39 ++++++++ 4 files changed, 132 insertions(+) diff --git a/profiles/preview/preview/appconfiguration/mgmt/appconfiguration/models.go b/profiles/preview/preview/appconfiguration/mgmt/appconfiguration/models.go index 6ac37bf91349..695ea51ccff1 100644 --- a/profiles/preview/preview/appconfiguration/mgmt/appconfiguration/models.go +++ b/profiles/preview/preview/appconfiguration/mgmt/appconfiguration/models.go @@ -57,6 +57,8 @@ type ConfigurationStoresCreateFuture = original.ConfigurationStoresCreateFuture type ConfigurationStoresDeleteFuture = original.ConfigurationStoresDeleteFuture type ConfigurationStoresUpdateFuture = original.ConfigurationStoresUpdateFuture type Error = original.Error +type KeyValue = original.KeyValue +type ListKeyValueParameters = original.ListKeyValueParameters type NameAvailabilityStatus = original.NameAvailabilityStatus type OperationDefinition = original.OperationDefinition type OperationDefinitionDisplay = original.OperationDefinitionDisplay diff --git a/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/appconfigurationapi/interfaces.go b/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/appconfigurationapi/interfaces.go index 972cd50887f0..b09e153e4a30 100644 --- a/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/appconfigurationapi/interfaces.go +++ b/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/appconfigurationapi/interfaces.go @@ -30,6 +30,7 @@ type ConfigurationStoresClientAPI interface { List(ctx context.Context, skipToken string) (result appconfiguration.ConfigurationStoreListResultPage, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string, skipToken string) (result appconfiguration.ConfigurationStoreListResultPage, err error) ListKeys(ctx context.Context, resourceGroupName string, configStoreName string, skipToken string) (result appconfiguration.APIKeyListResultPage, err error) + ListKeyValue(ctx context.Context, resourceGroupName string, configStoreName string, listKeyValueParameters appconfiguration.ListKeyValueParameters) (result appconfiguration.KeyValue, err error) RegenerateKey(ctx context.Context, resourceGroupName string, configStoreName string, regenerateKeyParameters appconfiguration.RegenerateKeyParameters) (result appconfiguration.APIKey, err error) Update(ctx context.Context, resourceGroupName string, configStoreName string, configStoreUpdateParameters appconfiguration.ConfigurationStoreUpdateParameters) (result appconfiguration.ConfigurationStoresUpdateFuture, err error) } diff --git a/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/configurationstores.go b/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/configurationstores.go index 2549bf8c8d47..d5263579ac0c 100644 --- a/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/configurationstores.go +++ b/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/configurationstores.go @@ -663,6 +663,96 @@ func (client ConfigurationStoresClient) ListKeysComplete(ctx context.Context, re return } +// ListKeyValue lists a configuration store key-value. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// configStoreName - the name of the configuration store. +// listKeyValueParameters - the parameters for retrieving a key-value. +func (client ConfigurationStoresClient) ListKeyValue(ctx context.Context, resourceGroupName string, configStoreName string, listKeyValueParameters ListKeyValueParameters) (result KeyValue, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationStoresClient.ListKeyValue") + 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: configStoreName, + Constraints: []validation.Constraint{{Target: "configStoreName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "configStoreName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "configStoreName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_-]*$`, Chain: nil}}}, + {TargetValue: listKeyValueParameters, + Constraints: []validation.Constraint{{Target: "listKeyValueParameters.Key", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("appconfiguration.ConfigurationStoresClient", "ListKeyValue", err.Error()) + } + + req, err := client.ListKeyValuePreparer(ctx, resourceGroupName, configStoreName, listKeyValueParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "ListKeyValue", nil, "Failure preparing request") + return + } + + resp, err := client.ListKeyValueSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "ListKeyValue", resp, "Failure sending request") + return + } + + result, err = client.ListKeyValueResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "ListKeyValue", resp, "Failure responding to request") + } + + return +} + +// ListKeyValuePreparer prepares the ListKeyValue request. +func (client ConfigurationStoresClient) ListKeyValuePreparer(ctx context.Context, resourceGroupName string, configStoreName string, listKeyValueParameters ListKeyValueParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "configStoreName": autorest.Encode("path", configStoreName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-02-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/listKeyValue", pathParameters), + autorest.WithJSON(listKeyValueParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListKeyValueSender sends the ListKeyValue request. The method will close the +// http.Response Body if it receives an error. +func (client ConfigurationStoresClient) ListKeyValueSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListKeyValueResponder handles the response to the ListKeyValue request. The method always +// closes the http.Response Body. +func (client ConfigurationStoresClient) ListKeyValueResponder(resp *http.Response) (result KeyValue, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // RegenerateKey regenerates an access key for the specified configuration store. // Parameters: // resourceGroupName - the name of the resource group to which the container registry belongs. diff --git a/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/models.go b/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/models.go index 0eee8a1b5870..f3fffbdde3f9 100644 --- a/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/models.go +++ b/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/models.go @@ -592,6 +592,45 @@ type Error struct { Message *string `json:"message,omitempty"` } +// KeyValue the result of a request to retrieve a key-value from the specified configuration store. +type KeyValue struct { + autorest.Response `json:"-"` + // Key - READ-ONLY; The primary identifier of a key-value. + // The key is used in unison with the label to uniquely identify a key-value. + Key *string `json:"key,omitempty"` + // Label - READ-ONLY; A value used to group key-values. + // The label is used in unison with the key to uniquely identify a key-value. + Label *string `json:"label,omitempty"` + // Value - READ-ONLY; The value of the key-value. + Value *string `json:"value,omitempty"` + // ContentType - READ-ONLY; The content type of the key-value's value. + // Providing a proper content-type can enable transformations of values when they are retrieved by applications. + ContentType *string `json:"contentType,omitempty"` + // ETag - READ-ONLY; An ETag indicating the state of a key-value within a configuration store. + ETag *string `json:"eTag,omitempty"` + // LastModified - READ-ONLY; The last time a modifying operation was performed on the given key-value. + LastModified *date.Time `json:"lastModified,omitempty"` + // Locked - READ-ONLY; A value indicating whether the key-value is locked. + // A locked key-value may not be modified until it is unlocked. + Locked *bool `json:"locked,omitempty"` + // Tags - READ-ONLY; A dictionary of tags that can help identify what a key-value may be applicable for. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for KeyValue. +func (kv KeyValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ListKeyValueParameters the parameters used to list a configuration store key-value +type ListKeyValueParameters struct { + // Key - The key to retrieve. + Key *string `json:"key,omitempty"` + // Label - The label of the key. + Label *string `json:"label,omitempty"` +} + // NameAvailabilityStatus the result of a request to check the availability of a resource name. type NameAvailabilityStatus struct { autorest.Response `json:"-"` From 768916038b1a73a5dd55739a9f1a77b1b795efd9 Mon Sep 17 00:00:00 2001 From: "openapi-bot[bot]" <37845953+openapi-bot[bot]@users.noreply.github.com> Date: Sun, 20 Oct 2019 23:55:42 +0000 Subject: [PATCH 3/6] [AutoPR preview/appconfiguration/mgmt/2019-02-01-preview] [DO NOT MERGE] Compute 2019-07-01 version (#405) * Generated from 9daec94969b800165844eeba1f3c9a82f24a5988 updated swagger * Modifications after running after_scripts --- .../appconfiguration/configurationstores.go | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/configurationstores.go b/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/configurationstores.go index d5263579ac0c..686860af2666 100644 --- a/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/configurationstores.go +++ b/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/configurationstores.go @@ -753,6 +753,96 @@ func (client ConfigurationStoresClient) ListKeyValueResponder(resp *http.Respons return } +// ListKeyValue lists a configuration store key-value. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// configStoreName - the name of the configuration store. +// listKeyValueParameters - the parameters for retrieving a key-value. +func (client ConfigurationStoresClient) ListKeyValue(ctx context.Context, resourceGroupName string, configStoreName string, listKeyValueParameters ListKeyValueParameters) (result KeyValue, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationStoresClient.ListKeyValue") + 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: configStoreName, + Constraints: []validation.Constraint{{Target: "configStoreName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "configStoreName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "configStoreName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_-]*$`, Chain: nil}}}, + {TargetValue: listKeyValueParameters, + Constraints: []validation.Constraint{{Target: "listKeyValueParameters.Key", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("appconfiguration.ConfigurationStoresClient", "ListKeyValue", err.Error()) + } + + req, err := client.ListKeyValuePreparer(ctx, resourceGroupName, configStoreName, listKeyValueParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "ListKeyValue", nil, "Failure preparing request") + return + } + + resp, err := client.ListKeyValueSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "ListKeyValue", resp, "Failure sending request") + return + } + + result, err = client.ListKeyValueResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "ListKeyValue", resp, "Failure responding to request") + } + + return +} + +// ListKeyValuePreparer prepares the ListKeyValue request. +func (client ConfigurationStoresClient) ListKeyValuePreparer(ctx context.Context, resourceGroupName string, configStoreName string, listKeyValueParameters ListKeyValueParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "configStoreName": autorest.Encode("path", configStoreName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-02-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/listKeyValue", pathParameters), + autorest.WithJSON(listKeyValueParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListKeyValueSender sends the ListKeyValue request. The method will close the +// http.Response Body if it receives an error. +func (client ConfigurationStoresClient) ListKeyValueSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListKeyValueResponder handles the response to the ListKeyValue request. The method always +// closes the http.Response Body. +func (client ConfigurationStoresClient) ListKeyValueResponder(resp *http.Response) (result KeyValue, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // RegenerateKey regenerates an access key for the specified configuration store. // Parameters: // resourceGroupName - the name of the resource group to which the container registry belongs. From 1e185ccfe86b19985cb90cff6e875b184b0fd618 Mon Sep 17 00:00:00 2001 From: Joel Hendrix Date: Wed, 16 Oct 2019 12:40:18 -0700 Subject: [PATCH 4/6] Add Go 1.13 to CI Updated Linux image to 18.04 Removed travis file. --- azure-pipelines.yml | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9dc7b82e01ab..fad812664b8c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,22 +1,22 @@ jobs: - - job: Build_Test + - job: BuildAndTest strategy: matrix: Linux_Go112: vm.image: 'ubuntu-18.04' go.version: '1.12' - GOROOT: '/usr/local/go$(go.version)' Linux_Go113: vm.image: 'ubuntu-18.04' go.version: '1.13' - GOROOT: '/usr/local/go$(go.version)' pool: vmImage: $(vm.image) variables: + GOROOT: '/usr/local/go$(go.version)' GOPATH: '$(system.defaultWorkingDirectory)/work' sdkPath: '$(GOPATH)/src/github.com/$(build.repository.name)' + GO: '$(GOROOT)/bin/go' IGNORE_BREAKING_CHANGES: true steps: @@ -31,25 +31,24 @@ jobs: displayName: 'Create Go Workspace' - script: | set -e - go version curl -sSL https://raw.githubusercontent.com/golang/dep/master/install.sh | sh dep ensure -v - go get -u golang.org/x/lint/golint + $(GO) get -u golang.org/x/lint/golint workingDirectory: '$(sdkPath)' displayName: 'Install Dependencies' - - script: go vet $(go list ./... | grep -v vendor) + - script: $(GO) vet $($(GO) list ./... | grep -v vendor) workingDirectory: '$(sdkPath)' displayName: 'Vet' - - script: go build -v $(go list ./... | grep -v vendor) + - script: $(GO) build -v $($(GO) list ./... | grep -v vendor) workingDirectory: '$(sdkPath)' displayName: 'Build' - - script: go test $(dirname $(find . -path ./vendor -prune -o -name '*_test.go' -print) | sort -u) + - script: $(GO) test $(dirname $(find . -path ./vendor -prune -o -name '*_test.go' -print) | sort -u) workingDirectory: '$(sdkPath)' displayName: 'Run Tests' - - script: go run ./tools/apidiff/main.go packages ./services FETCH_HEAD~1 FETCH_HEAD --copyrepo --breakingchanges || $IGNORE_BREAKING_CHANGES + - script: $(GO) run ./tools/apidiff/main.go packages ./services FETCH_HEAD~1 FETCH_HEAD --copyrepo --breakingchanges || $IGNORE_BREAKING_CHANGES workingDirectory: '$(sdkPath)' displayName: 'Display Breaking Changes' - - script: go run ./tools/pkgchk/main.go ./services --exceptions ./tools/pkgchk/exceptions.txt + - script: $(GO) run ./tools/pkgchk/main.go ./services --exceptions ./tools/pkgchk/exceptions.txt workingDirectory: '$(sdkPath)' displayName: 'Verify Package Directory' - script: grep -L -r --include *.go --exclude-dir vendor -P "Copyright (\d{4}|\(c\)) Microsoft" ./ | tee >&2 @@ -57,14 +56,14 @@ jobs: displayName: 'Copyright Header Check' failOnStderr: true condition: succeededOrFailed() - - script: gofmt -s -l -w $(find . -path ./vendor -prune -o -name '*.go' -print) >&2 + - script: $(GOROOT)/bin/gofmt -s -l -w $(find . -path ./vendor -prune -o -name '*.go' -print) >&2 workingDirectory: '$(sdkPath)' displayName: 'Format Check' failOnStderr: true condition: succeededOrFailed() - script: | - golint ./storage/... >&2 - golint ./tools/... >&2 + $(GOROOT)/bin/golint ./storage/... >&2 + $(GOROOT)/bin/golint ./tools/... >&2 workingDirectory: '$(sdkPath)' displayName: 'Linter Check' failOnStderr: true From 7508c10af93f49c1f662094834497c1f3eb2b45f Mon Sep 17 00:00:00 2001 From: Joel Hendrix Date: Wed, 16 Oct 2019 13:14:35 -0700 Subject: [PATCH 5/6] add windows builds and refactor --- azure-pipelines.yml | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index fad812664b8c..5ce8e1746eea 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,22 +1,30 @@ jobs: - - job: BuildAndTest + - job: Build_Test strategy: matrix: Linux_Go112: vm.image: 'ubuntu-18.04' go.version: '1.12' + GOROOT: '/usr/local/go$(go.version)' Linux_Go113: vm.image: 'ubuntu-18.04' go.version: '1.13' + GOROOT: '/usr/local/go$(go.version)' + Win_Go112: + vm.image: 'windows-2019' + go.version: '1.12' + GOROOT: 'c:\go$(go.version)' + Win_Go113: + vm.image: 'windows-2019' + go.version: '1.13' + GOROOT: 'c:\go$(go.version)' pool: vmImage: $(vm.image) variables: - GOROOT: '/usr/local/go$(go.version)' GOPATH: '$(system.defaultWorkingDirectory)/work' sdkPath: '$(GOPATH)/src/github.com/$(build.repository.name)' - GO: '$(GOROOT)/bin/go' IGNORE_BREAKING_CHANGES: true steps: @@ -28,27 +36,28 @@ jobs: mv !(work) '$(sdkPath)' echo '##vso[task.prependpath]$(GOROOT)/bin' echo '##vso[task.prependpath]$(GOPATH)/bin' + go version displayName: 'Create Go Workspace' - script: | set -e curl -sSL https://raw.githubusercontent.com/golang/dep/master/install.sh | sh dep ensure -v - $(GO) get -u golang.org/x/lint/golint + go get -u golang.org/x/lint/golint workingDirectory: '$(sdkPath)' displayName: 'Install Dependencies' - - script: $(GO) vet $($(GO) list ./... | grep -v vendor) + - script: go vet $(go list ./... | grep -v vendor) workingDirectory: '$(sdkPath)' displayName: 'Vet' - - script: $(GO) build -v $($(GO) list ./... | grep -v vendor) + - script: go build -v $(go list ./... | grep -v vendor) workingDirectory: '$(sdkPath)' displayName: 'Build' - - script: $(GO) test $(dirname $(find . -path ./vendor -prune -o -name '*_test.go' -print) | sort -u) + - script: go test $(dirname $(find . -path ./vendor -prune -o -name '*_test.go' -print) | sort -u) workingDirectory: '$(sdkPath)' displayName: 'Run Tests' - - script: $(GO) run ./tools/apidiff/main.go packages ./services FETCH_HEAD~1 FETCH_HEAD --copyrepo --breakingchanges || $IGNORE_BREAKING_CHANGES + - script: go run ./tools/apidiff/main.go packages ./services FETCH_HEAD~1 FETCH_HEAD --copyrepo --breakingchanges || $IGNORE_BREAKING_CHANGES workingDirectory: '$(sdkPath)' displayName: 'Display Breaking Changes' - - script: $(GO) run ./tools/pkgchk/main.go ./services --exceptions ./tools/pkgchk/exceptions.txt + - script: go run ./tools/pkgchk/main.go ./services --exceptions ./tools/pkgchk/exceptions.txt workingDirectory: '$(sdkPath)' displayName: 'Verify Package Directory' - script: grep -L -r --include *.go --exclude-dir vendor -P "Copyright (\d{4}|\(c\)) Microsoft" ./ | tee >&2 @@ -56,14 +65,14 @@ jobs: displayName: 'Copyright Header Check' failOnStderr: true condition: succeededOrFailed() - - script: $(GOROOT)/bin/gofmt -s -l -w $(find . -path ./vendor -prune -o -name '*.go' -print) >&2 + - script: gofmt -s -l -w $(find . -path ./vendor -prune -o -name '*.go' -print) >&2 workingDirectory: '$(sdkPath)' displayName: 'Format Check' failOnStderr: true condition: succeededOrFailed() - script: | - $(GOROOT)/bin/golint ./storage/... >&2 - $(GOROOT)/bin/golint ./tools/... >&2 + golint ./storage/... >&2 + golint ./tools/... >&2 workingDirectory: '$(sdkPath)' displayName: 'Linter Check' failOnStderr: true From 892549f830669f2b58c4857bc1843ac8efe4b88f Mon Sep 17 00:00:00 2001 From: "openapi-bot[bot]" <37845953+openapi-bot[bot]@users.noreply.github.com> Date: Sun, 20 Oct 2019 23:55:42 +0000 Subject: [PATCH 6/6] [AutoPR preview/appconfiguration/mgmt/2019-02-01-preview] [DO NOT MERGE] Compute 2019-07-01 version (#405) * Generated from 9daec94969b800165844eeba1f3c9a82f24a5988 updated swagger * Modifications after running after_scripts --- .../appconfiguration/configurationstores.go | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/configurationstores.go b/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/configurationstores.go index d5263579ac0c..686860af2666 100644 --- a/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/configurationstores.go +++ b/services/preview/appconfiguration/mgmt/2019-02-01-preview/appconfiguration/configurationstores.go @@ -753,6 +753,96 @@ func (client ConfigurationStoresClient) ListKeyValueResponder(resp *http.Respons return } +// ListKeyValue lists a configuration store key-value. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// configStoreName - the name of the configuration store. +// listKeyValueParameters - the parameters for retrieving a key-value. +func (client ConfigurationStoresClient) ListKeyValue(ctx context.Context, resourceGroupName string, configStoreName string, listKeyValueParameters ListKeyValueParameters) (result KeyValue, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConfigurationStoresClient.ListKeyValue") + 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: configStoreName, + Constraints: []validation.Constraint{{Target: "configStoreName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "configStoreName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "configStoreName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_-]*$`, Chain: nil}}}, + {TargetValue: listKeyValueParameters, + Constraints: []validation.Constraint{{Target: "listKeyValueParameters.Key", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("appconfiguration.ConfigurationStoresClient", "ListKeyValue", err.Error()) + } + + req, err := client.ListKeyValuePreparer(ctx, resourceGroupName, configStoreName, listKeyValueParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "ListKeyValue", nil, "Failure preparing request") + return + } + + resp, err := client.ListKeyValueSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "ListKeyValue", resp, "Failure sending request") + return + } + + result, err = client.ListKeyValueResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "appconfiguration.ConfigurationStoresClient", "ListKeyValue", resp, "Failure responding to request") + } + + return +} + +// ListKeyValuePreparer prepares the ListKeyValue request. +func (client ConfigurationStoresClient) ListKeyValuePreparer(ctx context.Context, resourceGroupName string, configStoreName string, listKeyValueParameters ListKeyValueParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "configStoreName": autorest.Encode("path", configStoreName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-02-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/listKeyValue", pathParameters), + autorest.WithJSON(listKeyValueParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListKeyValueSender sends the ListKeyValue request. The method will close the +// http.Response Body if it receives an error. +func (client ConfigurationStoresClient) ListKeyValueSender(req *http.Request) (*http.Response, error) { + sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) + return autorest.SendWithSender(client, req, sd...) +} + +// ListKeyValueResponder handles the response to the ListKeyValue request. The method always +// closes the http.Response Body. +func (client ConfigurationStoresClient) ListKeyValueResponder(resp *http.Response) (result KeyValue, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // RegenerateKey regenerates an access key for the specified configuration store. // Parameters: // resourceGroupName - the name of the resource group to which the container registry belongs.