diff --git a/services/automation/mgmt/2015-10-31/automation/models.go b/services/automation/mgmt/2015-10-31/automation/models.go index d38eb8bb6bdd..9e249109b43f 100644 --- a/services/automation/mgmt/2015-10-31/automation/models.go +++ b/services/automation/mgmt/2015-10-31/automation/models.go @@ -978,6 +978,8 @@ type Certificate struct { ID *string `json:"id,omitempty"` // Name - Gets the name of the certificate. Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` // CertificateProperties - Gets or sets the properties of the certificate. *CertificateProperties `json:"properties,omitempty"` } @@ -1011,6 +1013,16 @@ func (c *Certificate) UnmarshalJSON(body []byte) error { c.Name = &name } + v = m["type"] + if v != nil { + var typeVar string + err = json.Unmarshal(*m["type"], &typeVar) + if err != nil { + return err + } + c.Type = &typeVar + } + v = m["properties"] if v != nil { var properties CertificateProperties @@ -1248,6 +1260,8 @@ type Connection struct { ID *string `json:"id,omitempty"` // Name - Gets the name of the connection. Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` // ConnectionProperties - Gets or sets the properties of the connection. *ConnectionProperties `json:"properties,omitempty"` } @@ -1281,6 +1295,16 @@ func (c *Connection) UnmarshalJSON(body []byte) error { c.Name = &name } + v = m["type"] + if v != nil { + var typeVar string + err = json.Unmarshal(*m["type"], &typeVar) + if err != nil { + return err + } + c.Type = &typeVar + } + v = m["properties"] if v != nil { var properties ConnectionProperties @@ -1467,6 +1491,8 @@ type ConnectionType struct { ID *string `json:"id,omitempty"` // Name - Gets the name of the connection type. Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` // ConnectionTypeProperties - Gets or sets the properties of the connection type. *ConnectionTypeProperties `json:"properties,omitempty"` } @@ -1500,6 +1526,16 @@ func (ct *ConnectionType) UnmarshalJSON(body []byte) error { ct.Name = &name } + v = m["type"] + if v != nil { + var typeVar string + err = json.Unmarshal(*m["type"], &typeVar) + if err != nil { + return err + } + ct.Type = &typeVar + } + v = m["properties"] if v != nil { var properties ConnectionTypeProperties @@ -1768,6 +1804,8 @@ type Credential struct { ID *string `json:"id,omitempty"` // Name - Gets the name of the credential. Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` // CredentialProperties - Gets or sets the properties of the credential. *CredentialProperties `json:"properties,omitempty"` } @@ -1801,6 +1839,16 @@ func (c *Credential) UnmarshalJSON(body []byte) error { c.Name = &name } + v = m["type"] + if v != nil { + var typeVar string + err = json.Unmarshal(*m["type"], &typeVar) + if err != nil { + return err + } + c.Type = &typeVar + } + v = m["properties"] if v != nil { var properties CredentialProperties @@ -3490,8 +3538,12 @@ type JobProperties struct { // JobSchedule definition of the job schedule. type JobSchedule struct { autorest.Response `json:"-"` - // ID - Gets or sets the id of the resource. + // ID - Gets the id of the resource. ID *string `json:"id,omitempty"` + // Name - Gets the name of the variable. + Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` // JobScheduleProperties - Gets or sets the properties of the job schedule. *JobScheduleProperties `json:"properties,omitempty"` } @@ -3515,6 +3567,26 @@ func (js *JobSchedule) UnmarshalJSON(body []byte) error { js.ID = &ID } + v = m["name"] + if v != nil { + var name string + err = json.Unmarshal(*m["name"], &name) + if err != nil { + return err + } + js.Name = &name + } + + v = m["type"] + if v != nil { + var typeVar string + err = json.Unmarshal(*m["type"], &typeVar) + if err != nil { + return err + } + js.Type = &typeVar + } + v = m["properties"] if v != nil { var properties JobScheduleProperties @@ -4510,22 +4582,30 @@ func (future RunbookDraftCreateOrUpdateFuture) Result(client RunbookDraftClient) var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("automation.RunbookDraftCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("automation.RunbookDraftCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } var resp *http.Response resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } ar, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -4541,22 +4621,30 @@ func (future RunbookDraftPublishFuture) Result(client RunbookDraftClient) (r Run var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftPublishFuture", "Result", future.Response(), "Polling failure") return } if !done { - return r, autorest.NewError("automation.RunbookDraftPublishFuture", "Result", "asynchronous operation has not completed") + return r, azure.NewAsyncOpIncompleteError("automation.RunbookDraftPublishFuture") } if future.PollingMethod() == azure.PollingLocation { r, err = client.PublishResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftPublishFuture", "Result", future.Response(), "Failure responding to request") + } return } var resp *http.Response resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftPublishFuture", "Result", resp, "Failure sending request") return } r, err = client.PublishResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftPublishFuture", "Result", resp, "Failure responding to request") + } return } @@ -4795,10 +4883,12 @@ type RunbookUpdateProperties struct { // Schedule definition of the schedule. type Schedule struct { autorest.Response `json:"-"` - // ID - Gets or sets the id of the resource. + // ID - Gets the id of the resource. ID *string `json:"id,omitempty"` - // Name - Gets or sets the name of the schedule. + // Name - Gets name of the schedule. Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` // ScheduleProperties - Gets or sets the properties of the schedule. *ScheduleProperties `json:"properties,omitempty"` } @@ -4832,6 +4922,16 @@ func (s *Schedule) UnmarshalJSON(body []byte) error { s.Name = &name } + v = m["type"] + if v != nil { + var typeVar string + err = json.Unmarshal(*m["type"], &typeVar) + if err != nil { + return err + } + s.Type = &typeVar + } + v = m["properties"] if v != nil { var properties ScheduleProperties @@ -5218,10 +5318,12 @@ type UsageListResult struct { // Variable definition of the varible. type Variable struct { autorest.Response `json:"-"` - // ID - Gets or sets the id of the resource. + // ID - Gets the id of the resource. ID *string `json:"id,omitempty"` - // Name - Gets or sets the name of the variable. + // Name - Gets the name of the variable. Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` // VariableProperties - Gets or sets the properties of the variable. *VariableProperties `json:"properties,omitempty"` } @@ -5255,6 +5357,16 @@ func (vVar *Variable) UnmarshalJSON(body []byte) error { vVar.Name = &name } + v = m["type"] + if v != nil { + var typeVar string + err = json.Unmarshal(*m["type"], &typeVar) + if err != nil { + return err + } + vVar.Type = &typeVar + } + v = m["properties"] if v != nil { var properties VariableProperties diff --git a/services/automation/mgmt/2015-10-31/automation/runbookdraft.go b/services/automation/mgmt/2015-10-31/automation/runbookdraft.go index d5d8163374d1..927447e2b340 100644 --- a/services/automation/mgmt/2015-10-31/automation/runbookdraft.go +++ b/services/automation/mgmt/2015-10-31/automation/runbookdraft.go @@ -83,6 +83,7 @@ func (client RunbookDraftClient) CreateOrUpdatePreparer(ctx context.Context, aut } preparer := autorest.CreatePreparer( + autorest.AsOctetStream(), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content", pathParameters), diff --git a/services/automation/mgmt/2015-10-31/automation/version.go b/services/automation/mgmt/2015-10-31/automation/version.go index 9a15d90c5d50..9a7e1a3ff0f3 100644 --- a/services/automation/mgmt/2015-10-31/automation/version.go +++ b/services/automation/mgmt/2015-10-31/automation/version.go @@ -19,10 +19,10 @@ package automation // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v12.1.1-beta services" + return "Azure-SDK-For-Go/v12.2.1-beta services" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v12.1.1-beta" + return "v12.2.1-beta" } diff --git a/services/automation/mgmt/2017-05-15-preview/models.go b/services/automation/mgmt/2017-05-15-preview/models.go index 98b938621ad2..f12d384b02f5 100644 --- a/services/automation/mgmt/2017-05-15-preview/models.go +++ b/services/automation/mgmt/2017-05-15-preview/models.go @@ -294,6 +294,18 @@ const ( Windows OperatingSystemType = "Windows" ) +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // ProvisioningStateFailed ... + ProvisioningStateFailed ProvisioningState = "Failed" + // ProvisioningStateRunning ... + ProvisioningStateRunning ProvisioningState = "Running" + // ProvisioningStateSucceeded ... + ProvisioningStateSucceeded ProvisioningState = "Succeeded" +) + // RunbookProvisioningState enumerates the values for runbook provisioning state. type RunbookProvisioningState string @@ -378,6 +390,18 @@ const ( Free SkuNameEnum = "Free" ) +// SourceType enumerates the values for source type. +type SourceType string + +const ( + // GitHub ... + GitHub SourceType = "GitHub" + // VsoGit ... + VsoGit SourceType = "VsoGit" + // VsoTfvc ... + VsoTfvc SourceType = "VsoTfvc" +) + // WindowsUpdateClasses enumerates the values for windows update classes. type WindowsUpdateClasses string @@ -1026,6 +1050,8 @@ type Certificate struct { ID *string `json:"id,omitempty"` // Name - Gets the name of the certificate. Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` // CertificateProperties - Gets or sets the properties of the certificate. *CertificateProperties `json:"properties,omitempty"` } @@ -1059,6 +1085,16 @@ func (c *Certificate) UnmarshalJSON(body []byte) error { c.Name = &name } + v = m["type"] + if v != nil { + var typeVar string + err = json.Unmarshal(*m["type"], &typeVar) + if err != nil { + return err + } + c.Type = &typeVar + } + v = m["properties"] if v != nil { var properties CertificateProperties @@ -1304,6 +1340,8 @@ type Connection struct { ID *string `json:"id,omitempty"` // Name - Gets the name of the connection. Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` // ConnectionProperties - Gets or sets the properties of the connection. *ConnectionProperties `json:"properties,omitempty"` } @@ -1337,6 +1375,16 @@ func (c *Connection) UnmarshalJSON(body []byte) error { c.Name = &name } + v = m["type"] + if v != nil { + var typeVar string + err = json.Unmarshal(*m["type"], &typeVar) + if err != nil { + return err + } + c.Type = &typeVar + } + v = m["properties"] if v != nil { var properties ConnectionProperties @@ -1523,6 +1571,8 @@ type ConnectionType struct { ID *string `json:"id,omitempty"` // Name - Gets the name of the connection type. Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` // ConnectionTypeProperties - Gets or sets the properties of the connection type. *ConnectionTypeProperties `json:"properties,omitempty"` } @@ -1556,6 +1606,16 @@ func (ct *ConnectionType) UnmarshalJSON(body []byte) error { ct.Name = &name } + v = m["type"] + if v != nil { + var typeVar string + err = json.Unmarshal(*m["type"], &typeVar) + if err != nil { + return err + } + ct.Type = &typeVar + } + v = m["properties"] if v != nil { var properties ConnectionTypeProperties @@ -1824,6 +1884,8 @@ type Credential struct { ID *string `json:"id,omitempty"` // Name - Gets the name of the credential. Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` // CredentialProperties - Gets or sets the properties of the credential. *CredentialProperties `json:"properties,omitempty"` } @@ -1857,6 +1919,16 @@ func (c *Credential) UnmarshalJSON(body []byte) error { c.Name = &name } + v = m["type"] + if v != nil { + var typeVar string + err = json.Unmarshal(*m["type"], &typeVar) + if err != nil { + return err + } + c.Type = &typeVar + } + v = m["properties"] if v != nil { var properties CredentialProperties @@ -3552,8 +3624,12 @@ type JobProperties struct { // JobSchedule definition of the job schedule. type JobSchedule struct { autorest.Response `json:"-"` - // ID - Gets or sets the id of the resource. + // ID - Gets the id of the resource. ID *string `json:"id,omitempty"` + // Name - Gets the name of the variable. + Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` // JobScheduleProperties - Gets or sets the properties of the job schedule. *JobScheduleProperties `json:"properties,omitempty"` } @@ -3577,6 +3653,26 @@ func (js *JobSchedule) UnmarshalJSON(body []byte) error { js.ID = &ID } + v = m["name"] + if v != nil { + var name string + err = json.Unmarshal(*m["name"], &name) + if err != nil { + return err + } + js.Name = &name + } + + v = m["type"] + if v != nil { + var typeVar string + err = json.Unmarshal(*m["type"], &typeVar) + if err != nil { + return err + } + js.Type = &typeVar + } + v = m["properties"] if v != nil { var properties JobScheduleProperties @@ -4580,22 +4676,30 @@ func (future RunbookDraftCreateOrUpdateFuture) Result(client RunbookDraftClient) var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - return ar, autorest.NewError("automation.RunbookDraftCreateOrUpdateFuture", "Result", "asynchronous operation has not completed") + return ar, azure.NewAsyncOpIncompleteError("automation.RunbookDraftCreateOrUpdateFuture") } if future.PollingMethod() == azure.PollingLocation { ar, err = client.CreateOrUpdateResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request") + } return } var resp *http.Response resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftCreateOrUpdateFuture", "Result", resp, "Failure sending request") return } ar, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftCreateOrUpdateFuture", "Result", resp, "Failure responding to request") + } return } @@ -4611,22 +4715,30 @@ func (future RunbookDraftPublishFuture) Result(client RunbookDraftClient) (r Run var done bool done, err = future.Done(client) if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftPublishFuture", "Result", future.Response(), "Polling failure") return } if !done { - return r, autorest.NewError("automation.RunbookDraftPublishFuture", "Result", "asynchronous operation has not completed") + return r, azure.NewAsyncOpIncompleteError("automation.RunbookDraftPublishFuture") } if future.PollingMethod() == azure.PollingLocation { r, err = client.PublishResponder(future.Response()) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftPublishFuture", "Result", future.Response(), "Failure responding to request") + } return } var resp *http.Response resp, err = autorest.SendWithSender(client, autorest.ChangeToGet(future.req), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftPublishFuture", "Result", resp, "Failure sending request") return } r, err = client.PublishResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.RunbookDraftPublishFuture", "Result", resp, "Failure responding to request") + } return } @@ -4865,10 +4977,12 @@ type RunbookUpdateProperties struct { // Schedule definition of the schedule. type Schedule struct { autorest.Response `json:"-"` - // ID - Gets or sets the id of the resource. + // ID - Gets the id of the resource. ID *string `json:"id,omitempty"` - // Name - Gets or sets the name of the schedule. + // Name - Gets name of the schedule. Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` // ScheduleProperties - Gets or sets the properties of the schedule. *ScheduleProperties `json:"properties,omitempty"` } @@ -4902,6 +5016,16 @@ func (s *Schedule) UnmarshalJSON(body []byte) error { s.Name = &name } + v = m["type"] + if v != nil { + var typeVar string + err = json.Unmarshal(*m["type"], &typeVar) + if err != nil { + return err + } + s.Type = &typeVar + } + v = m["properties"] if v != nil { var properties ScheduleProperties @@ -5485,6 +5609,537 @@ type SoftwareUpdateConfigurationRunProperties struct { LastModifiedBy *string `json:"lastModifiedBy,omitempty"` } +// SourceControl definition of the source control. +type SourceControl struct { + autorest.Response `json:"-"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // ID - Resource Id. + ID *string `json:"id,omitempty"` + // Type - Resource type. + Type *string `json:"type,omitempty"` + // SourceControlProperties - Gets or sets the properties of the source control. + *SourceControlProperties `json:"properties,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SourceControl struct. +func (sc *SourceControl) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + var v *json.RawMessage + + v = m["name"] + if v != nil { + var name string + err = json.Unmarshal(*m["name"], &name) + if err != nil { + return err + } + sc.Name = &name + } + + v = m["id"] + if v != nil { + var ID string + err = json.Unmarshal(*m["id"], &ID) + if err != nil { + return err + } + sc.ID = &ID + } + + v = m["type"] + if v != nil { + var typeVar string + err = json.Unmarshal(*m["type"], &typeVar) + if err != nil { + return err + } + sc.Type = &typeVar + } + + v = m["properties"] + if v != nil { + var properties SourceControlProperties + err = json.Unmarshal(*m["properties"], &properties) + if err != nil { + return err + } + sc.SourceControlProperties = &properties + } + + return nil +} + +// SourceControlCreateOrUpdateParameters the parameters supplied to the create or update source control operation. +type SourceControlCreateOrUpdateParameters struct { + // SourceControlCreateOrUpdateProperties - Gets or sets the properties of the source control. + *SourceControlCreateOrUpdateProperties `json:"properties,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SourceControlCreateOrUpdateParameters struct. +func (sccoup *SourceControlCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + var v *json.RawMessage + + v = m["properties"] + if v != nil { + var properties SourceControlCreateOrUpdateProperties + err = json.Unmarshal(*m["properties"], &properties) + if err != nil { + return err + } + sccoup.SourceControlCreateOrUpdateProperties = &properties + } + + return nil +} + +// SourceControlCreateOrUpdateProperties the properties of the create source control operation. +type SourceControlCreateOrUpdateProperties struct { + // RepoURL - Gets or sets the repo url of the source control. + RepoURL *string `json:"repoUrl,omitempty"` + // Branch - Gets or sets the repo branch of the source control. Include branch as empty string for VsoTfvc. + Branch *string `json:"branch,omitempty"` + // FolderPath - Gets or sets the folder path of the source control. Path must be relative. + FolderPath *string `json:"folderPath,omitempty"` + // AutoSync - Gets or sets auto async of the source control. Default is false. + AutoSync *bool `json:"autoSync,omitempty"` + // PublishRunbook - Gets or sets the auto publish of the source control. Default is true. + PublishRunbook *bool `json:"publishRunbook,omitempty"` + // SourceType - The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive. Possible values include: 'VsoGit', 'VsoTfvc', 'GitHub' + SourceType SourceType `json:"sourceType,omitempty"` + // SecurityToken - Gets or sets the authorization token for the repo of the source control. + SecurityToken *string `json:"securityToken,omitempty"` + // Description - Gets or sets the user description of the source control. + Description *string `json:"description,omitempty"` +} + +// SourceControlListResult the response model for the list source controls operation. +type SourceControlListResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of souce controls. + Value *[]SourceControl `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// SourceControlListResultIterator provides access to a complete listing of SourceControl values. +type SourceControlListResultIterator struct { + i int + page SourceControlListResultPage +} + +// 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 *SourceControlListResultIterator) 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 SourceControlListResultIterator) 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 SourceControlListResultIterator) Response() SourceControlListResult { + 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 SourceControlListResultIterator) Value() SourceControl { + if !iter.page.NotDone() { + return SourceControl{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (sclr SourceControlListResult) IsEmpty() bool { + return sclr.Value == nil || len(*sclr.Value) == 0 +} + +// sourceControlListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sclr SourceControlListResult) sourceControlListResultPreparer() (*http.Request, error) { + if sclr.NextLink == nil || len(to.String(sclr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sclr.NextLink))) +} + +// SourceControlListResultPage contains a page of SourceControl values. +type SourceControlListResultPage struct { + fn func(SourceControlListResult) (SourceControlListResult, error) + sclr SourceControlListResult +} + +// 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 *SourceControlListResultPage) Next() error { + next, err := page.fn(page.sclr) + if err != nil { + return err + } + page.sclr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SourceControlListResultPage) NotDone() bool { + return !page.sclr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SourceControlListResultPage) Response() SourceControlListResult { + return page.sclr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SourceControlListResultPage) Values() []SourceControl { + if page.sclr.IsEmpty() { + return nil + } + return *page.sclr.Value +} + +// SourceControlProperties definition of the source control properties +type SourceControlProperties struct { + // RepoURL - Gets or sets the repo url of the source control. + RepoURL *string `json:"repoUrl,omitempty"` + // Branch - Gets or sets the repo branch of the source control. Include branch as empty string for VsoTfvc. + Branch *string `json:"branch,omitempty"` + // FolderPath - Gets or sets the folder path of the source control. + FolderPath *string `json:"folderPath,omitempty"` + // AutoSync - Gets or sets auto async of the source control. Default is false. + AutoSync *bool `json:"autoSync,omitempty"` + // PublishRunbook - Gets or sets the auto publish of the source control. Default is true. + PublishRunbook *bool `json:"publishRunbook,omitempty"` + // SourceType - The source type. Must be one of VsoGit, VsoTfvc, GitHub. Possible values include: 'VsoGit', 'VsoTfvc', 'GitHub' + SourceType SourceType `json:"sourceType,omitempty"` + // Description - Gets or sets the description. + Description *string `json:"description,omitempty"` + // CreationTime - Gets or sets the creation time. + CreationTime *date.Time `json:"creationTime,omitempty"` + // LastModifiedTime - Gets or sets the last modified time. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` +} + +// SourceControlSyncJob definition of the source control sync job. +type SourceControlSyncJob struct { + autorest.Response `json:"-"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - Resource type. + Type *string `json:"type,omitempty"` + // ID - Resource id. + ID *string `json:"id,omitempty"` + // SourceControlSyncJobProperties - Gets the properties of the source control sync job. + *SourceControlSyncJobProperties `json:"properties,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SourceControlSyncJob struct. +func (scsj *SourceControlSyncJob) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + var v *json.RawMessage + + v = m["name"] + if v != nil { + var name string + err = json.Unmarshal(*m["name"], &name) + if err != nil { + return err + } + scsj.Name = &name + } + + v = m["type"] + if v != nil { + var typeVar string + err = json.Unmarshal(*m["type"], &typeVar) + if err != nil { + return err + } + scsj.Type = &typeVar + } + + v = m["id"] + if v != nil { + var ID string + err = json.Unmarshal(*m["id"], &ID) + if err != nil { + return err + } + scsj.ID = &ID + } + + v = m["properties"] + if v != nil { + var properties SourceControlSyncJobProperties + err = json.Unmarshal(*m["properties"], &properties) + if err != nil { + return err + } + scsj.SourceControlSyncJobProperties = &properties + } + + return nil +} + +// SourceControlSyncJobByID definition of the source control sync job. +type SourceControlSyncJobByID struct { + autorest.Response `json:"-"` + // ID - Gets the id of the job. + ID *string `json:"id,omitempty"` + // SourceControlSyncJobByIDProperties - Gets the properties of the source control sync job. + *SourceControlSyncJobByIDProperties `json:"properties,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SourceControlSyncJobByID struct. +func (scsjbi *SourceControlSyncJobByID) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + var v *json.RawMessage + + v = m["id"] + if v != nil { + var ID string + err = json.Unmarshal(*m["id"], &ID) + if err != nil { + return err + } + scsjbi.ID = &ID + } + + v = m["properties"] + if v != nil { + var properties SourceControlSyncJobByIDProperties + err = json.Unmarshal(*m["properties"], &properties) + if err != nil { + return err + } + scsjbi.SourceControlSyncJobByIDProperties = &properties + } + + return nil +} + +// SourceControlSyncJobByIDErrors error details of the source control sync job. +type SourceControlSyncJobByIDErrors struct { + // Code - Gets the error code for the job. + Code *string `json:"code,omitempty"` + // Message - Gets the error message for the job. + Message *string `json:"message,omitempty"` +} + +// SourceControlSyncJobByIDProperties definition of source control sync job properties. +type SourceControlSyncJobByIDProperties struct { + // SourceControlSyncJobID - Gets the source control sync job id. + SourceControlSyncJobID *string `json:"sourceControlSyncJobId,omitempty"` + // CreationTime - Gets the creation time of the job. + CreationTime *date.Time `json:"creationTime,omitempty"` + // ProvisioningState - Gets the provisioning state of the job. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateRunning' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // StartTime - Gets the start time of the job. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - Gets the end time of the job. + EndTime *date.Time `json:"endTime,omitempty"` + // StartedBy - Gets the user who started the sync job. + StartedBy *string `json:"startedBy,omitempty"` + // Errors - Error details of the source control sync job. + Errors *SourceControlSyncJobByIDErrors `json:"errors,omitempty"` +} + +// SourceControlSyncJobListResult the response model for the list source control sync jobs operation. +type SourceControlSyncJobListResult struct { + autorest.Response `json:"-"` + // Value - Gets a list of source control sync jobs. + Value *[]SourceControlSyncJob `json:"value,omitempty"` + // NextLink - Gets or sets the next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// SourceControlSyncJobListResultIterator provides access to a complete listing of SourceControlSyncJob values. +type SourceControlSyncJobListResultIterator struct { + i int + page SourceControlSyncJobListResultPage +} + +// 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 *SourceControlSyncJobListResultIterator) 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 SourceControlSyncJobListResultIterator) 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 SourceControlSyncJobListResultIterator) Response() SourceControlSyncJobListResult { + 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 SourceControlSyncJobListResultIterator) Value() SourceControlSyncJob { + if !iter.page.NotDone() { + return SourceControlSyncJob{} + } + return iter.page.Values()[iter.i] +} + +// IsEmpty returns true if the ListResult contains no values. +func (scsjlr SourceControlSyncJobListResult) IsEmpty() bool { + return scsjlr.Value == nil || len(*scsjlr.Value) == 0 +} + +// sourceControlSyncJobListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (scsjlr SourceControlSyncJobListResult) sourceControlSyncJobListResultPreparer() (*http.Request, error) { + if scsjlr.NextLink == nil || len(to.String(scsjlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(scsjlr.NextLink))) +} + +// SourceControlSyncJobListResultPage contains a page of SourceControlSyncJob values. +type SourceControlSyncJobListResultPage struct { + fn func(SourceControlSyncJobListResult) (SourceControlSyncJobListResult, error) + scsjlr SourceControlSyncJobListResult +} + +// 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 *SourceControlSyncJobListResultPage) Next() error { + next, err := page.fn(page.scsjlr) + if err != nil { + return err + } + page.scsjlr = next + return nil +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SourceControlSyncJobListResultPage) NotDone() bool { + return !page.scsjlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SourceControlSyncJobListResultPage) Response() SourceControlSyncJobListResult { + return page.scsjlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SourceControlSyncJobListResultPage) Values() []SourceControlSyncJob { + if page.scsjlr.IsEmpty() { + return nil + } + return *page.scsjlr.Value +} + +// SourceControlSyncJobProperties definition of source control sync job properties. +type SourceControlSyncJobProperties struct { + // SourceControlSyncJobID - Gets the source control sync job id. + SourceControlSyncJobID *string `json:"sourceControlSyncJobId,omitempty"` + // CreationTime - Gets the creation time of the job. + CreationTime *date.Time `json:"creationTime,omitempty"` + // ProvisioningState - Gets the provisioning state of the job. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateRunning' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // StartTime - Gets the start time of the job. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - Gets the end time of the job. + EndTime *date.Time `json:"endTime,omitempty"` + // StartedBy - Gets the user who started the sync job. + StartedBy *string `json:"startedBy,omitempty"` +} + +// SourceControlUpdateParameters the parameters supplied to the update source control operation. +type SourceControlUpdateParameters struct { + // SourceControlUpdateProperties - Gets or sets the value of the source control. + *SourceControlUpdateProperties `json:"properties,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SourceControlUpdateParameters struct. +func (scup *SourceControlUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + var v *json.RawMessage + + v = m["properties"] + if v != nil { + var properties SourceControlUpdateProperties + err = json.Unmarshal(*m["properties"], &properties) + if err != nil { + return err + } + scup.SourceControlUpdateProperties = &properties + } + + return nil +} + +// SourceControlUpdateProperties the properties of the update source control +type SourceControlUpdateProperties struct { + // Branch - Gets or sets the repo branch of the source control. + Branch *string `json:"branch,omitempty"` + // FolderPath - Gets or sets the folder path of the source control. Path must be relative. + FolderPath *string `json:"folderPath,omitempty"` + // AutoSync - Gets or sets auto async of the source control. Default is false. + AutoSync *bool `json:"autoSync,omitempty"` + // PublishRunbook - Gets or sets the auto publish of the source control. Default is true. + PublishRunbook *bool `json:"publishRunbook,omitempty"` + // SecurityToken - Gets or sets the authorization token for the repo of the source control. + SecurityToken *string `json:"securityToken,omitempty"` + // Description - Gets or sets the user description of the source control. + Description *string `json:"description,omitempty"` +} + // Statistics definition of the statistic. type Statistics struct { // CounterProperty - Gets the property value of the statistic. @@ -5658,10 +6313,12 @@ type UsageListResult struct { // Variable definition of the varible. type Variable struct { autorest.Response `json:"-"` - // ID - Gets or sets the id of the resource. + // ID - Gets the id of the resource. ID *string `json:"id,omitempty"` - // Name - Gets or sets the name of the variable. + // Name - Gets the name of the variable. Name *string `json:"name,omitempty"` + // Type - Resource type + Type *string `json:"type,omitempty"` // VariableProperties - Gets or sets the properties of the variable. *VariableProperties `json:"properties,omitempty"` } @@ -5695,6 +6352,16 @@ func (vVar *Variable) UnmarshalJSON(body []byte) error { vVar.Name = &name } + v = m["type"] + if v != nil { + var typeVar string + err = json.Unmarshal(*m["type"], &typeVar) + if err != nil { + return err + } + vVar.Type = &typeVar + } + v = m["properties"] if v != nil { var properties VariableProperties diff --git a/services/automation/mgmt/2017-05-15-preview/runbookdraft.go b/services/automation/mgmt/2017-05-15-preview/runbookdraft.go index dc91cdc518c2..7e2760a2690c 100644 --- a/services/automation/mgmt/2017-05-15-preview/runbookdraft.go +++ b/services/automation/mgmt/2017-05-15-preview/runbookdraft.go @@ -83,6 +83,7 @@ func (client RunbookDraftClient) CreateOrUpdatePreparer(ctx context.Context, aut } preparer := autorest.CreatePreparer( + autorest.AsOctetStream(), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content", pathParameters), diff --git a/services/automation/mgmt/2017-05-15-preview/sourcecontrol.go b/services/automation/mgmt/2017-05-15-preview/sourcecontrol.go new file mode 100644 index 000000000000..55567b16c814 --- /dev/null +++ b/services/automation/mgmt/2017-05-15-preview/sourcecontrol.go @@ -0,0 +1,454 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// SourceControlClient is the automation Client +type SourceControlClient struct { + BaseClient +} + +// NewSourceControlClient creates an instance of the SourceControlClient client. +func NewSourceControlClient(subscriptionID string, resourceGroupName string, clientRequestID string, automationAccountName string) SourceControlClient { + return NewSourceControlClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, clientRequestID, automationAccountName) +} + +// NewSourceControlClientWithBaseURI creates an instance of the SourceControlClient client. +func NewSourceControlClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, clientRequestID string, automationAccountName string) SourceControlClient { + return SourceControlClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, clientRequestID, automationAccountName)} +} + +// CreateOrUpdate create a source control. +// +// automationAccountName is the automation account name. sourceControlName is the source control name. parameters is +// the parameters supplied to the create or update source control operation. +func (client SourceControlClient) CreateOrUpdate(ctx context.Context, automationAccountName string, sourceControlName string, parameters SourceControlCreateOrUpdateParameters) (result SourceControl, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.ResourceGroupName, + Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties.RepoURL", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties.RepoURL", Name: validation.MaxLength, Rule: 2000, Chain: nil}}}, + {Target: "parameters.SourceControlCreateOrUpdateProperties.Branch", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties.Branch", Name: validation.MaxLength, Rule: 255, Chain: nil}}}, + {Target: "parameters.SourceControlCreateOrUpdateProperties.FolderPath", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties.FolderPath", Name: validation.MaxLength, Rule: 255, Chain: nil}}}, + {Target: "parameters.SourceControlCreateOrUpdateProperties.SecurityToken", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties.SecurityToken", Name: validation.MaxLength, Rule: 1024, Chain: nil}}}, + {Target: "parameters.SourceControlCreateOrUpdateProperties.Description", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.SourceControlCreateOrUpdateProperties.Description", Name: validation.MaxLength, Rule: 512, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "automation.SourceControlClient", "CreateOrUpdate") + } + + req, err := client.CreateOrUpdatePreparer(ctx, automationAccountName, sourceControlName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client SourceControlClient) CreateOrUpdatePreparer(ctx context.Context, automationAccountName string, sourceControlName string, parameters SourceControlCreateOrUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "sourceControlName": autorest.Encode("path", sourceControlName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client SourceControlClient) CreateOrUpdateResponder(resp *http.Response) (result SourceControl, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the source control. +// +// automationAccountName is the automation account name. sourceControlName is the name of source control. +func (client SourceControlClient) Delete(ctx context.Context, automationAccountName string, sourceControlName string) (result autorest.Response, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.ResourceGroupName, + Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "automation.SourceControlClient", "Delete") + } + + req, err := client.DeletePreparer(ctx, automationAccountName, sourceControlName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SourceControlClient) DeletePreparer(ctx context.Context, automationAccountName string, sourceControlName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "sourceControlName": autorest.Encode("path", sourceControlName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client SourceControlClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve the source control identified by source control name. +// +// automationAccountName is the automation account name. sourceControlName is the name of source control. +func (client SourceControlClient) Get(ctx context.Context, automationAccountName string, sourceControlName string) (result SourceControl, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.ResourceGroupName, + Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "automation.SourceControlClient", "Get") + } + + req, err := client.GetPreparer(ctx, automationAccountName, sourceControlName) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SourceControlClient) GetPreparer(ctx context.Context, automationAccountName string, sourceControlName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "sourceControlName": autorest.Encode("path", sourceControlName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SourceControlClient) GetResponder(resp *http.Response) (result SourceControl, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of source controls. +// +// automationAccountName is the automation account name. filter is the filter to apply on the operation. +func (client SourceControlClient) ListByAutomationAccount(ctx context.Context, automationAccountName string, filter string) (result SourceControlListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.ResourceGroupName, + Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "automation.SourceControlClient", "ListByAutomationAccount") + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, automationAccountName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.sclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.sclr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client SourceControlClient) ListByAutomationAccountPreparer(ctx context.Context, automationAccountName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client SourceControlClient) ListByAutomationAccountResponder(resp *http.Response) (result SourceControlListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client SourceControlClient) listByAutomationAccountNextResults(lastResults SourceControlListResult) (result SourceControlListResult, err error) { + req, err := lastResults.sourceControlListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.SourceControlClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.SourceControlClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client SourceControlClient) ListByAutomationAccountComplete(ctx context.Context, automationAccountName string, filter string) (result SourceControlListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, automationAccountName, filter) + return +} + +// Update update a source control. +// +// automationAccountName is the automation account name. sourceControlName is the source control name. parameters is +// the parameters supplied to the update source control operation. +func (client SourceControlClient) Update(ctx context.Context, automationAccountName string, sourceControlName string, parameters SourceControlUpdateParameters) (result SourceControl, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.ResourceGroupName, + Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "automation.SourceControlClient", "Update") + } + + req, err := client.UpdatePreparer(ctx, automationAccountName, sourceControlName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client SourceControlClient) UpdatePreparer(ctx context.Context, automationAccountName string, sourceControlName string, parameters SourceControlUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "sourceControlName": autorest.Encode("path", sourceControlName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client SourceControlClient) UpdateResponder(resp *http.Response) (result SourceControl, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/automation/mgmt/2017-05-15-preview/sourcecontrolsyncjob.go b/services/automation/mgmt/2017-05-15-preview/sourcecontrolsyncjob.go new file mode 100644 index 000000000000..974657a952aa --- /dev/null +++ b/services/automation/mgmt/2017-05-15-preview/sourcecontrolsyncjob.go @@ -0,0 +1,297 @@ +package automation + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/satori/go.uuid" + "net/http" +) + +// SourceControlSyncJobClient is the automation Client +type SourceControlSyncJobClient struct { + BaseClient +} + +// NewSourceControlSyncJobClient creates an instance of the SourceControlSyncJobClient client. +func NewSourceControlSyncJobClient(subscriptionID string, resourceGroupName string, clientRequestID string, automationAccountName string) SourceControlSyncJobClient { + return NewSourceControlSyncJobClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, clientRequestID, automationAccountName) +} + +// NewSourceControlSyncJobClientWithBaseURI creates an instance of the SourceControlSyncJobClient client. +func NewSourceControlSyncJobClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, clientRequestID string, automationAccountName string) SourceControlSyncJobClient { + return SourceControlSyncJobClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, clientRequestID, automationAccountName)} +} + +// Create creates the sync job for a source control. +// +// automationAccountName is the automation account name. sourceControlName is the source control name. +// sourceControlSyncJobID is the source control sync job id. +func (client SourceControlSyncJobClient) Create(ctx context.Context, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID) (result SourceControlSyncJob, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.ResourceGroupName, + Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "automation.SourceControlSyncJobClient", "Create") + } + + req, err := client.CreatePreparer(ctx, automationAccountName, sourceControlName, sourceControlSyncJobID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client SourceControlSyncJobClient) CreatePreparer(ctx context.Context, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "sourceControlName": autorest.Encode("path", sourceControlName), + "sourceControlSyncJobId": autorest.Encode("path", sourceControlSyncJobID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlSyncJobClient) CreateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client SourceControlSyncJobClient) CreateResponder(resp *http.Response) (result SourceControlSyncJob, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get retrieve the source control sync job identified by job id. +// +// automationAccountName is the automation account name. sourceControlName is the source control name. +// sourceControlSyncJobID is the source control sync job id. +func (client SourceControlSyncJobClient) Get(ctx context.Context, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID) (result SourceControlSyncJobByID, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.ResourceGroupName, + Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "automation.SourceControlSyncJobClient", "Get") + } + + req, err := client.GetPreparer(ctx, automationAccountName, sourceControlName, sourceControlSyncJobID) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SourceControlSyncJobClient) GetPreparer(ctx context.Context, automationAccountName string, sourceControlName string, sourceControlSyncJobID uuid.UUID) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "sourceControlName": autorest.Encode("path", sourceControlName), + "sourceControlSyncJobId": autorest.Encode("path", sourceControlSyncJobID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlSyncJobClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SourceControlSyncJobClient) GetResponder(resp *http.Response) (result SourceControlSyncJobByID, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAutomationAccount retrieve a list of source control sync jobs. +// +// automationAccountName is the automation account name. sourceControlName is the source control name. filter is the +// filter to apply on the operation. +func (client SourceControlSyncJobClient) ListByAutomationAccount(ctx context.Context, automationAccountName string, sourceControlName string, filter string) (result SourceControlSyncJobListResultPage, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.ResourceGroupName, + Constraints: []validation.Constraint{{Target: "client.ResourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "automation.SourceControlSyncJobClient", "ListByAutomationAccount") + } + + result.fn = client.listByAutomationAccountNextResults + req, err := client.ListByAutomationAccountPreparer(ctx, automationAccountName, sourceControlName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "ListByAutomationAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.scsjlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "ListByAutomationAccount", resp, "Failure sending request") + return + } + + result.scsjlr, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "ListByAutomationAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAutomationAccountPreparer prepares the ListByAutomationAccount request. +func (client SourceControlSyncJobClient) ListByAutomationAccountPreparer(ctx context.Context, automationAccountName string, sourceControlName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "automationAccountName": autorest.Encode("path", automationAccountName), + "resourceGroupName": autorest.Encode("path", client.ResourceGroupName), + "sourceControlName": autorest.Encode("path", sourceControlName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-10-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}/sourceControlSyncJobs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAutomationAccountSender sends the ListByAutomationAccount request. The method will close the +// http.Response Body if it receives an error. +func (client SourceControlSyncJobClient) ListByAutomationAccountSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAutomationAccountResponder handles the response to the ListByAutomationAccount request. The method always +// closes the http.Response Body. +func (client SourceControlSyncJobClient) ListByAutomationAccountResponder(resp *http.Response) (result SourceControlSyncJobListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAutomationAccountNextResults retrieves the next set of results, if any. +func (client SourceControlSyncJobClient) listByAutomationAccountNextResults(lastResults SourceControlSyncJobListResult) (result SourceControlSyncJobListResult, err error) { + req, err := lastResults.sourceControlSyncJobListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "listByAutomationAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAutomationAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "listByAutomationAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAutomationAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "automation.SourceControlSyncJobClient", "listByAutomationAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAutomationAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client SourceControlSyncJobClient) ListByAutomationAccountComplete(ctx context.Context, automationAccountName string, sourceControlName string, filter string) (result SourceControlSyncJobListResultIterator, err error) { + result.page, err = client.ListByAutomationAccount(ctx, automationAccountName, sourceControlName, filter) + return +} diff --git a/services/automation/mgmt/2017-05-15-preview/version.go b/services/automation/mgmt/2017-05-15-preview/version.go index 9a15d90c5d50..9a7e1a3ff0f3 100644 --- a/services/automation/mgmt/2017-05-15-preview/version.go +++ b/services/automation/mgmt/2017-05-15-preview/version.go @@ -19,10 +19,10 @@ package automation // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v12.1.1-beta services" + return "Azure-SDK-For-Go/v12.2.1-beta services" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v12.1.1-beta" + return "v12.2.1-beta" }