diff --git a/profiles/latest/redis/mgmt/redis/models.go b/profiles/latest/redis/mgmt/redis/models.go index 90c7075c53b2..c5bbb76139aa 100644 --- a/profiles/latest/redis/mgmt/redis/models.go +++ b/profiles/latest/redis/mgmt/redis/models.go @@ -141,6 +141,9 @@ type OperationListResult = original.OperationListResult type OperationListResultIterator = original.OperationListResultIterator type OperationListResultPage = original.OperationListResultPage type PatchSchedule = original.PatchSchedule +type PatchScheduleListResult = original.PatchScheduleListResult +type PatchScheduleListResultIterator = original.PatchScheduleListResultIterator +type PatchScheduleListResultPage = original.PatchScheduleListResultPage type Properties = original.Properties type ProxyResource = original.ProxyResource type RebootParameters = original.RebootParameters diff --git a/profiles/preview/redis/mgmt/redis/models.go b/profiles/preview/redis/mgmt/redis/models.go index c123c81b77eb..8281bbb633a0 100644 --- a/profiles/preview/redis/mgmt/redis/models.go +++ b/profiles/preview/redis/mgmt/redis/models.go @@ -141,6 +141,9 @@ type OperationListResult = original.OperationListResult type OperationListResultIterator = original.OperationListResultIterator type OperationListResultPage = original.OperationListResultPage type PatchSchedule = original.PatchSchedule +type PatchScheduleListResult = original.PatchScheduleListResult +type PatchScheduleListResultIterator = original.PatchScheduleListResultIterator +type PatchScheduleListResultPage = original.PatchScheduleListResultPage type Properties = original.Properties type ProxyResource = original.ProxyResource type RebootParameters = original.RebootParameters diff --git a/services/redis/mgmt/2015-08-01/redis/redis.go b/services/redis/mgmt/2015-08-01/redis/redis.go index 4ca93dca3ede..e65743f8758d 100644 --- a/services/redis/mgmt/2015-08-01/redis/redis.go +++ b/services/redis/mgmt/2015-08-01/redis/redis.go @@ -41,10 +41,9 @@ func NewClientWithBaseURI(baseURI string, subscriptionID string) Client { } // CreateOrUpdate create a Redis cache, or replace (overwrite/recreate, with potential downtime) an existing cache. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. -// parameters - parameters supplied to the CreateOrUpdate Redis operation. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is +// parameters supplied to the CreateOrUpdate Redis operation. func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, name string, parameters CreateOrUpdateParameters) (result ResourceWithAccessKey, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -120,9 +119,8 @@ func (client Client) CreateOrUpdateResponder(resp *http.Response) (result Resour } // Delete deletes a Redis cache. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. func (client Client) Delete(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, name) if err != nil { @@ -187,10 +185,9 @@ func (client Client) DeleteResponder(resp *http.Response) (result autorest.Respo // ForceReboot reboot specified Redis node(s). This operation requires write permission to the cache resource. There // can be potential data loss. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. -// parameters - specifies which Redis node(s) to reboot. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is +// specifies which Redis node(s) to reboot. func (client Client) ForceReboot(ctx context.Context, resourceGroupName string, name string, parameters RebootParameters) (result autorest.Response, err error) { req, err := client.ForceRebootPreparer(ctx, resourceGroupName, name, parameters) if err != nil { @@ -256,9 +253,8 @@ func (client Client) ForceRebootResponder(resp *http.Response) (result autorest. } // Get gets a Redis cache (resource description). -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. func (client Client) Get(ctx context.Context, resourceGroupName string, name string) (result ResourceType, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, name) if err != nil { @@ -413,8 +409,8 @@ func (client Client) ListComplete(ctx context.Context) (result ListResultIterato } // ListByResourceGroup gets all Redis caches in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. +// +// resourceGroupName is the name of the resource group. func (client Client) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ListResultPage, err error) { result.fn = client.listByResourceGroupNextResults req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) @@ -506,9 +502,8 @@ func (client Client) ListByResourceGroupComplete(ctx context.Context, resourceGr } // ListKeys retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. func (client Client) ListKeys(ctx context.Context, resourceGroupName string, name string) (result ListKeysResult, err error) { req, err := client.ListKeysPreparer(ctx, resourceGroupName, name) if err != nil { @@ -574,10 +569,9 @@ func (client Client) ListKeysResponder(resp *http.Response) (result ListKeysResu // RegenerateKey regenerate the access keys for a Redis cache. This operation requires write permission to the cache // resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. -// parameters - specifies which key to reset. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is +// specifies which key to reset. func (client Client) RegenerateKey(ctx context.Context, resourceGroupName string, name string, parameters RegenerateKeyParameters) (result ListKeysResult, err error) { req, err := client.RegenerateKeyPreparer(ctx, resourceGroupName, name, parameters) if err != nil { diff --git a/services/redis/mgmt/2016-04-01/redis/firewallrule.go b/services/redis/mgmt/2016-04-01/redis/firewallrule.go index 95f6447b1f95..67aadb354a5c 100644 --- a/services/redis/mgmt/2016-04-01/redis/firewallrule.go +++ b/services/redis/mgmt/2016-04-01/redis/firewallrule.go @@ -41,11 +41,10 @@ func NewFirewallRuleClientWithBaseURI(baseURI string, subscriptionID string) Fir } // CreateOrUpdate create or update a redis cache firewall rule -// Parameters: -// resourceGroupName - the name of the resource group. -// cacheName - the name of the Redis cache. -// ruleName - the name of the firewall rule. -// parameters - parameters supplied to the create or update redis firewall rule operation. +// +// resourceGroupName is the name of the resource group. cacheName is the name of the Redis cache. ruleName is the +// name of the firewall rule. parameters is parameters supplied to the create or update redis firewall rule +// operation. func (client FirewallRuleClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, cacheName string, ruleName string, parameters FirewallRule) (result FirewallRule, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -122,10 +121,9 @@ func (client FirewallRuleClient) CreateOrUpdateResponder(resp *http.Response) (r } // Delete deletes a single firewall rule in a specified redis cache. -// Parameters: -// resourceGroupName - the name of the resource group. -// cacheName - the name of the Redis cache. -// ruleName - the name of the firewall rule. +// +// resourceGroupName is the name of the resource group. cacheName is the name of the Redis cache. ruleName is the +// name of the firewall rule. func (client FirewallRuleClient) Delete(ctx context.Context, resourceGroupName string, cacheName string, ruleName string) (result autorest.Response, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, cacheName, ruleName) if err != nil { @@ -190,10 +188,9 @@ func (client FirewallRuleClient) DeleteResponder(resp *http.Response) (result au } // Get gets a single firewall rule in a specified redis cache. -// Parameters: -// resourceGroupName - the name of the resource group. -// cacheName - the name of the Redis cache. -// ruleName - the name of the firewall rule. +// +// resourceGroupName is the name of the resource group. cacheName is the name of the Redis cache. ruleName is the +// name of the firewall rule. func (client FirewallRuleClient) Get(ctx context.Context, resourceGroupName string, cacheName string, ruleName string) (result FirewallRule, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, cacheName, ruleName) if err != nil { diff --git a/services/redis/mgmt/2016-04-01/redis/firewallrules.go b/services/redis/mgmt/2016-04-01/redis/firewallrules.go index 924a000f63f2..45a38dac9723 100644 --- a/services/redis/mgmt/2016-04-01/redis/firewallrules.go +++ b/services/redis/mgmt/2016-04-01/redis/firewallrules.go @@ -40,9 +40,8 @@ func NewFirewallRulesClientWithBaseURI(baseURI string, subscriptionID string) Fi } // List gets all firewall rules in the specified redis cache. -// Parameters: -// resourceGroupName - the name of the resource group. -// cacheName - the name of the Redis cache. +// +// resourceGroupName is the name of the resource group. cacheName is the name of the Redis cache. func (client FirewallRulesClient) List(ctx context.Context, resourceGroupName string, cacheName string) (result FirewallRuleListResultPage, err error) { result.fn = client.listNextResults req, err := client.ListPreparer(ctx, resourceGroupName, cacheName) diff --git a/services/redis/mgmt/2016-04-01/redis/patchschedules.go b/services/redis/mgmt/2016-04-01/redis/patchschedules.go index 24f8bf6175b4..ad1c62779dd9 100644 --- a/services/redis/mgmt/2016-04-01/redis/patchschedules.go +++ b/services/redis/mgmt/2016-04-01/redis/patchschedules.go @@ -41,10 +41,9 @@ func NewPatchSchedulesClientWithBaseURI(baseURI string, subscriptionID string) P } // CreateOrUpdate create or replace the patching schedule for Redis cache (requires Premium SKU). -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. -// parameters - parameters to set the patching schedule for Redis cache. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is +// parameters to set the patching schedule for Redis cache. func (client PatchSchedulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, name string, parameters PatchSchedule) (result PatchSchedule, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -118,9 +117,8 @@ func (client PatchSchedulesClient) CreateOrUpdateResponder(resp *http.Response) } // Delete deletes the patching schedule of a redis cache (requires Premium SKU). -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the redis cache. +// +// resourceGroupName is the name of the resource group. name is the name of the redis cache. func (client PatchSchedulesClient) Delete(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, name) if err != nil { @@ -184,9 +182,8 @@ func (client PatchSchedulesClient) DeleteResponder(resp *http.Response) (result } // Get gets the patching schedule of a redis cache (requires Premium SKU). -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the redis cache. +// +// resourceGroupName is the name of the resource group. name is the name of the redis cache. func (client PatchSchedulesClient) Get(ctx context.Context, resourceGroupName string, name string) (result PatchSchedule, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, name) if err != nil { diff --git a/services/redis/mgmt/2016-04-01/redis/redis.go b/services/redis/mgmt/2016-04-01/redis/redis.go index 6380023be22a..a4f61075d05d 100644 --- a/services/redis/mgmt/2016-04-01/redis/redis.go +++ b/services/redis/mgmt/2016-04-01/redis/redis.go @@ -41,10 +41,9 @@ func NewClientWithBaseURI(baseURI string, subscriptionID string) Client { } // Create create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. -// parameters - parameters supplied to the Create Redis operation. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is +// parameters supplied to the Create Redis operation. func (client Client) Create(ctx context.Context, resourceGroupName string, name string, parameters CreateParameters) (result CreateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -122,9 +121,8 @@ func (client Client) CreateResponder(resp *http.Response) (result ResourceType, } // Delete deletes a Redis cache. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. func (client Client) Delete(ctx context.Context, resourceGroupName string, name string) (result DeleteFuture, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, name) if err != nil { @@ -190,10 +188,9 @@ func (client Client) DeleteResponder(resp *http.Response) (result autorest.Respo } // ExportData export data from the redis cache to blobs in a container. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. -// parameters - parameters for Redis export operation. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is +// parameters for Redis export operation. func (client Client) ExportData(ctx context.Context, resourceGroupName string, name string, parameters ExportRDBParameters) (result ExportDataFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -269,10 +266,9 @@ func (client Client) ExportDataResponder(resp *http.Response) (result autorest.R // ForceReboot reboot specified Redis node(s). This operation requires write permission to the cache resource. There // can be potential data loss. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. -// parameters - specifies which Redis node(s) to reboot. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is +// specifies which Redis node(s) to reboot. func (client Client) ForceReboot(ctx context.Context, resourceGroupName string, name string, parameters RebootParameters) (result ForceRebootResponse, err error) { req, err := client.ForceRebootPreparer(ctx, resourceGroupName, name, parameters) if err != nil { @@ -339,9 +335,8 @@ func (client Client) ForceRebootResponder(resp *http.Response) (result ForceRebo } // Get gets a Redis cache (resource description). -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. func (client Client) Get(ctx context.Context, resourceGroupName string, name string) (result ResourceType, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, name) if err != nil { @@ -406,10 +401,9 @@ func (client Client) GetResponder(resp *http.Response) (result ResourceType, err } // ImportData import data into Redis cache. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. -// parameters - parameters for Redis import operation. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is +// parameters for Redis import operation. func (client Client) ImportData(ctx context.Context, resourceGroupName string, name string, parameters ImportRDBParameters) (result ImportDataFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -573,8 +567,8 @@ func (client Client) ListComplete(ctx context.Context) (result ListResultIterato } // ListByResourceGroup lists all Redis caches in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. +// +// resourceGroupName is the name of the resource group. func (client Client) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ListResultPage, err error) { result.fn = client.listByResourceGroupNextResults req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) @@ -666,9 +660,8 @@ func (client Client) ListByResourceGroupComplete(ctx context.Context, resourceGr } // ListKeys retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. func (client Client) ListKeys(ctx context.Context, resourceGroupName string, name string) (result AccessKeys, err error) { req, err := client.ListKeysPreparer(ctx, resourceGroupName, name) if err != nil { @@ -733,10 +726,9 @@ func (client Client) ListKeysResponder(resp *http.Response) (result AccessKeys, } // RegenerateKey regenerate Redis cache's access keys. This operation requires write permission to the cache resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. -// parameters - specifies which key to regenerate. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is +// specifies which key to regenerate. func (client Client) RegenerateKey(ctx context.Context, resourceGroupName string, name string, parameters RegenerateKeyParameters) (result AccessKeys, err error) { req, err := client.RegenerateKeyPreparer(ctx, resourceGroupName, name, parameters) if err != nil { @@ -803,10 +795,9 @@ func (client Client) RegenerateKeyResponder(resp *http.Response) (result AccessK } // Update update an existing Redis cache. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. -// parameters - parameters supplied to the Update Redis operation. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is +// parameters supplied to the Update Redis operation. func (client Client) Update(ctx context.Context, resourceGroupName string, name string, parameters UpdateParameters) (result ResourceType, err error) { req, err := client.UpdatePreparer(ctx, resourceGroupName, name, parameters) if err != nil { diff --git a/services/redis/mgmt/2017-02-01/redis/firewallrules.go b/services/redis/mgmt/2017-02-01/redis/firewallrules.go index 7ef34278a63c..940c1ece3bf4 100644 --- a/services/redis/mgmt/2017-02-01/redis/firewallrules.go +++ b/services/redis/mgmt/2017-02-01/redis/firewallrules.go @@ -41,11 +41,10 @@ func NewFirewallRulesClientWithBaseURI(baseURI string, subscriptionID string) Fi } // CreateOrUpdate create or update a redis cache firewall rule -// Parameters: -// resourceGroupName - the name of the resource group. -// cacheName - the name of the Redis cache. -// ruleName - the name of the firewall rule. -// parameters - parameters supplied to the create or update redis firewall rule operation. +// +// resourceGroupName is the name of the resource group. cacheName is the name of the Redis cache. ruleName is the +// name of the firewall rule. parameters is parameters supplied to the create or update redis firewall rule +// operation. func (client FirewallRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, cacheName string, ruleName string, parameters FirewallRule) (result FirewallRule, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -122,10 +121,9 @@ func (client FirewallRulesClient) CreateOrUpdateResponder(resp *http.Response) ( } // Delete deletes a single firewall rule in a specified redis cache. -// Parameters: -// resourceGroupName - the name of the resource group. -// cacheName - the name of the Redis cache. -// ruleName - the name of the firewall rule. +// +// resourceGroupName is the name of the resource group. cacheName is the name of the Redis cache. ruleName is the +// name of the firewall rule. func (client FirewallRulesClient) Delete(ctx context.Context, resourceGroupName string, cacheName string, ruleName string) (result autorest.Response, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, cacheName, ruleName) if err != nil { @@ -190,10 +188,9 @@ func (client FirewallRulesClient) DeleteResponder(resp *http.Response) (result a } // Get gets a single firewall rule in a specified redis cache. -// Parameters: -// resourceGroupName - the name of the resource group. -// cacheName - the name of the Redis cache. -// ruleName - the name of the firewall rule. +// +// resourceGroupName is the name of the resource group. cacheName is the name of the Redis cache. ruleName is the +// name of the firewall rule. func (client FirewallRulesClient) Get(ctx context.Context, resourceGroupName string, cacheName string, ruleName string) (result FirewallRule, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, cacheName, ruleName) if err != nil { @@ -259,9 +256,8 @@ func (client FirewallRulesClient) GetResponder(resp *http.Response) (result Fire } // ListByRedisResource gets all firewall rules in the specified redis cache. -// Parameters: -// resourceGroupName - the name of the resource group. -// cacheName - the name of the Redis cache. +// +// resourceGroupName is the name of the resource group. cacheName is the name of the Redis cache. func (client FirewallRulesClient) ListByRedisResource(ctx context.Context, resourceGroupName string, cacheName string) (result FirewallRuleListResultPage, err error) { result.fn = client.listByRedisResourceNextResults req, err := client.ListByRedisResourcePreparer(ctx, resourceGroupName, cacheName) diff --git a/services/redis/mgmt/2017-02-01/redis/linkedserver.go b/services/redis/mgmt/2017-02-01/redis/linkedserver.go index 80869464a5ee..a742d152c2b1 100644 --- a/services/redis/mgmt/2017-02-01/redis/linkedserver.go +++ b/services/redis/mgmt/2017-02-01/redis/linkedserver.go @@ -41,11 +41,10 @@ func NewLinkedServerClientWithBaseURI(baseURI string, subscriptionID string) Lin } // Create adds a linked server to the Redis cache (requires Premium SKU). -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. -// linkedServerName - the name of the linked server that is being added to the Redis cache. -// parameters - parameters supplied to the Create Linked server operation. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. linkedServerName is +// the name of the linked server that is being added to the Redis cache. parameters is parameters supplied to the +// Create Linked server operation. func (client LinkedServerClient) Create(ctx context.Context, resourceGroupName string, name string, linkedServerName string, parameters LinkedServerCreateParameters) (result LinkedServerCreateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -124,10 +123,9 @@ func (client LinkedServerClient) CreateResponder(resp *http.Response) (result Li } // Delete deletes the linked server from a redis cache (requires Premium SKU). -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the redis cache. -// linkedServerName - the name of the linked server that is being added to the Redis cache. +// +// resourceGroupName is the name of the resource group. name is the name of the redis cache. linkedServerName is +// the name of the linked server that is being added to the Redis cache. func (client LinkedServerClient) Delete(ctx context.Context, resourceGroupName string, name string, linkedServerName string) (result autorest.Response, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, name, linkedServerName) if err != nil { @@ -192,10 +190,9 @@ func (client LinkedServerClient) DeleteResponder(resp *http.Response) (result au } // Get gets the detailed information about a linked server of a redis cache (requires Premium SKU). -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the redis cache. -// linkedServerName - the name of the linked server. +// +// resourceGroupName is the name of the resource group. name is the name of the redis cache. linkedServerName is +// the name of the linked server. func (client LinkedServerClient) Get(ctx context.Context, resourceGroupName string, name string, linkedServerName string) (result LinkedServerWithProperties, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, name, linkedServerName) if err != nil { @@ -261,9 +258,8 @@ func (client LinkedServerClient) GetResponder(resp *http.Response) (result Linke } // List gets the list of linked servers associated with this redis cache (requires Premium SKU). -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the redis cache. +// +// resourceGroupName is the name of the resource group. name is the name of the redis cache. func (client LinkedServerClient) List(ctx context.Context, resourceGroupName string, name string) (result LinkedServerWithPropertiesList, err error) { req, err := client.ListPreparer(ctx, resourceGroupName, name) if err != nil { diff --git a/services/redis/mgmt/2017-02-01/redis/patchschedules.go b/services/redis/mgmt/2017-02-01/redis/patchschedules.go index 189062dca094..5891927babd7 100644 --- a/services/redis/mgmt/2017-02-01/redis/patchschedules.go +++ b/services/redis/mgmt/2017-02-01/redis/patchschedules.go @@ -41,10 +41,9 @@ func NewPatchSchedulesClientWithBaseURI(baseURI string, subscriptionID string) P } // CreateOrUpdate create or replace the patching schedule for Redis cache (requires Premium SKU). -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. -// parameters - parameters to set the patching schedule for Redis cache. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is +// parameters to set the patching schedule for Redis cache. func (client PatchSchedulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, name string, parameters PatchSchedule) (result PatchSchedule, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -118,9 +117,8 @@ func (client PatchSchedulesClient) CreateOrUpdateResponder(resp *http.Response) } // Delete deletes the patching schedule of a redis cache (requires Premium SKU). -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the redis cache. +// +// resourceGroupName is the name of the resource group. name is the name of the redis cache. func (client PatchSchedulesClient) Delete(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, name) if err != nil { @@ -184,9 +182,8 @@ func (client PatchSchedulesClient) DeleteResponder(resp *http.Response) (result } // Get gets the patching schedule of a redis cache (requires Premium SKU). -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the redis cache. +// +// resourceGroupName is the name of the resource group. name is the name of the redis cache. func (client PatchSchedulesClient) Get(ctx context.Context, resourceGroupName string, name string) (result PatchSchedule, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, name) if err != nil { diff --git a/services/redis/mgmt/2017-02-01/redis/redis.go b/services/redis/mgmt/2017-02-01/redis/redis.go index f1072fe3e24a..261e2480de85 100644 --- a/services/redis/mgmt/2017-02-01/redis/redis.go +++ b/services/redis/mgmt/2017-02-01/redis/redis.go @@ -41,10 +41,9 @@ func NewClientWithBaseURI(baseURI string, subscriptionID string) Client { } // Create create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. -// parameters - parameters supplied to the Create Redis operation. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is +// parameters supplied to the Create Redis operation. func (client Client) Create(ctx context.Context, resourceGroupName string, name string, parameters CreateParameters) (result CreateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -122,9 +121,8 @@ func (client Client) CreateResponder(resp *http.Response) (result ResourceType, } // Delete deletes a Redis cache. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. func (client Client) Delete(ctx context.Context, resourceGroupName string, name string) (result DeleteFuture, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, name) if err != nil { @@ -190,10 +188,9 @@ func (client Client) DeleteResponder(resp *http.Response) (result autorest.Respo } // ExportData export data from the redis cache to blobs in a container. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. -// parameters - parameters for Redis export operation. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is +// parameters for Redis export operation. func (client Client) ExportData(ctx context.Context, resourceGroupName string, name string, parameters ExportRDBParameters) (result ExportDataFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -269,10 +266,9 @@ func (client Client) ExportDataResponder(resp *http.Response) (result autorest.R // ForceReboot reboot specified Redis node(s). This operation requires write permission to the cache resource. There // can be potential data loss. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. -// parameters - specifies which Redis node(s) to reboot. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is +// specifies which Redis node(s) to reboot. func (client Client) ForceReboot(ctx context.Context, resourceGroupName string, name string, parameters RebootParameters) (result ForceRebootResponse, err error) { req, err := client.ForceRebootPreparer(ctx, resourceGroupName, name, parameters) if err != nil { @@ -339,9 +335,8 @@ func (client Client) ForceRebootResponder(resp *http.Response) (result ForceRebo } // Get gets a Redis cache (resource description). -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. func (client Client) Get(ctx context.Context, resourceGroupName string, name string) (result ResourceType, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, name) if err != nil { @@ -406,10 +401,9 @@ func (client Client) GetResponder(resp *http.Response) (result ResourceType, err } // ImportData import data into Redis cache. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. -// parameters - parameters for Redis import operation. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is +// parameters for Redis import operation. func (client Client) ImportData(ctx context.Context, resourceGroupName string, name string, parameters ImportRDBParameters) (result ImportDataFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -573,8 +567,8 @@ func (client Client) ListComplete(ctx context.Context) (result ListResultIterato } // ListByResourceGroup lists all Redis caches in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. +// +// resourceGroupName is the name of the resource group. func (client Client) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ListResultPage, err error) { result.fn = client.listByResourceGroupNextResults req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) @@ -666,9 +660,8 @@ func (client Client) ListByResourceGroupComplete(ctx context.Context, resourceGr } // ListKeys retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. func (client Client) ListKeys(ctx context.Context, resourceGroupName string, name string) (result AccessKeys, err error) { req, err := client.ListKeysPreparer(ctx, resourceGroupName, name) if err != nil { @@ -733,10 +726,9 @@ func (client Client) ListKeysResponder(resp *http.Response) (result AccessKeys, } // RegenerateKey regenerate Redis cache's access keys. This operation requires write permission to the cache resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. -// parameters - specifies which key to regenerate. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is +// specifies which key to regenerate. func (client Client) RegenerateKey(ctx context.Context, resourceGroupName string, name string, parameters RegenerateKeyParameters) (result AccessKeys, err error) { req, err := client.RegenerateKeyPreparer(ctx, resourceGroupName, name, parameters) if err != nil { @@ -803,10 +795,9 @@ func (client Client) RegenerateKeyResponder(resp *http.Response) (result AccessK } // Update update an existing Redis cache. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. -// parameters - parameters supplied to the Update Redis operation. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is +// parameters supplied to the Update Redis operation. func (client Client) Update(ctx context.Context, resourceGroupName string, name string, parameters UpdateParameters) (result ResourceType, err error) { req, err := client.UpdatePreparer(ctx, resourceGroupName, name, parameters) if err != nil { diff --git a/services/redis/mgmt/2017-10-01/redis/firewallrules.go b/services/redis/mgmt/2017-10-01/redis/firewallrules.go index 0f6aa27c3caf..5ab6f5067ac8 100644 --- a/services/redis/mgmt/2017-10-01/redis/firewallrules.go +++ b/services/redis/mgmt/2017-10-01/redis/firewallrules.go @@ -41,11 +41,10 @@ func NewFirewallRulesClientWithBaseURI(baseURI string, subscriptionID string) Fi } // CreateOrUpdate create or update a redis cache firewall rule -// Parameters: -// resourceGroupName - the name of the resource group. -// cacheName - the name of the Redis cache. -// ruleName - the name of the firewall rule. -// parameters - parameters supplied to the create or update redis firewall rule operation. +// +// resourceGroupName is the name of the resource group. cacheName is the name of the Redis cache. ruleName is the +// name of the firewall rule. parameters is parameters supplied to the create or update redis firewall rule +// operation. func (client FirewallRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, cacheName string, ruleName string, parameters FirewallRuleCreateParameters) (result FirewallRule, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -122,10 +121,9 @@ func (client FirewallRulesClient) CreateOrUpdateResponder(resp *http.Response) ( } // Delete deletes a single firewall rule in a specified redis cache. -// Parameters: -// resourceGroupName - the name of the resource group. -// cacheName - the name of the Redis cache. -// ruleName - the name of the firewall rule. +// +// resourceGroupName is the name of the resource group. cacheName is the name of the Redis cache. ruleName is the +// name of the firewall rule. func (client FirewallRulesClient) Delete(ctx context.Context, resourceGroupName string, cacheName string, ruleName string) (result autorest.Response, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, cacheName, ruleName) if err != nil { @@ -190,10 +188,9 @@ func (client FirewallRulesClient) DeleteResponder(resp *http.Response) (result a } // Get gets a single firewall rule in a specified redis cache. -// Parameters: -// resourceGroupName - the name of the resource group. -// cacheName - the name of the Redis cache. -// ruleName - the name of the firewall rule. +// +// resourceGroupName is the name of the resource group. cacheName is the name of the Redis cache. ruleName is the +// name of the firewall rule. func (client FirewallRulesClient) Get(ctx context.Context, resourceGroupName string, cacheName string, ruleName string) (result FirewallRule, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, cacheName, ruleName) if err != nil { @@ -259,9 +256,8 @@ func (client FirewallRulesClient) GetResponder(resp *http.Response) (result Fire } // ListByRedisResource gets all firewall rules in the specified redis cache. -// Parameters: -// resourceGroupName - the name of the resource group. -// cacheName - the name of the Redis cache. +// +// resourceGroupName is the name of the resource group. cacheName is the name of the Redis cache. func (client FirewallRulesClient) ListByRedisResource(ctx context.Context, resourceGroupName string, cacheName string) (result FirewallRuleListResultPage, err error) { result.fn = client.listByRedisResourceNextResults req, err := client.ListByRedisResourcePreparer(ctx, resourceGroupName, cacheName) diff --git a/services/redis/mgmt/2017-10-01/redis/linkedserver.go b/services/redis/mgmt/2017-10-01/redis/linkedserver.go index bf73ea6e21ed..b68a2afb8b5c 100644 --- a/services/redis/mgmt/2017-10-01/redis/linkedserver.go +++ b/services/redis/mgmt/2017-10-01/redis/linkedserver.go @@ -41,11 +41,10 @@ func NewLinkedServerClientWithBaseURI(baseURI string, subscriptionID string) Lin } // Create adds a linked server to the Redis cache (requires Premium SKU). -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. -// linkedServerName - the name of the linked server that is being added to the Redis cache. -// parameters - parameters supplied to the Create Linked server operation. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. linkedServerName is +// the name of the linked server that is being added to the Redis cache. parameters is parameters supplied to the +// Create Linked server operation. func (client LinkedServerClient) Create(ctx context.Context, resourceGroupName string, name string, linkedServerName string, parameters LinkedServerCreateParameters) (result LinkedServerCreateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -124,10 +123,9 @@ func (client LinkedServerClient) CreateResponder(resp *http.Response) (result Li } // Delete deletes the linked server from a redis cache (requires Premium SKU). -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the redis cache. -// linkedServerName - the name of the linked server that is being added to the Redis cache. +// +// resourceGroupName is the name of the resource group. name is the name of the redis cache. linkedServerName is +// the name of the linked server that is being added to the Redis cache. func (client LinkedServerClient) Delete(ctx context.Context, resourceGroupName string, name string, linkedServerName string) (result autorest.Response, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, name, linkedServerName) if err != nil { @@ -192,10 +190,9 @@ func (client LinkedServerClient) DeleteResponder(resp *http.Response) (result au } // Get gets the detailed information about a linked server of a redis cache (requires Premium SKU). -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the redis cache. -// linkedServerName - the name of the linked server. +// +// resourceGroupName is the name of the resource group. name is the name of the redis cache. linkedServerName is +// the name of the linked server. func (client LinkedServerClient) Get(ctx context.Context, resourceGroupName string, name string, linkedServerName string) (result LinkedServerWithProperties, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, name, linkedServerName) if err != nil { @@ -261,9 +258,8 @@ func (client LinkedServerClient) GetResponder(resp *http.Response) (result Linke } // List gets the list of linked servers associated with this redis cache (requires Premium SKU). -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the redis cache. +// +// resourceGroupName is the name of the resource group. name is the name of the redis cache. func (client LinkedServerClient) List(ctx context.Context, resourceGroupName string, name string) (result LinkedServerWithPropertiesListPage, err error) { result.fn = client.listNextResults req, err := client.ListPreparer(ctx, resourceGroupName, name) diff --git a/services/redis/mgmt/2017-10-01/redis/models.go b/services/redis/mgmt/2017-10-01/redis/models.go index f6a3ee7cd2a6..4fb2e2ca9a2f 100644 --- a/services/redis/mgmt/2017-10-01/redis/models.go +++ b/services/redis/mgmt/2017-10-01/redis/models.go @@ -143,11 +143,11 @@ type AccessKeys struct { SecondaryKey *string `json:"secondaryKey,omitempty"` } -// CheckNameAvailabilityParameters parameters body to pass for name availability check. +// CheckNameAvailabilityParameters parameters body to pass for name availability check. type CheckNameAvailabilityParameters struct { // Name - Resource name. Name *string `json:"name,omitempty"` - // Type - Resource type. + // Type - Resource type. The only legal value of this property for checking redis cache name availability is 'Microsoft.Cache/redis'. Type *string `json:"type,omitempty"` } @@ -1372,6 +1372,108 @@ func (ps *PatchSchedule) UnmarshalJSON(body []byte) error { return nil } +// PatchScheduleListResult the response of list patch schedules Redis operation. +type PatchScheduleListResult struct { + autorest.Response `json:"-"` + // Value - Results of the list patch schedules operation. + Value *[]PatchSchedule `json:"value,omitempty"` + // NextLink - Link for next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// PatchScheduleListResultIterator provides access to a complete listing of PatchSchedule values. +type PatchScheduleListResultIterator struct { + i int + page PatchScheduleListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *PatchScheduleListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PatchScheduleListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter PatchScheduleListResultIterator) Response() PatchScheduleListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter PatchScheduleListResultIterator) Value() PatchSchedule { + if !iter.page.NotDone() { + return PatchSchedule{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (pslr PatchScheduleListResult) IsEmpty() bool { + return pslr.Value == nil || len(*pslr.Value) == 0 +} + +// patchScheduleListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pslr PatchScheduleListResult) patchScheduleListResultPreparer() (*http.Request, error) { + if pslr.NextLink == nil || len(to.String(pslr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pslr.NextLink))) +} + +// PatchScheduleListResultPage contains a page of PatchSchedule values. +type PatchScheduleListResultPage struct { + fn func(PatchScheduleListResult) (PatchScheduleListResult, error) + pslr PatchScheduleListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *PatchScheduleListResultPage) Next() error { + next, err := page.fn(page.pslr) + if err != nil { + return err + } + page.pslr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PatchScheduleListResultPage) NotDone() bool { + return !page.pslr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PatchScheduleListResultPage) Response() PatchScheduleListResult { + return page.pslr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PatchScheduleListResultPage) Values() []PatchSchedule { + if page.pslr.IsEmpty() { + return nil + } + return *page.pslr.Value +} + // Properties properties of the redis cache. type Properties struct { // RedisVersion - Redis version. diff --git a/services/redis/mgmt/2017-10-01/redis/patchschedules.go b/services/redis/mgmt/2017-10-01/redis/patchschedules.go index 019b8e850a97..cccfda2a1457 100644 --- a/services/redis/mgmt/2017-10-01/redis/patchschedules.go +++ b/services/redis/mgmt/2017-10-01/redis/patchschedules.go @@ -41,10 +41,9 @@ func NewPatchSchedulesClientWithBaseURI(baseURI string, subscriptionID string) P } // CreateOrUpdate create or replace the patching schedule for Redis cache (requires Premium SKU). -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. -// parameters - parameters to set the patching schedule for Redis cache. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is +// parameters to set the patching schedule for Redis cache. func (client PatchSchedulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, name string, parameters PatchSchedule) (result PatchSchedule, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -119,9 +118,8 @@ func (client PatchSchedulesClient) CreateOrUpdateResponder(resp *http.Response) } // Delete deletes the patching schedule of a redis cache (requires Premium SKU). -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the redis cache. +// +// resourceGroupName is the name of the resource group. name is the name of the redis cache. func (client PatchSchedulesClient) Delete(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, name) if err != nil { @@ -186,9 +184,8 @@ func (client PatchSchedulesClient) DeleteResponder(resp *http.Response) (result } // Get gets the patching schedule of a redis cache (requires Premium SKU). -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the redis cache. +// +// resourceGroupName is the name of the resource group. name is the name of the redis cache. func (client PatchSchedulesClient) Get(ctx context.Context, resourceGroupName string, name string) (result PatchSchedule, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, name) if err != nil { @@ -252,3 +249,97 @@ func (client PatchSchedulesClient) GetResponder(resp *http.Response) (result Pat result.Response = autorest.Response{Response: resp} return } + +// ListByRedisResource gets all patch schedules in the specified redis cache (there is only one). +// +// resourceGroupName is the name of the resource group. cacheName is the name of the Redis cache. +func (client PatchSchedulesClient) ListByRedisResource(ctx context.Context, resourceGroupName string, cacheName string) (result PatchScheduleListResultPage, err error) { + result.fn = client.listByRedisResourceNextResults + req, err := client.ListByRedisResourcePreparer(ctx, resourceGroupName, cacheName) + if err != nil { + err = autorest.NewErrorWithError(err, "redis.PatchSchedulesClient", "ListByRedisResource", nil, "Failure preparing request") + return + } + + resp, err := client.ListByRedisResourceSender(req) + if err != nil { + result.pslr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "redis.PatchSchedulesClient", "ListByRedisResource", resp, "Failure sending request") + return + } + + result.pslr, err = client.ListByRedisResourceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "redis.PatchSchedulesClient", "ListByRedisResource", resp, "Failure responding to request") + } + + return +} + +// ListByRedisResourcePreparer prepares the ListByRedisResource request. +func (client PatchSchedulesClient) ListByRedisResourcePreparer(ctx context.Context, resourceGroupName string, cacheName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cacheName": autorest.Encode("path", cacheName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-10-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.Cache/Redis/{cacheName}/patchSchedules", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByRedisResourceSender sends the ListByRedisResource request. The method will close the +// http.Response Body if it receives an error. +func (client PatchSchedulesClient) ListByRedisResourceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByRedisResourceResponder handles the response to the ListByRedisResource request. The method always +// closes the http.Response Body. +func (client PatchSchedulesClient) ListByRedisResourceResponder(resp *http.Response) (result PatchScheduleListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByRedisResourceNextResults retrieves the next set of results, if any. +func (client PatchSchedulesClient) listByRedisResourceNextResults(lastResults PatchScheduleListResult) (result PatchScheduleListResult, err error) { + req, err := lastResults.patchScheduleListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "redis.PatchSchedulesClient", "listByRedisResourceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByRedisResourceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "redis.PatchSchedulesClient", "listByRedisResourceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByRedisResourceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "redis.PatchSchedulesClient", "listByRedisResourceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByRedisResourceComplete enumerates all values, automatically crossing page boundaries as required. +func (client PatchSchedulesClient) ListByRedisResourceComplete(ctx context.Context, resourceGroupName string, cacheName string) (result PatchScheduleListResultIterator, err error) { + result.page, err = client.ListByRedisResource(ctx, resourceGroupName, cacheName) + return +} diff --git a/services/redis/mgmt/2017-10-01/redis/redis.go b/services/redis/mgmt/2017-10-01/redis/redis.go index a40d75b41fc4..f4e2aae3520a 100644 --- a/services/redis/mgmt/2017-10-01/redis/redis.go +++ b/services/redis/mgmt/2017-10-01/redis/redis.go @@ -41,9 +41,17 @@ func NewClientWithBaseURI(baseURI string, subscriptionID string) Client { } // CheckNameAvailability checks that the redis cache name is valid and is not already in use. -// Parameters: -// parameters - parameters supplied to the CheckNameAvailability Redis operation. +// +// parameters is parameters supplied to the CheckNameAvailability Redis operation. The only supported resource type +// is 'Microsoft.Cache/redis' func (client Client) CheckNameAvailability(ctx context.Context, parameters CheckNameAvailabilityParameters) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Type", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("redis.Client", "CheckNameAvailability", err.Error()) + } + req, err := client.CheckNameAvailabilityPreparer(ctx, parameters) if err != nil { err = autorest.NewErrorWithError(err, "redis.Client", "CheckNameAvailability", nil, "Failure preparing request") @@ -106,10 +114,9 @@ func (client Client) CheckNameAvailabilityResponder(resp *http.Response) (result } // Create create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. -// parameters - parameters supplied to the Create Redis operation. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is +// parameters supplied to the Create Redis operation. func (client Client) Create(ctx context.Context, resourceGroupName string, name string, parameters CreateParameters) (result CreateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -192,9 +199,8 @@ func (client Client) CreateResponder(resp *http.Response) (result ResourceType, } // Delete deletes a Redis cache. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. func (client Client) Delete(ctx context.Context, resourceGroupName string, name string) (result DeleteFuture, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, name) if err != nil { @@ -260,10 +266,9 @@ func (client Client) DeleteResponder(resp *http.Response) (result autorest.Respo } // ExportData export data from the redis cache to blobs in a container. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. -// parameters - parameters for Redis export operation. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is +// parameters for Redis export operation. func (client Client) ExportData(ctx context.Context, resourceGroupName string, name string, parameters ExportRDBParameters) (result ExportDataFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -339,10 +344,9 @@ func (client Client) ExportDataResponder(resp *http.Response) (result autorest.R // ForceReboot reboot specified Redis node(s). This operation requires write permission to the cache resource. There // can be potential data loss. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. -// parameters - specifies which Redis node(s) to reboot. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is +// specifies which Redis node(s) to reboot. func (client Client) ForceReboot(ctx context.Context, resourceGroupName string, name string, parameters RebootParameters) (result ForceRebootResponse, err error) { req, err := client.ForceRebootPreparer(ctx, resourceGroupName, name, parameters) if err != nil { @@ -409,9 +413,8 @@ func (client Client) ForceRebootResponder(resp *http.Response) (result ForceRebo } // Get gets a Redis cache (resource description). -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. func (client Client) Get(ctx context.Context, resourceGroupName string, name string) (result ResourceType, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, name) if err != nil { @@ -476,10 +479,9 @@ func (client Client) GetResponder(resp *http.Response) (result ResourceType, err } // ImportData import data into Redis cache. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. -// parameters - parameters for Redis import operation. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is +// parameters for Redis import operation. func (client Client) ImportData(ctx context.Context, resourceGroupName string, name string, parameters ImportRDBParameters) (result ImportDataFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -643,8 +645,8 @@ func (client Client) ListComplete(ctx context.Context) (result ListResultIterato } // ListByResourceGroup lists all Redis caches in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. +// +// resourceGroupName is the name of the resource group. func (client Client) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ListResultPage, err error) { result.fn = client.listByResourceGroupNextResults req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) @@ -736,9 +738,8 @@ func (client Client) ListByResourceGroupComplete(ctx context.Context, resourceGr } // ListKeys retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. func (client Client) ListKeys(ctx context.Context, resourceGroupName string, name string) (result AccessKeys, err error) { req, err := client.ListKeysPreparer(ctx, resourceGroupName, name) if err != nil { @@ -803,10 +804,9 @@ func (client Client) ListKeysResponder(resp *http.Response) (result AccessKeys, } // ListUpgradeNotifications gets any upgrade notifications for a Redis cache. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. -// history - how many minutes in past to look for upgrade notifications +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. history is how many +// minutes in past to look for upgrade notifications func (client Client) ListUpgradeNotifications(ctx context.Context, resourceGroupName string, name string, history float64) (result NotificationListResponse, err error) { req, err := client.ListUpgradeNotificationsPreparer(ctx, resourceGroupName, name, history) if err != nil { @@ -872,10 +872,9 @@ func (client Client) ListUpgradeNotificationsResponder(resp *http.Response) (res } // RegenerateKey regenerate Redis cache's access keys. This operation requires write permission to the cache resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. -// parameters - specifies which key to regenerate. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is +// specifies which key to regenerate. func (client Client) RegenerateKey(ctx context.Context, resourceGroupName string, name string, parameters RegenerateKeyParameters) (result AccessKeys, err error) { req, err := client.RegenerateKeyPreparer(ctx, resourceGroupName, name, parameters) if err != nil { @@ -942,10 +941,9 @@ func (client Client) RegenerateKeyResponder(resp *http.Response) (result AccessK } // Update update an existing Redis cache. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. -// parameters - parameters supplied to the Update Redis operation. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is +// parameters supplied to the Update Redis operation. func (client Client) Update(ctx context.Context, resourceGroupName string, name string, parameters UpdateParameters) (result ResourceType, err error) { req, err := client.UpdatePreparer(ctx, resourceGroupName, name, parameters) if err != nil { diff --git a/services/redis/mgmt/2018-03-01/redis/firewallrules.go b/services/redis/mgmt/2018-03-01/redis/firewallrules.go index 7dffed644438..6d215106efe3 100644 --- a/services/redis/mgmt/2018-03-01/redis/firewallrules.go +++ b/services/redis/mgmt/2018-03-01/redis/firewallrules.go @@ -41,11 +41,10 @@ func NewFirewallRulesClientWithBaseURI(baseURI string, subscriptionID string) Fi } // CreateOrUpdate create or update a redis cache firewall rule -// Parameters: -// resourceGroupName - the name of the resource group. -// cacheName - the name of the Redis cache. -// ruleName - the name of the firewall rule. -// parameters - parameters supplied to the create or update redis firewall rule operation. +// +// resourceGroupName is the name of the resource group. cacheName is the name of the Redis cache. ruleName is the +// name of the firewall rule. parameters is parameters supplied to the create or update redis firewall rule +// operation. func (client FirewallRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, cacheName string, ruleName string, parameters FirewallRuleCreateParameters) (result FirewallRule, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -122,10 +121,9 @@ func (client FirewallRulesClient) CreateOrUpdateResponder(resp *http.Response) ( } // Delete deletes a single firewall rule in a specified redis cache. -// Parameters: -// resourceGroupName - the name of the resource group. -// cacheName - the name of the Redis cache. -// ruleName - the name of the firewall rule. +// +// resourceGroupName is the name of the resource group. cacheName is the name of the Redis cache. ruleName is the +// name of the firewall rule. func (client FirewallRulesClient) Delete(ctx context.Context, resourceGroupName string, cacheName string, ruleName string) (result autorest.Response, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, cacheName, ruleName) if err != nil { @@ -190,10 +188,9 @@ func (client FirewallRulesClient) DeleteResponder(resp *http.Response) (result a } // Get gets a single firewall rule in a specified redis cache. -// Parameters: -// resourceGroupName - the name of the resource group. -// cacheName - the name of the Redis cache. -// ruleName - the name of the firewall rule. +// +// resourceGroupName is the name of the resource group. cacheName is the name of the Redis cache. ruleName is the +// name of the firewall rule. func (client FirewallRulesClient) Get(ctx context.Context, resourceGroupName string, cacheName string, ruleName string) (result FirewallRule, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, cacheName, ruleName) if err != nil { @@ -259,9 +256,8 @@ func (client FirewallRulesClient) GetResponder(resp *http.Response) (result Fire } // ListByRedisResource gets all firewall rules in the specified redis cache. -// Parameters: -// resourceGroupName - the name of the resource group. -// cacheName - the name of the Redis cache. +// +// resourceGroupName is the name of the resource group. cacheName is the name of the Redis cache. func (client FirewallRulesClient) ListByRedisResource(ctx context.Context, resourceGroupName string, cacheName string) (result FirewallRuleListResultPage, err error) { result.fn = client.listByRedisResourceNextResults req, err := client.ListByRedisResourcePreparer(ctx, resourceGroupName, cacheName) diff --git a/services/redis/mgmt/2018-03-01/redis/linkedserver.go b/services/redis/mgmt/2018-03-01/redis/linkedserver.go index 393872ad30ad..3f5d7fd641c7 100644 --- a/services/redis/mgmt/2018-03-01/redis/linkedserver.go +++ b/services/redis/mgmt/2018-03-01/redis/linkedserver.go @@ -41,11 +41,10 @@ func NewLinkedServerClientWithBaseURI(baseURI string, subscriptionID string) Lin } // Create adds a linked server to the Redis cache (requires Premium SKU). -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. -// linkedServerName - the name of the linked server that is being added to the Redis cache. -// parameters - parameters supplied to the Create Linked server operation. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. linkedServerName is +// the name of the linked server that is being added to the Redis cache. parameters is parameters supplied to the +// Create Linked server operation. func (client LinkedServerClient) Create(ctx context.Context, resourceGroupName string, name string, linkedServerName string, parameters LinkedServerCreateParameters) (result LinkedServerCreateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -124,10 +123,9 @@ func (client LinkedServerClient) CreateResponder(resp *http.Response) (result Li } // Delete deletes the linked server from a redis cache (requires Premium SKU). -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the redis cache. -// linkedServerName - the name of the linked server that is being added to the Redis cache. +// +// resourceGroupName is the name of the resource group. name is the name of the redis cache. linkedServerName is +// the name of the linked server that is being added to the Redis cache. func (client LinkedServerClient) Delete(ctx context.Context, resourceGroupName string, name string, linkedServerName string) (result autorest.Response, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, name, linkedServerName) if err != nil { @@ -192,10 +190,9 @@ func (client LinkedServerClient) DeleteResponder(resp *http.Response) (result au } // Get gets the detailed information about a linked server of a redis cache (requires Premium SKU). -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the redis cache. -// linkedServerName - the name of the linked server. +// +// resourceGroupName is the name of the resource group. name is the name of the redis cache. linkedServerName is +// the name of the linked server. func (client LinkedServerClient) Get(ctx context.Context, resourceGroupName string, name string, linkedServerName string) (result LinkedServerWithProperties, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, name, linkedServerName) if err != nil { @@ -261,9 +258,8 @@ func (client LinkedServerClient) GetResponder(resp *http.Response) (result Linke } // List gets the list of linked servers associated with this redis cache (requires Premium SKU). -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the redis cache. +// +// resourceGroupName is the name of the resource group. name is the name of the redis cache. func (client LinkedServerClient) List(ctx context.Context, resourceGroupName string, name string) (result LinkedServerWithPropertiesListPage, err error) { result.fn = client.listNextResults req, err := client.ListPreparer(ctx, resourceGroupName, name) diff --git a/services/redis/mgmt/2018-03-01/redis/models.go b/services/redis/mgmt/2018-03-01/redis/models.go index 2b36a2bd83da..4e10cd26d9fa 100644 --- a/services/redis/mgmt/2018-03-01/redis/models.go +++ b/services/redis/mgmt/2018-03-01/redis/models.go @@ -195,11 +195,11 @@ type AccessKeys struct { SecondaryKey *string `json:"secondaryKey,omitempty"` } -// CheckNameAvailabilityParameters parameters body to pass for name availability check. +// CheckNameAvailabilityParameters parameters body to pass for resource name availability check. type CheckNameAvailabilityParameters struct { // Name - Resource name. Name *string `json:"name,omitempty"` - // Type - Resource type. + // Type - Resource type. The only legal value of this property for checking redis cache name availability is 'Microsoft.Cache/redis'. Type *string `json:"type,omitempty"` } @@ -650,7 +650,7 @@ type FirewallRuleListResult struct { autorest.Response `json:"-"` // Value - Results of the list firewall rules operation. Value *[]FirewallRule `json:"value,omitempty"` - // NextLink - Link for next set of locations. + // NextLink - Link for next page of results. NextLink *string `json:"nextLink,omitempty"` } @@ -1123,7 +1123,7 @@ type ListResult struct { autorest.Response `json:"-"` // Value - List of Redis cache instances. Value *[]ResourceType `json:"value,omitempty"` - // NextLink - Link for next set of locations. + // NextLink - Link for next page of results. NextLink *string `json:"nextLink,omitempty"` } @@ -1434,6 +1434,108 @@ func (ps *PatchSchedule) UnmarshalJSON(body []byte) error { return nil } +// PatchScheduleListResult the response of list patch schedules Redis operation. +type PatchScheduleListResult struct { + autorest.Response `json:"-"` + // Value - Results of the list patch schedules operation. + Value *[]PatchSchedule `json:"value,omitempty"` + // NextLink - Link for next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// PatchScheduleListResultIterator provides access to a complete listing of PatchSchedule values. +type PatchScheduleListResultIterator struct { + i int + page PatchScheduleListResultPage +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *PatchScheduleListResultIterator) Next() error { + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err := iter.page.Next() + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PatchScheduleListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter PatchScheduleListResultIterator) Response() PatchScheduleListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter PatchScheduleListResultIterator) Value() PatchSchedule { + if !iter.page.NotDone() { + return PatchSchedule{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (pslr PatchScheduleListResult) IsEmpty() bool { + return pslr.Value == nil || len(*pslr.Value) == 0 +} + +// patchScheduleListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pslr PatchScheduleListResult) patchScheduleListResultPreparer() (*http.Request, error) { + if pslr.NextLink == nil || len(to.String(pslr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pslr.NextLink))) +} + +// PatchScheduleListResultPage contains a page of PatchSchedule values. +type PatchScheduleListResultPage struct { + fn func(PatchScheduleListResult) (PatchScheduleListResult, error) + pslr PatchScheduleListResult +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *PatchScheduleListResultPage) Next() error { + next, err := page.fn(page.pslr) + if err != nil { + return err + } + page.pslr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PatchScheduleListResultPage) NotDone() bool { + return !page.pslr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PatchScheduleListResultPage) Response() PatchScheduleListResult { + return page.pslr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PatchScheduleListResultPage) Values() []PatchSchedule { + if page.pslr.IsEmpty() { + return nil + } + return *page.pslr.Value +} + // Properties properties of the redis cache. type Properties struct { // RedisVersion - Redis version. diff --git a/services/redis/mgmt/2018-03-01/redis/patchschedules.go b/services/redis/mgmt/2018-03-01/redis/patchschedules.go index a92e1abcc981..197103bc4eaf 100644 --- a/services/redis/mgmt/2018-03-01/redis/patchschedules.go +++ b/services/redis/mgmt/2018-03-01/redis/patchschedules.go @@ -41,10 +41,9 @@ func NewPatchSchedulesClientWithBaseURI(baseURI string, subscriptionID string) P } // CreateOrUpdate create or replace the patching schedule for Redis cache (requires Premium SKU). -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. -// parameters - parameters to set the patching schedule for Redis cache. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is +// parameters to set the patching schedule for Redis cache. func (client PatchSchedulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, name string, parameters PatchSchedule) (result PatchSchedule, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -119,9 +118,8 @@ func (client PatchSchedulesClient) CreateOrUpdateResponder(resp *http.Response) } // Delete deletes the patching schedule of a redis cache (requires Premium SKU). -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the redis cache. +// +// resourceGroupName is the name of the resource group. name is the name of the redis cache. func (client PatchSchedulesClient) Delete(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, name) if err != nil { @@ -186,9 +184,8 @@ func (client PatchSchedulesClient) DeleteResponder(resp *http.Response) (result } // Get gets the patching schedule of a redis cache (requires Premium SKU). -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the redis cache. +// +// resourceGroupName is the name of the resource group. name is the name of the redis cache. func (client PatchSchedulesClient) Get(ctx context.Context, resourceGroupName string, name string) (result PatchSchedule, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, name) if err != nil { @@ -252,3 +249,97 @@ func (client PatchSchedulesClient) GetResponder(resp *http.Response) (result Pat result.Response = autorest.Response{Response: resp} return } + +// ListByRedisResource gets all patch schedules in the specified redis cache (there is only one). +// +// resourceGroupName is the name of the resource group. cacheName is the name of the Redis cache. +func (client PatchSchedulesClient) ListByRedisResource(ctx context.Context, resourceGroupName string, cacheName string) (result PatchScheduleListResultPage, err error) { + result.fn = client.listByRedisResourceNextResults + req, err := client.ListByRedisResourcePreparer(ctx, resourceGroupName, cacheName) + if err != nil { + err = autorest.NewErrorWithError(err, "redis.PatchSchedulesClient", "ListByRedisResource", nil, "Failure preparing request") + return + } + + resp, err := client.ListByRedisResourceSender(req) + if err != nil { + result.pslr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "redis.PatchSchedulesClient", "ListByRedisResource", resp, "Failure sending request") + return + } + + result.pslr, err = client.ListByRedisResourceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "redis.PatchSchedulesClient", "ListByRedisResource", resp, "Failure responding to request") + } + + return +} + +// ListByRedisResourcePreparer prepares the ListByRedisResource request. +func (client PatchSchedulesClient) ListByRedisResourcePreparer(ctx context.Context, resourceGroupName string, cacheName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "cacheName": autorest.Encode("path", cacheName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-03-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.Cache/Redis/{cacheName}/patchSchedules", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByRedisResourceSender sends the ListByRedisResource request. The method will close the +// http.Response Body if it receives an error. +func (client PatchSchedulesClient) ListByRedisResourceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByRedisResourceResponder handles the response to the ListByRedisResource request. The method always +// closes the http.Response Body. +func (client PatchSchedulesClient) ListByRedisResourceResponder(resp *http.Response) (result PatchScheduleListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByRedisResourceNextResults retrieves the next set of results, if any. +func (client PatchSchedulesClient) listByRedisResourceNextResults(lastResults PatchScheduleListResult) (result PatchScheduleListResult, err error) { + req, err := lastResults.patchScheduleListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "redis.PatchSchedulesClient", "listByRedisResourceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByRedisResourceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "redis.PatchSchedulesClient", "listByRedisResourceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByRedisResourceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "redis.PatchSchedulesClient", "listByRedisResourceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByRedisResourceComplete enumerates all values, automatically crossing page boundaries as required. +func (client PatchSchedulesClient) ListByRedisResourceComplete(ctx context.Context, resourceGroupName string, cacheName string) (result PatchScheduleListResultIterator, err error) { + result.page, err = client.ListByRedisResource(ctx, resourceGroupName, cacheName) + return +} diff --git a/services/redis/mgmt/2018-03-01/redis/redis.go b/services/redis/mgmt/2018-03-01/redis/redis.go index 7deb4ffc0048..e54952be85b9 100644 --- a/services/redis/mgmt/2018-03-01/redis/redis.go +++ b/services/redis/mgmt/2018-03-01/redis/redis.go @@ -41,9 +41,17 @@ func NewClientWithBaseURI(baseURI string, subscriptionID string) Client { } // CheckNameAvailability checks that the redis cache name is valid and is not already in use. -// Parameters: -// parameters - parameters supplied to the CheckNameAvailability Redis operation. +// +// parameters is parameters supplied to the CheckNameAvailability Redis operation. The only supported resource type +// is 'Microsoft.Cache/redis' func (client Client) CheckNameAvailability(ctx context.Context, parameters CheckNameAvailabilityParameters) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Type", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("redis.Client", "CheckNameAvailability", err.Error()) + } + req, err := client.CheckNameAvailabilityPreparer(ctx, parameters) if err != nil { err = autorest.NewErrorWithError(err, "redis.Client", "CheckNameAvailability", nil, "Failure preparing request") @@ -106,10 +114,9 @@ func (client Client) CheckNameAvailabilityResponder(resp *http.Response) (result } // Create create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. -// parameters - parameters supplied to the Create Redis operation. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is +// parameters supplied to the Create Redis operation. func (client Client) Create(ctx context.Context, resourceGroupName string, name string, parameters CreateParameters) (result CreateFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -192,9 +199,8 @@ func (client Client) CreateResponder(resp *http.Response) (result ResourceType, } // Delete deletes a Redis cache. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. func (client Client) Delete(ctx context.Context, resourceGroupName string, name string) (result DeleteFuture, err error) { req, err := client.DeletePreparer(ctx, resourceGroupName, name) if err != nil { @@ -260,10 +266,9 @@ func (client Client) DeleteResponder(resp *http.Response) (result autorest.Respo } // ExportData export data from the redis cache to blobs in a container. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. -// parameters - parameters for Redis export operation. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is +// parameters for Redis export operation. func (client Client) ExportData(ctx context.Context, resourceGroupName string, name string, parameters ExportRDBParameters) (result ExportDataFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -339,10 +344,9 @@ func (client Client) ExportDataResponder(resp *http.Response) (result autorest.R // ForceReboot reboot specified Redis node(s). This operation requires write permission to the cache resource. There // can be potential data loss. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. -// parameters - specifies which Redis node(s) to reboot. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is +// specifies which Redis node(s) to reboot. func (client Client) ForceReboot(ctx context.Context, resourceGroupName string, name string, parameters RebootParameters) (result ForceRebootResponse, err error) { req, err := client.ForceRebootPreparer(ctx, resourceGroupName, name, parameters) if err != nil { @@ -409,9 +413,8 @@ func (client Client) ForceRebootResponder(resp *http.Response) (result ForceRebo } // Get gets a Redis cache (resource description). -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. func (client Client) Get(ctx context.Context, resourceGroupName string, name string) (result ResourceType, err error) { req, err := client.GetPreparer(ctx, resourceGroupName, name) if err != nil { @@ -476,10 +479,9 @@ func (client Client) GetResponder(resp *http.Response) (result ResourceType, err } // ImportData import data into Redis cache. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. -// parameters - parameters for Redis import operation. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is +// parameters for Redis import operation. func (client Client) ImportData(ctx context.Context, resourceGroupName string, name string, parameters ImportRDBParameters) (result ImportDataFuture, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -643,8 +645,8 @@ func (client Client) ListComplete(ctx context.Context) (result ListResultIterato } // ListByResourceGroup lists all Redis caches in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. +// +// resourceGroupName is the name of the resource group. func (client Client) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ListResultPage, err error) { result.fn = client.listByResourceGroupNextResults req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) @@ -736,9 +738,8 @@ func (client Client) ListByResourceGroupComplete(ctx context.Context, resourceGr } // ListKeys retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. func (client Client) ListKeys(ctx context.Context, resourceGroupName string, name string) (result AccessKeys, err error) { req, err := client.ListKeysPreparer(ctx, resourceGroupName, name) if err != nil { @@ -803,10 +804,9 @@ func (client Client) ListKeysResponder(resp *http.Response) (result AccessKeys, } // ListUpgradeNotifications gets any upgrade notifications for a Redis cache. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. -// history - how many minutes in past to look for upgrade notifications +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. history is how many +// minutes in past to look for upgrade notifications func (client Client) ListUpgradeNotifications(ctx context.Context, resourceGroupName string, name string, history float64) (result NotificationListResponse, err error) { req, err := client.ListUpgradeNotificationsPreparer(ctx, resourceGroupName, name, history) if err != nil { @@ -872,10 +872,9 @@ func (client Client) ListUpgradeNotificationsResponder(resp *http.Response) (res } // RegenerateKey regenerate Redis cache's access keys. This operation requires write permission to the cache resource. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. -// parameters - specifies which key to regenerate. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is +// specifies which key to regenerate. func (client Client) RegenerateKey(ctx context.Context, resourceGroupName string, name string, parameters RegenerateKeyParameters) (result AccessKeys, err error) { req, err := client.RegenerateKeyPreparer(ctx, resourceGroupName, name, parameters) if err != nil { @@ -942,10 +941,9 @@ func (client Client) RegenerateKeyResponder(resp *http.Response) (result AccessK } // Update update an existing Redis cache. -// Parameters: -// resourceGroupName - the name of the resource group. -// name - the name of the Redis cache. -// parameters - parameters supplied to the Update Redis operation. +// +// resourceGroupName is the name of the resource group. name is the name of the Redis cache. parameters is +// parameters supplied to the Update Redis operation. func (client Client) Update(ctx context.Context, resourceGroupName string, name string, parameters UpdateParameters) (result ResourceType, err error) { req, err := client.UpdatePreparer(ctx, resourceGroupName, name, parameters) if err != nil {