From 7a846e50f67dc3420745aa0ce36870ac75acc6d7 Mon Sep 17 00:00:00 2001 From: catalinaperalta Date: Wed, 24 Jun 2020 15:03:13 -0400 Subject: [PATCH] Separate poller response envelopes (#429) * Adding poller response envelope transformations and generation * Updating LRO response type creation to one place in loop * skipping lro+pagers * consolidate LRO response envelope creation * ensure unique pollers for scalar APIs * improve comment on LRO response envelopes Co-authored-by: Joel Hendrix Co-authored-by: Catalina Peralta --- src/common/helpers.ts | 3 +- src/generator/operations.ts | 27 +- src/generator/pollers.ts | 4 +- src/transform/transform.ts | 158 +++++--- test/autorest/generated/lrogroup/lroretrys.go | 59 ++- test/autorest/generated/lrogroup/lros.go | 366 ++++++++---------- test/autorest/generated/lrogroup/lrosads.go | 218 +++++------ .../generated/lrogroup/lroscustomheader.go | 34 +- test/autorest/generated/lrogroup/models.go | 71 ++-- test/autorest/generated/paginggroup/models.go | 11 +- test/autorest/generated/paginggroup/paging.go | 4 +- test/autorest/lrogroup/lros_test.go | 32 +- 12 files changed, 496 insertions(+), 491 deletions(-) diff --git a/src/common/helpers.ts b/src/common/helpers.ts index 811abb915..f0a1bf1c6 100644 --- a/src/common/helpers.ts +++ b/src/common/helpers.ts @@ -43,13 +43,12 @@ export function isPageableOperation(op: Operation): boolean { export interface PollerInfo { name: string; - responseType: string; op: Operation; } // returns true if the operation is a long-running operation export function isLROOperation(op: Operation): boolean { - return op.extensions?.['x-ms-long-running-operation']; + return op.extensions?.['x-ms-long-running-operation'] === true; } // returns ObjectSchema type predicate if the schema is an ObjectSchema diff --git a/src/generator/operations.ts b/src/generator/operations.ts index f0fe456ef..450aeab26 100644 --- a/src/generator/operations.ts +++ b/src/generator/operations.ts @@ -296,7 +296,7 @@ function generateOperation(clientName: string, op: Operation, imports: ImportMan if (isLROOperation(op)) { // TODO remove LRO for pageable responses NYI if (op.extensions!['x-ms-pageable']) { - text += `\treturn nil, nil`; + text += `\treturn nil, nil\n`; text += '}\n\n'; return text; } @@ -655,9 +655,10 @@ function createProtocolResponse(client: string, op: Operation, imports: ImportMa } const generateResponseUnmarshaller = function (response: Response): string { let unmarshallerText = ''; + const isLRO = isLROOperation(op); if (!isSchemaResponse(response)) { - if (isLROOperation(op)) { - unmarshallerText += '\treturn &HTTPResponse{RawResponse: resp.Response}, nil\n'; + if (isLRO) { + unmarshallerText += '\treturn &HTTPPollerResponse{RawResponse: resp.Response}, nil\n'; return unmarshallerText; } // no response body, return the *http.Response @@ -697,6 +698,11 @@ function createProtocolResponse(client: string, op: Operation, imports: ImportMa return unmarshallerText; } const schemaResponse = response; + // TODO remove paging skip when adding lro + pagers + if (isLRO && !isPageableOperation(op)) { + unmarshallerText += `\treturn &${schemaResponse.schema.language.go!.lroResponseType.language.go!.name}{RawResponse: resp.Response}, nil\n`; + return unmarshallerText; + } let respObj = `${schemaResponse.schema.language.go!.responseType.name}{RawResponse: resp.Response}`; unmarshallerText += `\tresult := ${respObj}\n`; // assign any header values @@ -768,7 +774,6 @@ function createProtocolErrHandler(client: string, op: Operation, imports: Import } return errors.New(string(body)) `; - } // if the response doesn't define any error types return a generic error @@ -1039,14 +1044,20 @@ function generateReturnsInfo(op: Operation, forHandler: boolean): string[] { if (isMultiRespOperation(op)) { returnType = 'interface{}'; } else { - const firstResp = op.responses![0]; - // must check pageable first as all pageable operations are also schema responses - if (!forHandler && isPageableOperation(op)) { + const firstResp = op.responses![0]; + // must check pageable first as all pageable operations are also schema responses, + // but LRO operations that return a pager are an exception and need to return LRO specific + // responses + if (!forHandler && isPageableOperation(op) && !isLROOperation(op)) { returnType = op.language.go!.pageableType.name; } else if (isSchemaResponse(firstResp)) { returnType = '*' + firstResp.schema.language.go!.responseType.name; + // TODO remove paging skip when adding LRO + pagers + if (isLROOperation(op) && !isPageableOperation(op)) { + returnType = '*' + firstResp.schema.language.go!.lroResponseType.language.go!.name; + } } else if (isLROOperation(op)) { - returnType = '*HTTPResponse'; + returnType = '*HTTPPollerResponse'; } } return [returnType, 'error']; diff --git a/src/generator/pollers.ts b/src/generator/pollers.ts index c95e3eff2..b2e543bb0 100644 --- a/src/generator/pollers.ts +++ b/src/generator/pollers.ts @@ -70,7 +70,7 @@ export async function generatePollers(session: Session): Promisepoller.op.responses![0]; let unmarshalResponse = 'nil'; - if (isSchemaResponse(schemaResponse) && schemaResponse.schema.language.go!.responseType.value != undefined) { + if (isSchemaResponse(schemaResponse) && schemaResponse.schema.language.go!.responseType.name !== undefined) { responseType = schemaResponse.schema.language.go!.responseType.name; pollUntilDoneResponse = `(*${responseType}, error)`; pollUntilDoneReturn = 'p.FinalResponse(ctx)'; @@ -117,7 +117,7 @@ export async function generatePollers(session: Session): PromiseResponse struct` response @@ -488,35 +491,8 @@ function createResponseType(codeModel: CodeModel, group: OperationGroup, op: Ope for (const response of values(op.responses)) { if (!isSchemaResponse(response)) { // the response doesn't return a model. if it returns - // headers then create a model that contains them. - if (isLROOperation(op)) { - const name = 'HTTPResponse'; - const description = `${name} contains the HTTP response from the call to the service endpoint`; - const object = new ObjectSchema(name, description); - object.language.go = object.language.default; - const pollUntilDone = newProperty('PollUntilDone', 'PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received', newObject('func(ctx context.Context, frequency time.Duration) (*http.Response, error)', 'TODO')); - const getPoller = newProperty('Poller', 'Poller contains an initialized poller', newObject('HTTPPoller', 'TODO')); - pollUntilDone.schema.language.go!.lroPointerException = true; - getPoller.schema.language.go!.lroPointerException = true; - object.language.go!.properties = [ - newProperty('RawResponse', 'RawResponse contains the underlying HTTP response.', newObject('http.Response', 'raw HTTP response')), - pollUntilDone, - getPoller - ]; - // mark as a response type - object.language.go!.responseType = { - name: name, - description: description, - responseType: true, - }; - if (!responseExists(codeModel, object.language.go!.responseType.name)) { - // add this response schema to the global list of response - const responseSchemas = >codeModel.language.go!.responseSchemas; - responseSchemas.push(object); - // attach it to the response - (response).schema = object; - } - } else if (headers.size > 0) { + // headers then create a model that contains them, except for LROs. + if (headers.size > 0 && !isLROOperation(op)) { const name = `${group.language.go!.name}${op.language.go!.name}Response`; const description = `${name} contains the response from method ${group.language.go!.name}.${op.language.go!.name}.`; const object = new ObjectSchema(name, description); @@ -543,15 +519,15 @@ function createResponseType(codeModel: CodeModel, group: OperationGroup, op: Ope (response).schema = object; } } - } else if (!responseTypeCreated(codeModel, response.schema) || isLROOperation(op)) { + } else if (!responseTypeCreated(codeModel, response.schema)) { response.schema.language.go!.responseType = generateResponseTypeName(response.schema); response.schema.language.go!.properties = [ newProperty('RawResponse', 'RawResponse contains the underlying HTTP response.', newObject('http.Response', 'TODO')) ]; const marshallingFormat = getMarshallingFormat(response.protocol); response.schema.language.go!.responseType.marshallingFormat = marshallingFormat; - // for operations that return scalar types we use a fixed field name 'Value' - let propName = 'Value'; + // for operations that return scalar types we use a fixed field name + let propName = scalarResponsePropName; if (response.schema.type === SchemaType.Object) { // for object types use the type's name as the field name propName = response.schema.language.go!.name; @@ -564,37 +540,28 @@ function createResponseType(codeModel: CodeModel, group: OperationGroup, op: Ope propName = pascalCase(response.schema.serialization.xml.name); } response.schema.language.go!.responseType.value = propName; - (>response.schema.language.go!.properties).push(newProperty(propName, response.schema.language.go!.description, response.schema)); - // add any headers to the response type - for (const item of items(headers)) { - const prop = newProperty(item.key, item.value.description, item.value.schema); - prop.language.go!.fromHeader = item.value.header; - (>response.schema.language.go!.properties).push(prop); - } - if (isLROOperation(op)) { - response.schema.language.go!.isLRO = true; - let prop = newProperty('PollUntilDone', 'PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received', newObject(`func(ctx context.Context, frequency time.Duration) (*${response.schema.language.go!.responseType.name}, error)`, 'TODO')); - prop.schema.language.go!.lroPointerException = true; - (>response.schema.language.go!.properties).push(prop); - prop = newProperty('Poller', 'Poller contains an initialized poller', newObject(`${response.schema.language.go!.responseType.value}Poller`, 'TODO')); - prop.schema.language.go!.lroPointerException = true; - (>response.schema.language.go!.properties).push(prop); + // for LROs add a specific poller response envelope to return from Begin operations + if (!isLROOperation(op)) { + // exclude LRO headers from Widget response envelopes + // add any headers to the response type + for (const item of items(headers)) { + const prop = newProperty(item.key, item.value.description, item.value.schema); + prop.language.go!.fromHeader = item.value.header; + (>response.schema.language.go!.properties).push(prop); + } } + // the Widget response doesn't belong in the poller response envelope + (>response.schema.language.go!.properties).push(newProperty(propName, response.schema.language.go!.description, response.schema)); if (!responseExists(codeModel, response.schema.language.go!.name)) { // add this response schema to the global list of response const responseSchemas = >codeModel.language.go!.responseSchemas; responseSchemas.push(response.schema); - } else if (isLROOperation(op)) { - // add this response schema with LRO fields to the global list of responses by - // replacing the previously added response with the same name - const responseSchemas = >codeModel.language.go!.responseSchemas; - for (let i = 0; i < responseSchemas.length; i++) { - if (responseSchemas[i].language.go!.name === response.schema.language.go!.name) { - responseSchemas.splice(i, 1, response.schema); - } - } } } + // TODO: remove skipping this for pageable operations when adding lro+pager work + if (isLROOperation(op) && !op.extensions!['x-ms-pageable'] && !isPageableOperation(op)) { + generateLROResponseType(response, op, codeModel); + } // create pageable type info if (isPageableOperation(op)) { if (codeModel.language.go!.pageableTypes === undefined) { @@ -629,11 +596,10 @@ function createResponseType(codeModel: CodeModel, group: OperationGroup, op: Ope } // Determine the type of poller that needs to be added based on whether a schema is specified in the response // if there is no schema specified for the operation response then a simple HTTP poller will be instantiated - let type = 'HTTP'; + let name = 'HTTPPoller'; if (isSchemaResponse(response) && response.schema.language.go!.responseType.value) { - type = response.schema.language.go!.responseType.value; + name = generateLROPollerName(response); } - const name = `${type}Poller`; const pollers = >codeModel.language.go!.pollerTypes; let skipAddLRO = false; for (const poller of values(pollers)) { @@ -649,7 +615,6 @@ function createResponseType(codeModel: CodeModel, group: OperationGroup, op: Ope // create a new one, add to global list and assign to method const poller = { name: name, - responseType: type, op: op, }; pollers.push(poller); @@ -773,7 +738,80 @@ function generateResponseTypeName(schema: Schema): Language { name: name, description: `${name} is the response envelope for operations that return a ${schema.language.go!.name} type.`, responseType: true, + }; +} + +// generate LRO response type name is separate from the general response type name +// generation, since it requires returning the poller response envelope +function generateLROResponseTypeName(response: Response): Language { + // default to generic response envelope + let name = 'HTTPPollerResponse' + let desc = `${name} contains the asynchronous HTTP response from the call to the service endpoint.`; + if (isSchemaResponse(response)) { + // create a type-specific response envelope + const typeName = recursiveTypeName(response.schema) + 'Poller'; + name = `${typeName}Response`; + desc = `${name} is the response envelope for operations that asynchronously return a ${response.schema.language.go!.name} type.`; + } + return { + name: name, + description: desc, + responseType: true, + }; +} + +function generateLROPollerName(schemaResp: SchemaResponse): string { + if (schemaResp.schema.language.go!.responseType.value === scalarResponsePropName) { + // for scalar responses, use the underlying type name for the poller + return `${pascalCase(schemaResp.schema.language.go!.name)}Poller`; } + return `${schemaResp.schema.language.go!.responseType.value}Poller`; +} + +function generateLROResponseType(response: Response, op: Operation, codeModel: CodeModel) { + const respTypeName = generateLROResponseTypeName(response); + if (responseExists(codeModel, respTypeName.name)) { + return; + } + const respTypeObject = newObject(respTypeName.name, respTypeName.description); + respTypeObject.language.go!.responseType = respTypeName; + let pollerResponse: string; + let pollerTypeName: string; + if (!isSchemaResponse(response)) { + pollerResponse = '*http.Response'; + pollerTypeName = 'HTTPPoller'; + // mark as a response type + respTypeObject.language.go!.responseType = { + name: respTypeName.name, + description: respTypeName.description, + responseType: true, + }; + } else if (isPageableOperation(op)) { + pollerResponse = `${(response).schema.language.go!.name}Pager`; + pollerTypeName = `${(response).schema.language.go!.name}PagerPoller`; + response.schema.language.go!.isLRO = true; + response.schema.language.go!.lroResponseType = respTypeObject; + } else { + pollerResponse = `*${response.schema.language.go!.responseType.name}`; + pollerTypeName = generateLROPollerName(response); + response.schema.language.go!.isLRO = true; + response.schema.language.go!.lroResponseType = respTypeObject; + } + // create PollUntilDone + const pollUntilDone = newProperty('PollUntilDone', 'PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received', + newObject(`func(ctx context.Context, frequency time.Duration) (${pollerResponse}, error)`, 'TODO')); + pollUntilDone.schema.language.go!.lroPointerException = true; + // create Poller + const poller = newProperty('Poller', 'Poller contains an initialized poller.', newObject(pollerTypeName, 'TODO')); + poller.schema.language.go!.lroPointerException = true; + respTypeObject.language.go!.properties = [ + newProperty('RawResponse', 'RawResponse contains the underlying HTTP response.', newObject('http.Response', 'TODO')), + pollUntilDone, + poller + ]; + // add the LRO response schema to the global list of response + const responseSchemas = >codeModel.language.go!.responseSchemas; + responseSchemas.push(respTypeObject); } function getRootDiscriminator(obj: ObjectSchema): ObjectSchema { diff --git a/test/autorest/generated/lrogroup/lroretrys.go b/test/autorest/generated/lrogroup/lroretrys.go index 4c3549663..e681bd87a 100644 --- a/test/autorest/generated/lrogroup/lroretrys.go +++ b/test/autorest/generated/lrogroup/lroretrys.go @@ -15,31 +15,31 @@ import ( // LroRetrysOperations contains the methods for the LroRetrys group. type LroRetrysOperations interface { // BeginDelete202Retry200 - Long running delete request, service returns a 500, then a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’ - BeginDelete202Retry200(ctx context.Context) (*HTTPResponse, error) + BeginDelete202Retry200(ctx context.Context) (*HTTPPollerResponse, error) // ResumeDelete202Retry200 - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumeDelete202Retry200(token string) (HTTPPoller, error) // BeginDeleteAsyncRelativeRetrySucceeded - Long running delete request, service returns a 500, then a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status - BeginDeleteAsyncRelativeRetrySucceeded(ctx context.Context) (*HTTPResponse, error) + BeginDeleteAsyncRelativeRetrySucceeded(ctx context.Context) (*HTTPPollerResponse, error) // ResumeDeleteAsyncRelativeRetrySucceeded - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumeDeleteAsyncRelativeRetrySucceeded(token string) (HTTPPoller, error) // BeginDeleteProvisioning202Accepted200Succeeded - Long running delete request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’ - BeginDeleteProvisioning202Accepted200Succeeded(ctx context.Context) (*ProductResponse, error) + BeginDeleteProvisioning202Accepted200Succeeded(ctx context.Context) (*ProductPollerResponse, error) // ResumeDeleteProvisioning202Accepted200Succeeded - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumeDeleteProvisioning202Accepted200Succeeded(token string) (ProductPoller, error) // BeginPost202Retry200 - Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success - BeginPost202Retry200(ctx context.Context, lroRetrysPost202Retry200Options *LroRetrysPost202Retry200Options) (*HTTPResponse, error) + BeginPost202Retry200(ctx context.Context, lroRetrysPost202Retry200Options *LroRetrysPost202Retry200Options) (*HTTPPollerResponse, error) // ResumePost202Retry200 - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePost202Retry200(token string) (HTTPPoller, error) // BeginPostAsyncRelativeRetrySucceeded - Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status - BeginPostAsyncRelativeRetrySucceeded(ctx context.Context, lroRetrysPostAsyncRelativeRetrySucceededOptions *LroRetrysPostAsyncRelativeRetrySucceededOptions) (*HTTPResponse, error) + BeginPostAsyncRelativeRetrySucceeded(ctx context.Context, lroRetrysPostAsyncRelativeRetrySucceededOptions *LroRetrysPostAsyncRelativeRetrySucceededOptions) (*HTTPPollerResponse, error) // ResumePostAsyncRelativeRetrySucceeded - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePostAsyncRelativeRetrySucceeded(token string) (HTTPPoller, error) // BeginPut201CreatingSucceeded200 - Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’ - BeginPut201CreatingSucceeded200(ctx context.Context, lroRetrysPut201CreatingSucceeded200Options *LroRetrysPut201CreatingSucceeded200Options) (*ProductResponse, error) + BeginPut201CreatingSucceeded200(ctx context.Context, lroRetrysPut201CreatingSucceeded200Options *LroRetrysPut201CreatingSucceeded200Options) (*ProductPollerResponse, error) // ResumePut201CreatingSucceeded200 - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePut201CreatingSucceeded200(token string) (ProductPoller, error) // BeginPutAsyncRelativeRetrySucceeded - Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status - BeginPutAsyncRelativeRetrySucceeded(ctx context.Context, lroRetrysPutAsyncRelativeRetrySucceededOptions *LroRetrysPutAsyncRelativeRetrySucceededOptions) (*ProductResponse, error) + BeginPutAsyncRelativeRetrySucceeded(ctx context.Context, lroRetrysPutAsyncRelativeRetrySucceededOptions *LroRetrysPutAsyncRelativeRetrySucceededOptions) (*ProductPollerResponse, error) // ResumePutAsyncRelativeRetrySucceeded - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePutAsyncRelativeRetrySucceeded(token string) (ProductPoller, error) } @@ -50,7 +50,7 @@ type lroRetrysOperations struct { } // Delete202Retry200 - Long running delete request, service returns a 500, then a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’ -func (client *lroRetrysOperations) BeginDelete202Retry200(ctx context.Context) (*HTTPResponse, error) { +func (client *lroRetrysOperations) BeginDelete202Retry200(ctx context.Context) (*HTTPPollerResponse, error) { req, err := client.delete202Retry200CreateRequest() if err != nil { return nil, err @@ -102,11 +102,11 @@ func (client *lroRetrysOperations) delete202Retry200CreateRequest() (*azcore.Req } // delete202Retry200HandleResponse handles the Delete202Retry200 response. -func (client *lroRetrysOperations) delete202Retry200HandleResponse(resp *azcore.Response) (*HTTPResponse, error) { +func (client *lroRetrysOperations) delete202Retry200HandleResponse(resp *azcore.Response) (*HTTPPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.delete202Retry200HandleError(resp) } - return &HTTPResponse{RawResponse: resp.Response}, nil + return &HTTPPollerResponse{RawResponse: resp.Response}, nil } // delete202Retry200HandleError handles the Delete202Retry200 error response. @@ -119,7 +119,7 @@ func (client *lroRetrysOperations) delete202Retry200HandleError(resp *azcore.Res } // DeleteAsyncRelativeRetrySucceeded - Long running delete request, service returns a 500, then a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status -func (client *lroRetrysOperations) BeginDeleteAsyncRelativeRetrySucceeded(ctx context.Context) (*HTTPResponse, error) { +func (client *lroRetrysOperations) BeginDeleteAsyncRelativeRetrySucceeded(ctx context.Context) (*HTTPPollerResponse, error) { req, err := client.deleteAsyncRelativeRetrySucceededCreateRequest() if err != nil { return nil, err @@ -171,11 +171,11 @@ func (client *lroRetrysOperations) deleteAsyncRelativeRetrySucceededCreateReques } // deleteAsyncRelativeRetrySucceededHandleResponse handles the DeleteAsyncRelativeRetrySucceeded response. -func (client *lroRetrysOperations) deleteAsyncRelativeRetrySucceededHandleResponse(resp *azcore.Response) (*HTTPResponse, error) { +func (client *lroRetrysOperations) deleteAsyncRelativeRetrySucceededHandleResponse(resp *azcore.Response) (*HTTPPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.deleteAsyncRelativeRetrySucceededHandleError(resp) } - return &HTTPResponse{RawResponse: resp.Response}, nil + return &HTTPPollerResponse{RawResponse: resp.Response}, nil } // deleteAsyncRelativeRetrySucceededHandleError handles the DeleteAsyncRelativeRetrySucceeded error response. @@ -188,7 +188,7 @@ func (client *lroRetrysOperations) deleteAsyncRelativeRetrySucceededHandleError( } // DeleteProvisioning202Accepted200Succeeded - Long running delete request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’ -func (client *lroRetrysOperations) BeginDeleteProvisioning202Accepted200Succeeded(ctx context.Context) (*ProductResponse, error) { +func (client *lroRetrysOperations) BeginDeleteProvisioning202Accepted200Succeeded(ctx context.Context) (*ProductPollerResponse, error) { req, err := client.deleteProvisioning202Accepted200SucceededCreateRequest() if err != nil { return nil, err @@ -240,12 +240,11 @@ func (client *lroRetrysOperations) deleteProvisioning202Accepted200SucceededCrea } // deleteProvisioning202Accepted200SucceededHandleResponse handles the DeleteProvisioning202Accepted200Succeeded response. -func (client *lroRetrysOperations) deleteProvisioning202Accepted200SucceededHandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lroRetrysOperations) deleteProvisioning202Accepted200SucceededHandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent) { return nil, client.deleteProvisioning202Accepted200SucceededHandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // deleteProvisioning202Accepted200SucceededHandleError handles the DeleteProvisioning202Accepted200Succeeded error response. @@ -258,7 +257,7 @@ func (client *lroRetrysOperations) deleteProvisioning202Accepted200SucceededHand } // Post202Retry200 - Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success -func (client *lroRetrysOperations) BeginPost202Retry200(ctx context.Context, lroRetrysPost202Retry200Options *LroRetrysPost202Retry200Options) (*HTTPResponse, error) { +func (client *lroRetrysOperations) BeginPost202Retry200(ctx context.Context, lroRetrysPost202Retry200Options *LroRetrysPost202Retry200Options) (*HTTPPollerResponse, error) { req, err := client.post202Retry200CreateRequest(lroRetrysPost202Retry200Options) if err != nil { return nil, err @@ -313,11 +312,11 @@ func (client *lroRetrysOperations) post202Retry200CreateRequest(lroRetrysPost202 } // post202Retry200HandleResponse handles the Post202Retry200 response. -func (client *lroRetrysOperations) post202Retry200HandleResponse(resp *azcore.Response) (*HTTPResponse, error) { +func (client *lroRetrysOperations) post202Retry200HandleResponse(resp *azcore.Response) (*HTTPPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.post202Retry200HandleError(resp) } - return &HTTPResponse{RawResponse: resp.Response}, nil + return &HTTPPollerResponse{RawResponse: resp.Response}, nil } // post202Retry200HandleError handles the Post202Retry200 error response. @@ -330,7 +329,7 @@ func (client *lroRetrysOperations) post202Retry200HandleError(resp *azcore.Respo } // PostAsyncRelativeRetrySucceeded - Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status -func (client *lroRetrysOperations) BeginPostAsyncRelativeRetrySucceeded(ctx context.Context, lroRetrysPostAsyncRelativeRetrySucceededOptions *LroRetrysPostAsyncRelativeRetrySucceededOptions) (*HTTPResponse, error) { +func (client *lroRetrysOperations) BeginPostAsyncRelativeRetrySucceeded(ctx context.Context, lroRetrysPostAsyncRelativeRetrySucceededOptions *LroRetrysPostAsyncRelativeRetrySucceededOptions) (*HTTPPollerResponse, error) { req, err := client.postAsyncRelativeRetrySucceededCreateRequest(lroRetrysPostAsyncRelativeRetrySucceededOptions) if err != nil { return nil, err @@ -385,11 +384,11 @@ func (client *lroRetrysOperations) postAsyncRelativeRetrySucceededCreateRequest( } // postAsyncRelativeRetrySucceededHandleResponse handles the PostAsyncRelativeRetrySucceeded response. -func (client *lroRetrysOperations) postAsyncRelativeRetrySucceededHandleResponse(resp *azcore.Response) (*HTTPResponse, error) { +func (client *lroRetrysOperations) postAsyncRelativeRetrySucceededHandleResponse(resp *azcore.Response) (*HTTPPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.postAsyncRelativeRetrySucceededHandleError(resp) } - return &HTTPResponse{RawResponse: resp.Response}, nil + return &HTTPPollerResponse{RawResponse: resp.Response}, nil } // postAsyncRelativeRetrySucceededHandleError handles the PostAsyncRelativeRetrySucceeded error response. @@ -402,7 +401,7 @@ func (client *lroRetrysOperations) postAsyncRelativeRetrySucceededHandleError(re } // Put201CreatingSucceeded200 - Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’ -func (client *lroRetrysOperations) BeginPut201CreatingSucceeded200(ctx context.Context, lroRetrysPut201CreatingSucceeded200Options *LroRetrysPut201CreatingSucceeded200Options) (*ProductResponse, error) { +func (client *lroRetrysOperations) BeginPut201CreatingSucceeded200(ctx context.Context, lroRetrysPut201CreatingSucceeded200Options *LroRetrysPut201CreatingSucceeded200Options) (*ProductPollerResponse, error) { req, err := client.put201CreatingSucceeded200CreateRequest(lroRetrysPut201CreatingSucceeded200Options) if err != nil { return nil, err @@ -457,12 +456,11 @@ func (client *lroRetrysOperations) put201CreatingSucceeded200CreateRequest(lroRe } // put201CreatingSucceeded200HandleResponse handles the Put201CreatingSucceeded200 response. -func (client *lroRetrysOperations) put201CreatingSucceeded200HandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lroRetrysOperations) put201CreatingSucceeded200HandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusOK, http.StatusCreated, http.StatusNoContent) { return nil, client.put201CreatingSucceeded200HandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // put201CreatingSucceeded200HandleError handles the Put201CreatingSucceeded200 error response. @@ -475,7 +473,7 @@ func (client *lroRetrysOperations) put201CreatingSucceeded200HandleError(resp *a } // PutAsyncRelativeRetrySucceeded - Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status -func (client *lroRetrysOperations) BeginPutAsyncRelativeRetrySucceeded(ctx context.Context, lroRetrysPutAsyncRelativeRetrySucceededOptions *LroRetrysPutAsyncRelativeRetrySucceededOptions) (*ProductResponse, error) { +func (client *lroRetrysOperations) BeginPutAsyncRelativeRetrySucceeded(ctx context.Context, lroRetrysPutAsyncRelativeRetrySucceededOptions *LroRetrysPutAsyncRelativeRetrySucceededOptions) (*ProductPollerResponse, error) { req, err := client.putAsyncRelativeRetrySucceededCreateRequest(lroRetrysPutAsyncRelativeRetrySucceededOptions) if err != nil { return nil, err @@ -530,12 +528,11 @@ func (client *lroRetrysOperations) putAsyncRelativeRetrySucceededCreateRequest(l } // putAsyncRelativeRetrySucceededHandleResponse handles the PutAsyncRelativeRetrySucceeded response. -func (client *lroRetrysOperations) putAsyncRelativeRetrySucceededHandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lroRetrysOperations) putAsyncRelativeRetrySucceededHandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusOK, http.StatusNoContent) { return nil, client.putAsyncRelativeRetrySucceededHandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // putAsyncRelativeRetrySucceededHandleError handles the PutAsyncRelativeRetrySucceeded error response. diff --git a/test/autorest/generated/lrogroup/lros.go b/test/autorest/generated/lrogroup/lros.go index 4ed721a18..bafb37d64 100644 --- a/test/autorest/generated/lrogroup/lros.go +++ b/test/autorest/generated/lrogroup/lros.go @@ -15,167 +15,167 @@ import ( // LrOSOperations contains the methods for the LrOS group. type LrOSOperations interface { // BeginDelete202NoRetry204 - Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’ - BeginDelete202NoRetry204(ctx context.Context) (*ProductResponse, error) + BeginDelete202NoRetry204(ctx context.Context) (*ProductPollerResponse, error) // ResumeDelete202NoRetry204 - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumeDelete202NoRetry204(token string) (ProductPoller, error) // BeginDelete202Retry200 - Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’ - BeginDelete202Retry200(ctx context.Context) (*ProductResponse, error) + BeginDelete202Retry200(ctx context.Context) (*ProductPollerResponse, error) // ResumeDelete202Retry200 - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumeDelete202Retry200(token string) (ProductPoller, error) // BeginDelete204Succeeded - Long running delete succeeds and returns right away - BeginDelete204Succeeded(ctx context.Context) (*HTTPResponse, error) + BeginDelete204Succeeded(ctx context.Context) (*HTTPPollerResponse, error) // ResumeDelete204Succeeded - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumeDelete204Succeeded(token string) (HTTPPoller, error) // BeginDeleteAsyncNoHeaderInRetry - Long running delete request, service returns an Azure-AsyncOperation header in the initial request. Subsequent calls to operation status do not contain Azure-AsyncOperation header. - BeginDeleteAsyncNoHeaderInRetry(ctx context.Context) (*HTTPResponse, error) + BeginDeleteAsyncNoHeaderInRetry(ctx context.Context) (*HTTPPollerResponse, error) // ResumeDeleteAsyncNoHeaderInRetry - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumeDeleteAsyncNoHeaderInRetry(token string) (HTTPPoller, error) // BeginDeleteAsyncNoRetrySucceeded - Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status - BeginDeleteAsyncNoRetrySucceeded(ctx context.Context) (*HTTPResponse, error) + BeginDeleteAsyncNoRetrySucceeded(ctx context.Context) (*HTTPPollerResponse, error) // ResumeDeleteAsyncNoRetrySucceeded - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumeDeleteAsyncNoRetrySucceeded(token string) (HTTPPoller, error) // BeginDeleteAsyncRetryFailed - Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status - BeginDeleteAsyncRetryFailed(ctx context.Context) (*HTTPResponse, error) + BeginDeleteAsyncRetryFailed(ctx context.Context) (*HTTPPollerResponse, error) // ResumeDeleteAsyncRetryFailed - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumeDeleteAsyncRetryFailed(token string) (HTTPPoller, error) // BeginDeleteAsyncRetrySucceeded - Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status - BeginDeleteAsyncRetrySucceeded(ctx context.Context) (*HTTPResponse, error) + BeginDeleteAsyncRetrySucceeded(ctx context.Context) (*HTTPPollerResponse, error) // ResumeDeleteAsyncRetrySucceeded - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumeDeleteAsyncRetrySucceeded(token string) (HTTPPoller, error) // BeginDeleteAsyncRetrycanceled - Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status - BeginDeleteAsyncRetrycanceled(ctx context.Context) (*HTTPResponse, error) + BeginDeleteAsyncRetrycanceled(ctx context.Context) (*HTTPPollerResponse, error) // ResumeDeleteAsyncRetrycanceled - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumeDeleteAsyncRetrycanceled(token string) (HTTPPoller, error) // BeginDeleteNoHeaderInRetry - Long running delete request, service returns a location header in the initial request. Subsequent calls to operation status do not contain location header. - BeginDeleteNoHeaderInRetry(ctx context.Context) (*HTTPResponse, error) + BeginDeleteNoHeaderInRetry(ctx context.Context) (*HTTPPollerResponse, error) // ResumeDeleteNoHeaderInRetry - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumeDeleteNoHeaderInRetry(token string) (HTTPPoller, error) // BeginDeleteProvisioning202Accepted200Succeeded - Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’ - BeginDeleteProvisioning202Accepted200Succeeded(ctx context.Context) (*ProductResponse, error) + BeginDeleteProvisioning202Accepted200Succeeded(ctx context.Context) (*ProductPollerResponse, error) // ResumeDeleteProvisioning202Accepted200Succeeded - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumeDeleteProvisioning202Accepted200Succeeded(token string) (ProductPoller, error) // BeginDeleteProvisioning202DeletingFailed200 - Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’ - BeginDeleteProvisioning202DeletingFailed200(ctx context.Context) (*ProductResponse, error) + BeginDeleteProvisioning202DeletingFailed200(ctx context.Context) (*ProductPollerResponse, error) // ResumeDeleteProvisioning202DeletingFailed200 - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumeDeleteProvisioning202DeletingFailed200(token string) (ProductPoller, error) // BeginDeleteProvisioning202Deletingcanceled200 - Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’ - BeginDeleteProvisioning202Deletingcanceled200(ctx context.Context) (*ProductResponse, error) + BeginDeleteProvisioning202Deletingcanceled200(ctx context.Context) (*ProductPollerResponse, error) // ResumeDeleteProvisioning202Deletingcanceled200 - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumeDeleteProvisioning202Deletingcanceled200(token string) (ProductPoller, error) // BeginPost200WithPayload - Long running post request, service returns a 202 to the initial request, with 'Location' header. Poll returns a 200 with a response body after success. - BeginPost200WithPayload(ctx context.Context) (*SkuResponse, error) + BeginPost200WithPayload(ctx context.Context) (*SkuPollerResponse, error) // ResumePost200WithPayload - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePost200WithPayload(token string) (SkuPoller, error) // BeginPost202List - Long running put request, service returns a 202 with empty body to first request, returns a 200 with body [{ 'id': '100', 'name': 'foo' }]. - BeginPost202List(ctx context.Context) (*ProductArrayResponse, error) + BeginPost202List(ctx context.Context) (*ProductArrayPollerResponse, error) // ResumePost202List - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePost202List(token string) (ProductArrayPoller, error) // BeginPost202NoRetry204 - Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success - BeginPost202NoRetry204(ctx context.Context, lrOSPost202NoRetry204Options *LrOSPost202NoRetry204Options) (*ProductResponse, error) + BeginPost202NoRetry204(ctx context.Context, lrOSPost202NoRetry204Options *LrOSPost202NoRetry204Options) (*ProductPollerResponse, error) // ResumePost202NoRetry204 - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePost202NoRetry204(token string) (ProductPoller, error) // BeginPost202Retry200 - Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success - BeginPost202Retry200(ctx context.Context, lrOSPost202Retry200Options *LrOSPost202Retry200Options) (*HTTPResponse, error) + BeginPost202Retry200(ctx context.Context, lrOSPost202Retry200Options *LrOSPost202Retry200Options) (*HTTPPollerResponse, error) // ResumePost202Retry200 - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePost202Retry200(token string) (HTTPPoller, error) // BeginPostAsyncNoRetrySucceeded - Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status - BeginPostAsyncNoRetrySucceeded(ctx context.Context, lrOSPostAsyncNoRetrySucceededOptions *LrOSPostAsyncNoRetrySucceededOptions) (*ProductResponse, error) + BeginPostAsyncNoRetrySucceeded(ctx context.Context, lrOSPostAsyncNoRetrySucceededOptions *LrOSPostAsyncNoRetrySucceededOptions) (*ProductPollerResponse, error) // ResumePostAsyncNoRetrySucceeded - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePostAsyncNoRetrySucceeded(token string) (ProductPoller, error) // BeginPostAsyncRetryFailed - Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status - BeginPostAsyncRetryFailed(ctx context.Context, lrOSPostAsyncRetryFailedOptions *LrOSPostAsyncRetryFailedOptions) (*HTTPResponse, error) + BeginPostAsyncRetryFailed(ctx context.Context, lrOSPostAsyncRetryFailedOptions *LrOSPostAsyncRetryFailedOptions) (*HTTPPollerResponse, error) // ResumePostAsyncRetryFailed - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePostAsyncRetryFailed(token string) (HTTPPoller, error) // BeginPostAsyncRetrySucceeded - Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status - BeginPostAsyncRetrySucceeded(ctx context.Context, lrOSPostAsyncRetrySucceededOptions *LrOSPostAsyncRetrySucceededOptions) (*ProductResponse, error) + BeginPostAsyncRetrySucceeded(ctx context.Context, lrOSPostAsyncRetrySucceededOptions *LrOSPostAsyncRetrySucceededOptions) (*ProductPollerResponse, error) // ResumePostAsyncRetrySucceeded - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePostAsyncRetrySucceeded(token string) (ProductPoller, error) // BeginPostAsyncRetrycanceled - Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status - BeginPostAsyncRetrycanceled(ctx context.Context, lrOSPostAsyncRetrycanceledOptions *LrOSPostAsyncRetrycanceledOptions) (*HTTPResponse, error) + BeginPostAsyncRetrycanceled(ctx context.Context, lrOSPostAsyncRetrycanceledOptions *LrOSPostAsyncRetrycanceledOptions) (*HTTPPollerResponse, error) // ResumePostAsyncRetrycanceled - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePostAsyncRetrycanceled(token string) (HTTPPoller, error) // BeginPostDoubleHeadersFinalAzureHeaderGet - Long running post request, service returns a 202 to the initial request with both Location and Azure-Async header. Poll Azure-Async and it's success. Should NOT poll Location to get the final object - BeginPostDoubleHeadersFinalAzureHeaderGet(ctx context.Context) (*ProductResponse, error) + BeginPostDoubleHeadersFinalAzureHeaderGet(ctx context.Context) (*ProductPollerResponse, error) // ResumePostDoubleHeadersFinalAzureHeaderGet - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePostDoubleHeadersFinalAzureHeaderGet(token string) (ProductPoller, error) // BeginPostDoubleHeadersFinalAzureHeaderGetDefault - Long running post request, service returns a 202 to the initial request with both Location and Azure-Async header. Poll Azure-Async and it's success. Should NOT poll Location to get the final object if you support initial Autorest behavior. - BeginPostDoubleHeadersFinalAzureHeaderGetDefault(ctx context.Context) (*ProductResponse, error) + BeginPostDoubleHeadersFinalAzureHeaderGetDefault(ctx context.Context) (*ProductPollerResponse, error) // ResumePostDoubleHeadersFinalAzureHeaderGetDefault - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePostDoubleHeadersFinalAzureHeaderGetDefault(token string) (ProductPoller, error) // BeginPostDoubleHeadersFinalLocationGet - Long running post request, service returns a 202 to the initial request with both Location and Azure-Async header. Poll Azure-Async and it's success. Should poll Location to get the final object - BeginPostDoubleHeadersFinalLocationGet(ctx context.Context) (*ProductResponse, error) + BeginPostDoubleHeadersFinalLocationGet(ctx context.Context) (*ProductPollerResponse, error) // ResumePostDoubleHeadersFinalLocationGet - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePostDoubleHeadersFinalLocationGet(token string) (ProductPoller, error) // BeginPut200Acceptedcanceled200 - Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’ - BeginPut200Acceptedcanceled200(ctx context.Context, lrOSPut200Acceptedcanceled200Options *LrOSPut200Acceptedcanceled200Options) (*ProductResponse, error) + BeginPut200Acceptedcanceled200(ctx context.Context, lrOSPut200Acceptedcanceled200Options *LrOSPut200Acceptedcanceled200Options) (*ProductPollerResponse, error) // ResumePut200Acceptedcanceled200 - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePut200Acceptedcanceled200(token string) (ProductPoller, error) // BeginPut200Succeeded - Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. - BeginPut200Succeeded(ctx context.Context, lrOSPut200SucceededOptions *LrOSPut200SucceededOptions) (*ProductResponse, error) + BeginPut200Succeeded(ctx context.Context, lrOSPut200SucceededOptions *LrOSPut200SucceededOptions) (*ProductPollerResponse, error) // ResumePut200Succeeded - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePut200Succeeded(token string) (ProductPoller, error) // BeginPut200SucceededNoState - Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. - BeginPut200SucceededNoState(ctx context.Context, lrOSPut200SucceededNoStateOptions *LrOSPut200SucceededNoStateOptions) (*ProductResponse, error) + BeginPut200SucceededNoState(ctx context.Context, lrOSPut200SucceededNoStateOptions *LrOSPut200SucceededNoStateOptions) (*ProductPollerResponse, error) // ResumePut200SucceededNoState - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePut200SucceededNoState(token string) (ProductPoller, error) // BeginPut200UpdatingSucceeded204 - Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’ - BeginPut200UpdatingSucceeded204(ctx context.Context, lrOSPut200UpdatingSucceeded204Options *LrOSPut200UpdatingSucceeded204Options) (*ProductResponse, error) + BeginPut200UpdatingSucceeded204(ctx context.Context, lrOSPut200UpdatingSucceeded204Options *LrOSPut200UpdatingSucceeded204Options) (*ProductPollerResponse, error) // ResumePut200UpdatingSucceeded204 - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePut200UpdatingSucceeded204(token string) (ProductPoller, error) // BeginPut201CreatingFailed200 - Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’ - BeginPut201CreatingFailed200(ctx context.Context, lrOSPut201CreatingFailed200Options *LrOSPut201CreatingFailed200Options) (*ProductResponse, error) + BeginPut201CreatingFailed200(ctx context.Context, lrOSPut201CreatingFailed200Options *LrOSPut201CreatingFailed200Options) (*ProductPollerResponse, error) // ResumePut201CreatingFailed200 - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePut201CreatingFailed200(token string) (ProductPoller, error) // BeginPut201CreatingSucceeded200 - Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’ - BeginPut201CreatingSucceeded200(ctx context.Context, lrOSPut201CreatingSucceeded200Options *LrOSPut201CreatingSucceeded200Options) (*ProductResponse, error) + BeginPut201CreatingSucceeded200(ctx context.Context, lrOSPut201CreatingSucceeded200Options *LrOSPut201CreatingSucceeded200Options) (*ProductPollerResponse, error) // ResumePut201CreatingSucceeded200 - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePut201CreatingSucceeded200(token string) (ProductPoller, error) // BeginPut201Succeeded - Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. - BeginPut201Succeeded(ctx context.Context, lrOSPut201SucceededOptions *LrOSPut201SucceededOptions) (*ProductResponse, error) + BeginPut201Succeeded(ctx context.Context, lrOSPut201SucceededOptions *LrOSPut201SucceededOptions) (*ProductPollerResponse, error) // ResumePut201Succeeded - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePut201Succeeded(token string) (ProductPoller, error) // BeginPut202Retry200 - Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState - BeginPut202Retry200(ctx context.Context, lrOSPut202Retry200Options *LrOSPut202Retry200Options) (*ProductResponse, error) + BeginPut202Retry200(ctx context.Context, lrOSPut202Retry200Options *LrOSPut202Retry200Options) (*ProductPollerResponse, error) // ResumePut202Retry200 - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePut202Retry200(token string) (ProductPoller, error) // BeginPutAsyncNoHeaderInRetry - Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. - BeginPutAsyncNoHeaderInRetry(ctx context.Context, lrOSPutAsyncNoHeaderInRetryOptions *LrOSPutAsyncNoHeaderInRetryOptions) (*ProductResponse, error) + BeginPutAsyncNoHeaderInRetry(ctx context.Context, lrOSPutAsyncNoHeaderInRetryOptions *LrOSPutAsyncNoHeaderInRetryOptions) (*ProductPollerResponse, error) // ResumePutAsyncNoHeaderInRetry - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePutAsyncNoHeaderInRetry(token string) (ProductPoller, error) // BeginPutAsyncNoRetrySucceeded - Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status - BeginPutAsyncNoRetrySucceeded(ctx context.Context, lrOSPutAsyncNoRetrySucceededOptions *LrOSPutAsyncNoRetrySucceededOptions) (*ProductResponse, error) + BeginPutAsyncNoRetrySucceeded(ctx context.Context, lrOSPutAsyncNoRetrySucceededOptions *LrOSPutAsyncNoRetrySucceededOptions) (*ProductPollerResponse, error) // ResumePutAsyncNoRetrySucceeded - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePutAsyncNoRetrySucceeded(token string) (ProductPoller, error) // BeginPutAsyncNoRetrycanceled - Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status - BeginPutAsyncNoRetrycanceled(ctx context.Context, lrOSPutAsyncNoRetrycanceledOptions *LrOSPutAsyncNoRetrycanceledOptions) (*ProductResponse, error) + BeginPutAsyncNoRetrycanceled(ctx context.Context, lrOSPutAsyncNoRetrycanceledOptions *LrOSPutAsyncNoRetrycanceledOptions) (*ProductPollerResponse, error) // ResumePutAsyncNoRetrycanceled - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePutAsyncNoRetrycanceled(token string) (ProductPoller, error) // BeginPutAsyncNonResource - Long running put request with non resource. - BeginPutAsyncNonResource(ctx context.Context, lrOSPutAsyncNonResourceOptions *LrOSPutAsyncNonResourceOptions) (*SkuResponse, error) + BeginPutAsyncNonResource(ctx context.Context, lrOSPutAsyncNonResourceOptions *LrOSPutAsyncNonResourceOptions) (*SkuPollerResponse, error) // ResumePutAsyncNonResource - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePutAsyncNonResource(token string) (SkuPoller, error) // BeginPutAsyncRetryFailed - Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status - BeginPutAsyncRetryFailed(ctx context.Context, lrOSPutAsyncRetryFailedOptions *LrOSPutAsyncRetryFailedOptions) (*ProductResponse, error) + BeginPutAsyncRetryFailed(ctx context.Context, lrOSPutAsyncRetryFailedOptions *LrOSPutAsyncRetryFailedOptions) (*ProductPollerResponse, error) // ResumePutAsyncRetryFailed - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePutAsyncRetryFailed(token string) (ProductPoller, error) // BeginPutAsyncRetrySucceeded - Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status - BeginPutAsyncRetrySucceeded(ctx context.Context, lrOSPutAsyncRetrySucceededOptions *LrOSPutAsyncRetrySucceededOptions) (*ProductResponse, error) + BeginPutAsyncRetrySucceeded(ctx context.Context, lrOSPutAsyncRetrySucceededOptions *LrOSPutAsyncRetrySucceededOptions) (*ProductPollerResponse, error) // ResumePutAsyncRetrySucceeded - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePutAsyncRetrySucceeded(token string) (ProductPoller, error) // BeginPutAsyncSubResource - Long running put request with sub resource. - BeginPutAsyncSubResource(ctx context.Context, lrOSPutAsyncSubResourceOptions *LrOSPutAsyncSubResourceOptions) (*SubProductResponse, error) + BeginPutAsyncSubResource(ctx context.Context, lrOSPutAsyncSubResourceOptions *LrOSPutAsyncSubResourceOptions) (*SubProductPollerResponse, error) // ResumePutAsyncSubResource - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePutAsyncSubResource(token string) (SubProductPoller, error) // BeginPutNoHeaderInRetry - Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. - BeginPutNoHeaderInRetry(ctx context.Context, lrOSPutNoHeaderInRetryOptions *LrOSPutNoHeaderInRetryOptions) (*ProductResponse, error) + BeginPutNoHeaderInRetry(ctx context.Context, lrOSPutNoHeaderInRetryOptions *LrOSPutNoHeaderInRetryOptions) (*ProductPollerResponse, error) // ResumePutNoHeaderInRetry - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePutNoHeaderInRetry(token string) (ProductPoller, error) // BeginPutNonResource - Long running put request with non resource. - BeginPutNonResource(ctx context.Context, lrOSPutNonResourceOptions *LrOSPutNonResourceOptions) (*SkuResponse, error) + BeginPutNonResource(ctx context.Context, lrOSPutNonResourceOptions *LrOSPutNonResourceOptions) (*SkuPollerResponse, error) // ResumePutNonResource - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePutNonResource(token string) (SkuPoller, error) // BeginPutSubResource - Long running put request with sub resource. - BeginPutSubResource(ctx context.Context, lrOSPutSubResourceOptions *LrOSPutSubResourceOptions) (*SubProductResponse, error) + BeginPutSubResource(ctx context.Context, lrOSPutSubResourceOptions *LrOSPutSubResourceOptions) (*SubProductPollerResponse, error) // ResumePutSubResource - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePutSubResource(token string) (SubProductPoller, error) } @@ -186,7 +186,7 @@ type lrOSOperations struct { } // Delete202NoRetry204 - Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’ -func (client *lrOSOperations) BeginDelete202NoRetry204(ctx context.Context) (*ProductResponse, error) { +func (client *lrOSOperations) BeginDelete202NoRetry204(ctx context.Context) (*ProductPollerResponse, error) { req, err := client.delete202NoRetry204CreateRequest() if err != nil { return nil, err @@ -238,12 +238,11 @@ func (client *lrOSOperations) delete202NoRetry204CreateRequest() (*azcore.Reques } // delete202NoRetry204HandleResponse handles the Delete202NoRetry204 response. -func (client *lrOSOperations) delete202NoRetry204HandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lrOSOperations) delete202NoRetry204HandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent) { return nil, client.delete202NoRetry204HandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // delete202NoRetry204HandleError handles the Delete202NoRetry204 error response. @@ -256,7 +255,7 @@ func (client *lrOSOperations) delete202NoRetry204HandleError(resp *azcore.Respon } // Delete202Retry200 - Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’ -func (client *lrOSOperations) BeginDelete202Retry200(ctx context.Context) (*ProductResponse, error) { +func (client *lrOSOperations) BeginDelete202Retry200(ctx context.Context) (*ProductPollerResponse, error) { req, err := client.delete202Retry200CreateRequest() if err != nil { return nil, err @@ -308,12 +307,11 @@ func (client *lrOSOperations) delete202Retry200CreateRequest() (*azcore.Request, } // delete202Retry200HandleResponse handles the Delete202Retry200 response. -func (client *lrOSOperations) delete202Retry200HandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lrOSOperations) delete202Retry200HandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent) { return nil, client.delete202Retry200HandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // delete202Retry200HandleError handles the Delete202Retry200 error response. @@ -326,7 +324,7 @@ func (client *lrOSOperations) delete202Retry200HandleError(resp *azcore.Response } // Delete204Succeeded - Long running delete succeeds and returns right away -func (client *lrOSOperations) BeginDelete204Succeeded(ctx context.Context) (*HTTPResponse, error) { +func (client *lrOSOperations) BeginDelete204Succeeded(ctx context.Context) (*HTTPPollerResponse, error) { req, err := client.delete204SucceededCreateRequest() if err != nil { return nil, err @@ -378,12 +376,11 @@ func (client *lrOSOperations) delete204SucceededCreateRequest() (*azcore.Request } // delete204SucceededHandleResponse handles the Delete204Succeeded response. -func (client *lrOSOperations) delete204SucceededHandleResponse(resp *azcore.Response) (*HTTPResponse, error) { +func (client *lrOSOperations) delete204SucceededHandleResponse(resp *azcore.Response) (*HTTPPollerResponse, error) { if !resp.HasStatusCode(http.StatusNoContent) { return nil, client.delete204SucceededHandleError(resp) } - result := HTTPResponse{RawResponse: resp.Response} - return &result, nil + return &HTTPPollerResponse{RawResponse: resp.Response}, nil } // delete204SucceededHandleError handles the Delete204Succeeded error response. @@ -396,7 +393,7 @@ func (client *lrOSOperations) delete204SucceededHandleError(resp *azcore.Respons } // DeleteAsyncNoHeaderInRetry - Long running delete request, service returns an Azure-AsyncOperation header in the initial request. Subsequent calls to operation status do not contain Azure-AsyncOperation header. -func (client *lrOSOperations) BeginDeleteAsyncNoHeaderInRetry(ctx context.Context) (*HTTPResponse, error) { +func (client *lrOSOperations) BeginDeleteAsyncNoHeaderInRetry(ctx context.Context) (*HTTPPollerResponse, error) { req, err := client.deleteAsyncNoHeaderInRetryCreateRequest() if err != nil { return nil, err @@ -448,11 +445,11 @@ func (client *lrOSOperations) deleteAsyncNoHeaderInRetryCreateRequest() (*azcore } // deleteAsyncNoHeaderInRetryHandleResponse handles the DeleteAsyncNoHeaderInRetry response. -func (client *lrOSOperations) deleteAsyncNoHeaderInRetryHandleResponse(resp *azcore.Response) (*HTTPResponse, error) { +func (client *lrOSOperations) deleteAsyncNoHeaderInRetryHandleResponse(resp *azcore.Response) (*HTTPPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.deleteAsyncNoHeaderInRetryHandleError(resp) } - return &HTTPResponse{RawResponse: resp.Response}, nil + return &HTTPPollerResponse{RawResponse: resp.Response}, nil } // deleteAsyncNoHeaderInRetryHandleError handles the DeleteAsyncNoHeaderInRetry error response. @@ -465,7 +462,7 @@ func (client *lrOSOperations) deleteAsyncNoHeaderInRetryHandleError(resp *azcore } // DeleteAsyncNoRetrySucceeded - Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status -func (client *lrOSOperations) BeginDeleteAsyncNoRetrySucceeded(ctx context.Context) (*HTTPResponse, error) { +func (client *lrOSOperations) BeginDeleteAsyncNoRetrySucceeded(ctx context.Context) (*HTTPPollerResponse, error) { req, err := client.deleteAsyncNoRetrySucceededCreateRequest() if err != nil { return nil, err @@ -517,11 +514,11 @@ func (client *lrOSOperations) deleteAsyncNoRetrySucceededCreateRequest() (*azcor } // deleteAsyncNoRetrySucceededHandleResponse handles the DeleteAsyncNoRetrySucceeded response. -func (client *lrOSOperations) deleteAsyncNoRetrySucceededHandleResponse(resp *azcore.Response) (*HTTPResponse, error) { +func (client *lrOSOperations) deleteAsyncNoRetrySucceededHandleResponse(resp *azcore.Response) (*HTTPPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.deleteAsyncNoRetrySucceededHandleError(resp) } - return &HTTPResponse{RawResponse: resp.Response}, nil + return &HTTPPollerResponse{RawResponse: resp.Response}, nil } // deleteAsyncNoRetrySucceededHandleError handles the DeleteAsyncNoRetrySucceeded error response. @@ -534,7 +531,7 @@ func (client *lrOSOperations) deleteAsyncNoRetrySucceededHandleError(resp *azcor } // DeleteAsyncRetryFailed - Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status -func (client *lrOSOperations) BeginDeleteAsyncRetryFailed(ctx context.Context) (*HTTPResponse, error) { +func (client *lrOSOperations) BeginDeleteAsyncRetryFailed(ctx context.Context) (*HTTPPollerResponse, error) { req, err := client.deleteAsyncRetryFailedCreateRequest() if err != nil { return nil, err @@ -586,11 +583,11 @@ func (client *lrOSOperations) deleteAsyncRetryFailedCreateRequest() (*azcore.Req } // deleteAsyncRetryFailedHandleResponse handles the DeleteAsyncRetryFailed response. -func (client *lrOSOperations) deleteAsyncRetryFailedHandleResponse(resp *azcore.Response) (*HTTPResponse, error) { +func (client *lrOSOperations) deleteAsyncRetryFailedHandleResponse(resp *azcore.Response) (*HTTPPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.deleteAsyncRetryFailedHandleError(resp) } - return &HTTPResponse{RawResponse: resp.Response}, nil + return &HTTPPollerResponse{RawResponse: resp.Response}, nil } // deleteAsyncRetryFailedHandleError handles the DeleteAsyncRetryFailed error response. @@ -603,7 +600,7 @@ func (client *lrOSOperations) deleteAsyncRetryFailedHandleError(resp *azcore.Res } // DeleteAsyncRetrySucceeded - Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status -func (client *lrOSOperations) BeginDeleteAsyncRetrySucceeded(ctx context.Context) (*HTTPResponse, error) { +func (client *lrOSOperations) BeginDeleteAsyncRetrySucceeded(ctx context.Context) (*HTTPPollerResponse, error) { req, err := client.deleteAsyncRetrySucceededCreateRequest() if err != nil { return nil, err @@ -655,11 +652,11 @@ func (client *lrOSOperations) deleteAsyncRetrySucceededCreateRequest() (*azcore. } // deleteAsyncRetrySucceededHandleResponse handles the DeleteAsyncRetrySucceeded response. -func (client *lrOSOperations) deleteAsyncRetrySucceededHandleResponse(resp *azcore.Response) (*HTTPResponse, error) { +func (client *lrOSOperations) deleteAsyncRetrySucceededHandleResponse(resp *azcore.Response) (*HTTPPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.deleteAsyncRetrySucceededHandleError(resp) } - return &HTTPResponse{RawResponse: resp.Response}, nil + return &HTTPPollerResponse{RawResponse: resp.Response}, nil } // deleteAsyncRetrySucceededHandleError handles the DeleteAsyncRetrySucceeded error response. @@ -672,7 +669,7 @@ func (client *lrOSOperations) deleteAsyncRetrySucceededHandleError(resp *azcore. } // DeleteAsyncRetrycanceled - Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status -func (client *lrOSOperations) BeginDeleteAsyncRetrycanceled(ctx context.Context) (*HTTPResponse, error) { +func (client *lrOSOperations) BeginDeleteAsyncRetrycanceled(ctx context.Context) (*HTTPPollerResponse, error) { req, err := client.deleteAsyncRetrycanceledCreateRequest() if err != nil { return nil, err @@ -724,11 +721,11 @@ func (client *lrOSOperations) deleteAsyncRetrycanceledCreateRequest() (*azcore.R } // deleteAsyncRetrycanceledHandleResponse handles the DeleteAsyncRetrycanceled response. -func (client *lrOSOperations) deleteAsyncRetrycanceledHandleResponse(resp *azcore.Response) (*HTTPResponse, error) { +func (client *lrOSOperations) deleteAsyncRetrycanceledHandleResponse(resp *azcore.Response) (*HTTPPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.deleteAsyncRetrycanceledHandleError(resp) } - return &HTTPResponse{RawResponse: resp.Response}, nil + return &HTTPPollerResponse{RawResponse: resp.Response}, nil } // deleteAsyncRetrycanceledHandleError handles the DeleteAsyncRetrycanceled error response. @@ -741,7 +738,7 @@ func (client *lrOSOperations) deleteAsyncRetrycanceledHandleError(resp *azcore.R } // DeleteNoHeaderInRetry - Long running delete request, service returns a location header in the initial request. Subsequent calls to operation status do not contain location header. -func (client *lrOSOperations) BeginDeleteNoHeaderInRetry(ctx context.Context) (*HTTPResponse, error) { +func (client *lrOSOperations) BeginDeleteNoHeaderInRetry(ctx context.Context) (*HTTPPollerResponse, error) { req, err := client.deleteNoHeaderInRetryCreateRequest() if err != nil { return nil, err @@ -793,11 +790,11 @@ func (client *lrOSOperations) deleteNoHeaderInRetryCreateRequest() (*azcore.Requ } // deleteNoHeaderInRetryHandleResponse handles the DeleteNoHeaderInRetry response. -func (client *lrOSOperations) deleteNoHeaderInRetryHandleResponse(resp *azcore.Response) (*HTTPResponse, error) { +func (client *lrOSOperations) deleteNoHeaderInRetryHandleResponse(resp *azcore.Response) (*HTTPPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.deleteNoHeaderInRetryHandleError(resp) } - return &HTTPResponse{RawResponse: resp.Response}, nil + return &HTTPPollerResponse{RawResponse: resp.Response}, nil } // deleteNoHeaderInRetryHandleError handles the DeleteNoHeaderInRetry error response. @@ -810,7 +807,7 @@ func (client *lrOSOperations) deleteNoHeaderInRetryHandleError(resp *azcore.Resp } // DeleteProvisioning202Accepted200Succeeded - Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’ -func (client *lrOSOperations) BeginDeleteProvisioning202Accepted200Succeeded(ctx context.Context) (*ProductResponse, error) { +func (client *lrOSOperations) BeginDeleteProvisioning202Accepted200Succeeded(ctx context.Context) (*ProductPollerResponse, error) { req, err := client.deleteProvisioning202Accepted200SucceededCreateRequest() if err != nil { return nil, err @@ -862,12 +859,11 @@ func (client *lrOSOperations) deleteProvisioning202Accepted200SucceededCreateReq } // deleteProvisioning202Accepted200SucceededHandleResponse handles the DeleteProvisioning202Accepted200Succeeded response. -func (client *lrOSOperations) deleteProvisioning202Accepted200SucceededHandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lrOSOperations) deleteProvisioning202Accepted200SucceededHandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent) { return nil, client.deleteProvisioning202Accepted200SucceededHandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // deleteProvisioning202Accepted200SucceededHandleError handles the DeleteProvisioning202Accepted200Succeeded error response. @@ -880,7 +876,7 @@ func (client *lrOSOperations) deleteProvisioning202Accepted200SucceededHandleErr } // DeleteProvisioning202DeletingFailed200 - Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’ -func (client *lrOSOperations) BeginDeleteProvisioning202DeletingFailed200(ctx context.Context) (*ProductResponse, error) { +func (client *lrOSOperations) BeginDeleteProvisioning202DeletingFailed200(ctx context.Context) (*ProductPollerResponse, error) { req, err := client.deleteProvisioning202DeletingFailed200CreateRequest() if err != nil { return nil, err @@ -932,12 +928,11 @@ func (client *lrOSOperations) deleteProvisioning202DeletingFailed200CreateReques } // deleteProvisioning202DeletingFailed200HandleResponse handles the DeleteProvisioning202DeletingFailed200 response. -func (client *lrOSOperations) deleteProvisioning202DeletingFailed200HandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lrOSOperations) deleteProvisioning202DeletingFailed200HandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent) { return nil, client.deleteProvisioning202DeletingFailed200HandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // deleteProvisioning202DeletingFailed200HandleError handles the DeleteProvisioning202DeletingFailed200 error response. @@ -950,7 +945,7 @@ func (client *lrOSOperations) deleteProvisioning202DeletingFailed200HandleError( } // DeleteProvisioning202Deletingcanceled200 - Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’ -func (client *lrOSOperations) BeginDeleteProvisioning202Deletingcanceled200(ctx context.Context) (*ProductResponse, error) { +func (client *lrOSOperations) BeginDeleteProvisioning202Deletingcanceled200(ctx context.Context) (*ProductPollerResponse, error) { req, err := client.deleteProvisioning202Deletingcanceled200CreateRequest() if err != nil { return nil, err @@ -1002,12 +997,11 @@ func (client *lrOSOperations) deleteProvisioning202Deletingcanceled200CreateRequ } // deleteProvisioning202Deletingcanceled200HandleResponse handles the DeleteProvisioning202Deletingcanceled200 response. -func (client *lrOSOperations) deleteProvisioning202Deletingcanceled200HandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lrOSOperations) deleteProvisioning202Deletingcanceled200HandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent) { return nil, client.deleteProvisioning202Deletingcanceled200HandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // deleteProvisioning202Deletingcanceled200HandleError handles the DeleteProvisioning202Deletingcanceled200 error response. @@ -1020,7 +1014,7 @@ func (client *lrOSOperations) deleteProvisioning202Deletingcanceled200HandleErro } // Post200WithPayload - Long running post request, service returns a 202 to the initial request, with 'Location' header. Poll returns a 200 with a response body after success. -func (client *lrOSOperations) BeginPost200WithPayload(ctx context.Context) (*SkuResponse, error) { +func (client *lrOSOperations) BeginPost200WithPayload(ctx context.Context) (*SkuPollerResponse, error) { req, err := client.post200WithPayloadCreateRequest() if err != nil { return nil, err @@ -1072,12 +1066,11 @@ func (client *lrOSOperations) post200WithPayloadCreateRequest() (*azcore.Request } // post200WithPayloadHandleResponse handles the Post200WithPayload response. -func (client *lrOSOperations) post200WithPayloadHandleResponse(resp *azcore.Response) (*SkuResponse, error) { +func (client *lrOSOperations) post200WithPayloadHandleResponse(resp *azcore.Response) (*SkuPollerResponse, error) { if !resp.HasStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent) { return nil, client.post200WithPayloadHandleError(resp) } - result := SkuResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Sku) + return &SkuPollerResponse{RawResponse: resp.Response}, nil } // post200WithPayloadHandleError handles the Post200WithPayload error response. @@ -1090,7 +1083,7 @@ func (client *lrOSOperations) post200WithPayloadHandleError(resp *azcore.Respons } // Post202List - Long running put request, service returns a 202 with empty body to first request, returns a 200 with body [{ 'id': '100', 'name': 'foo' }]. -func (client *lrOSOperations) BeginPost202List(ctx context.Context) (*ProductArrayResponse, error) { +func (client *lrOSOperations) BeginPost202List(ctx context.Context) (*ProductArrayPollerResponse, error) { req, err := client.post202ListCreateRequest() if err != nil { return nil, err @@ -1142,18 +1135,11 @@ func (client *lrOSOperations) post202ListCreateRequest() (*azcore.Request, error } // post202ListHandleResponse handles the Post202List response. -func (client *lrOSOperations) post202ListHandleResponse(resp *azcore.Response) (*ProductArrayResponse, error) { +func (client *lrOSOperations) post202ListHandleResponse(resp *azcore.Response) (*ProductArrayPollerResponse, error) { if !resp.HasStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent) { return nil, client.post202ListHandleError(resp) } - result := ProductArrayResponse{RawResponse: resp.Response} - if val := resp.Header.Get("Azure-AsyncOperation"); val != "" { - result.AzureAsyncOperation = &val - } - if val := resp.Header.Get("Location"); val != "" { - result.Location = &val - } - return &result, resp.UnmarshalAsJSON(&result.ProductArray) + return &ProductArrayPollerResponse{RawResponse: resp.Response}, nil } // post202ListHandleError handles the Post202List error response. @@ -1166,7 +1152,7 @@ func (client *lrOSOperations) post202ListHandleError(resp *azcore.Response) erro } // Post202NoRetry204 - Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success -func (client *lrOSOperations) BeginPost202NoRetry204(ctx context.Context, lrOSPost202NoRetry204Options *LrOSPost202NoRetry204Options) (*ProductResponse, error) { +func (client *lrOSOperations) BeginPost202NoRetry204(ctx context.Context, lrOSPost202NoRetry204Options *LrOSPost202NoRetry204Options) (*ProductPollerResponse, error) { req, err := client.post202NoRetry204CreateRequest(lrOSPost202NoRetry204Options) if err != nil { return nil, err @@ -1221,12 +1207,11 @@ func (client *lrOSOperations) post202NoRetry204CreateRequest(lrOSPost202NoRetry2 } // post202NoRetry204HandleResponse handles the Post202NoRetry204 response. -func (client *lrOSOperations) post202NoRetry204HandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lrOSOperations) post202NoRetry204HandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.post202NoRetry204HandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // post202NoRetry204HandleError handles the Post202NoRetry204 error response. @@ -1239,7 +1224,7 @@ func (client *lrOSOperations) post202NoRetry204HandleError(resp *azcore.Response } // Post202Retry200 - Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success -func (client *lrOSOperations) BeginPost202Retry200(ctx context.Context, lrOSPost202Retry200Options *LrOSPost202Retry200Options) (*HTTPResponse, error) { +func (client *lrOSOperations) BeginPost202Retry200(ctx context.Context, lrOSPost202Retry200Options *LrOSPost202Retry200Options) (*HTTPPollerResponse, error) { req, err := client.post202Retry200CreateRequest(lrOSPost202Retry200Options) if err != nil { return nil, err @@ -1294,11 +1279,11 @@ func (client *lrOSOperations) post202Retry200CreateRequest(lrOSPost202Retry200Op } // post202Retry200HandleResponse handles the Post202Retry200 response. -func (client *lrOSOperations) post202Retry200HandleResponse(resp *azcore.Response) (*HTTPResponse, error) { +func (client *lrOSOperations) post202Retry200HandleResponse(resp *azcore.Response) (*HTTPPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.post202Retry200HandleError(resp) } - return &HTTPResponse{RawResponse: resp.Response}, nil + return &HTTPPollerResponse{RawResponse: resp.Response}, nil } // post202Retry200HandleError handles the Post202Retry200 error response. @@ -1311,7 +1296,7 @@ func (client *lrOSOperations) post202Retry200HandleError(resp *azcore.Response) } // PostAsyncNoRetrySucceeded - Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status -func (client *lrOSOperations) BeginPostAsyncNoRetrySucceeded(ctx context.Context, lrOSPostAsyncNoRetrySucceededOptions *LrOSPostAsyncNoRetrySucceededOptions) (*ProductResponse, error) { +func (client *lrOSOperations) BeginPostAsyncNoRetrySucceeded(ctx context.Context, lrOSPostAsyncNoRetrySucceededOptions *LrOSPostAsyncNoRetrySucceededOptions) (*ProductPollerResponse, error) { req, err := client.postAsyncNoRetrySucceededCreateRequest(lrOSPostAsyncNoRetrySucceededOptions) if err != nil { return nil, err @@ -1366,12 +1351,11 @@ func (client *lrOSOperations) postAsyncNoRetrySucceededCreateRequest(lrOSPostAsy } // postAsyncNoRetrySucceededHandleResponse handles the PostAsyncNoRetrySucceeded response. -func (client *lrOSOperations) postAsyncNoRetrySucceededHandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lrOSOperations) postAsyncNoRetrySucceededHandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent) { return nil, client.postAsyncNoRetrySucceededHandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // postAsyncNoRetrySucceededHandleError handles the PostAsyncNoRetrySucceeded error response. @@ -1384,7 +1368,7 @@ func (client *lrOSOperations) postAsyncNoRetrySucceededHandleError(resp *azcore. } // PostAsyncRetryFailed - Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status -func (client *lrOSOperations) BeginPostAsyncRetryFailed(ctx context.Context, lrOSPostAsyncRetryFailedOptions *LrOSPostAsyncRetryFailedOptions) (*HTTPResponse, error) { +func (client *lrOSOperations) BeginPostAsyncRetryFailed(ctx context.Context, lrOSPostAsyncRetryFailedOptions *LrOSPostAsyncRetryFailedOptions) (*HTTPPollerResponse, error) { req, err := client.postAsyncRetryFailedCreateRequest(lrOSPostAsyncRetryFailedOptions) if err != nil { return nil, err @@ -1439,11 +1423,11 @@ func (client *lrOSOperations) postAsyncRetryFailedCreateRequest(lrOSPostAsyncRet } // postAsyncRetryFailedHandleResponse handles the PostAsyncRetryFailed response. -func (client *lrOSOperations) postAsyncRetryFailedHandleResponse(resp *azcore.Response) (*HTTPResponse, error) { +func (client *lrOSOperations) postAsyncRetryFailedHandleResponse(resp *azcore.Response) (*HTTPPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.postAsyncRetryFailedHandleError(resp) } - return &HTTPResponse{RawResponse: resp.Response}, nil + return &HTTPPollerResponse{RawResponse: resp.Response}, nil } // postAsyncRetryFailedHandleError handles the PostAsyncRetryFailed error response. @@ -1456,7 +1440,7 @@ func (client *lrOSOperations) postAsyncRetryFailedHandleError(resp *azcore.Respo } // PostAsyncRetrySucceeded - Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status -func (client *lrOSOperations) BeginPostAsyncRetrySucceeded(ctx context.Context, lrOSPostAsyncRetrySucceededOptions *LrOSPostAsyncRetrySucceededOptions) (*ProductResponse, error) { +func (client *lrOSOperations) BeginPostAsyncRetrySucceeded(ctx context.Context, lrOSPostAsyncRetrySucceededOptions *LrOSPostAsyncRetrySucceededOptions) (*ProductPollerResponse, error) { req, err := client.postAsyncRetrySucceededCreateRequest(lrOSPostAsyncRetrySucceededOptions) if err != nil { return nil, err @@ -1511,12 +1495,11 @@ func (client *lrOSOperations) postAsyncRetrySucceededCreateRequest(lrOSPostAsync } // postAsyncRetrySucceededHandleResponse handles the PostAsyncRetrySucceeded response. -func (client *lrOSOperations) postAsyncRetrySucceededHandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lrOSOperations) postAsyncRetrySucceededHandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent) { return nil, client.postAsyncRetrySucceededHandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // postAsyncRetrySucceededHandleError handles the PostAsyncRetrySucceeded error response. @@ -1529,7 +1512,7 @@ func (client *lrOSOperations) postAsyncRetrySucceededHandleError(resp *azcore.Re } // PostAsyncRetrycanceled - Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status -func (client *lrOSOperations) BeginPostAsyncRetrycanceled(ctx context.Context, lrOSPostAsyncRetrycanceledOptions *LrOSPostAsyncRetrycanceledOptions) (*HTTPResponse, error) { +func (client *lrOSOperations) BeginPostAsyncRetrycanceled(ctx context.Context, lrOSPostAsyncRetrycanceledOptions *LrOSPostAsyncRetrycanceledOptions) (*HTTPPollerResponse, error) { req, err := client.postAsyncRetrycanceledCreateRequest(lrOSPostAsyncRetrycanceledOptions) if err != nil { return nil, err @@ -1584,11 +1567,11 @@ func (client *lrOSOperations) postAsyncRetrycanceledCreateRequest(lrOSPostAsyncR } // postAsyncRetrycanceledHandleResponse handles the PostAsyncRetrycanceled response. -func (client *lrOSOperations) postAsyncRetrycanceledHandleResponse(resp *azcore.Response) (*HTTPResponse, error) { +func (client *lrOSOperations) postAsyncRetrycanceledHandleResponse(resp *azcore.Response) (*HTTPPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.postAsyncRetrycanceledHandleError(resp) } - return &HTTPResponse{RawResponse: resp.Response}, nil + return &HTTPPollerResponse{RawResponse: resp.Response}, nil } // postAsyncRetrycanceledHandleError handles the PostAsyncRetrycanceled error response. @@ -1601,7 +1584,7 @@ func (client *lrOSOperations) postAsyncRetrycanceledHandleError(resp *azcore.Res } // PostDoubleHeadersFinalAzureHeaderGet - Long running post request, service returns a 202 to the initial request with both Location and Azure-Async header. Poll Azure-Async and it's success. Should NOT poll Location to get the final object -func (client *lrOSOperations) BeginPostDoubleHeadersFinalAzureHeaderGet(ctx context.Context) (*ProductResponse, error) { +func (client *lrOSOperations) BeginPostDoubleHeadersFinalAzureHeaderGet(ctx context.Context) (*ProductPollerResponse, error) { req, err := client.postDoubleHeadersFinalAzureHeaderGetCreateRequest() if err != nil { return nil, err @@ -1653,12 +1636,11 @@ func (client *lrOSOperations) postDoubleHeadersFinalAzureHeaderGetCreateRequest( } // postDoubleHeadersFinalAzureHeaderGetHandleResponse handles the PostDoubleHeadersFinalAzureHeaderGet response. -func (client *lrOSOperations) postDoubleHeadersFinalAzureHeaderGetHandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lrOSOperations) postDoubleHeadersFinalAzureHeaderGetHandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.postDoubleHeadersFinalAzureHeaderGetHandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // postDoubleHeadersFinalAzureHeaderGetHandleError handles the PostDoubleHeadersFinalAzureHeaderGet error response. @@ -1671,7 +1653,7 @@ func (client *lrOSOperations) postDoubleHeadersFinalAzureHeaderGetHandleError(re } // PostDoubleHeadersFinalAzureHeaderGetDefault - Long running post request, service returns a 202 to the initial request with both Location and Azure-Async header. Poll Azure-Async and it's success. Should NOT poll Location to get the final object if you support initial Autorest behavior. -func (client *lrOSOperations) BeginPostDoubleHeadersFinalAzureHeaderGetDefault(ctx context.Context) (*ProductResponse, error) { +func (client *lrOSOperations) BeginPostDoubleHeadersFinalAzureHeaderGetDefault(ctx context.Context) (*ProductPollerResponse, error) { req, err := client.postDoubleHeadersFinalAzureHeaderGetDefaultCreateRequest() if err != nil { return nil, err @@ -1723,12 +1705,11 @@ func (client *lrOSOperations) postDoubleHeadersFinalAzureHeaderGetDefaultCreateR } // postDoubleHeadersFinalAzureHeaderGetDefaultHandleResponse handles the PostDoubleHeadersFinalAzureHeaderGetDefault response. -func (client *lrOSOperations) postDoubleHeadersFinalAzureHeaderGetDefaultHandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lrOSOperations) postDoubleHeadersFinalAzureHeaderGetDefaultHandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.postDoubleHeadersFinalAzureHeaderGetDefaultHandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // postDoubleHeadersFinalAzureHeaderGetDefaultHandleError handles the PostDoubleHeadersFinalAzureHeaderGetDefault error response. @@ -1741,7 +1722,7 @@ func (client *lrOSOperations) postDoubleHeadersFinalAzureHeaderGetDefaultHandleE } // PostDoubleHeadersFinalLocationGet - Long running post request, service returns a 202 to the initial request with both Location and Azure-Async header. Poll Azure-Async and it's success. Should poll Location to get the final object -func (client *lrOSOperations) BeginPostDoubleHeadersFinalLocationGet(ctx context.Context) (*ProductResponse, error) { +func (client *lrOSOperations) BeginPostDoubleHeadersFinalLocationGet(ctx context.Context) (*ProductPollerResponse, error) { req, err := client.postDoubleHeadersFinalLocationGetCreateRequest() if err != nil { return nil, err @@ -1793,12 +1774,11 @@ func (client *lrOSOperations) postDoubleHeadersFinalLocationGetCreateRequest() ( } // postDoubleHeadersFinalLocationGetHandleResponse handles the PostDoubleHeadersFinalLocationGet response. -func (client *lrOSOperations) postDoubleHeadersFinalLocationGetHandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lrOSOperations) postDoubleHeadersFinalLocationGetHandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.postDoubleHeadersFinalLocationGetHandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // postDoubleHeadersFinalLocationGetHandleError handles the PostDoubleHeadersFinalLocationGet error response. @@ -1811,7 +1791,7 @@ func (client *lrOSOperations) postDoubleHeadersFinalLocationGetHandleError(resp } // Put200Acceptedcanceled200 - Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’ -func (client *lrOSOperations) BeginPut200Acceptedcanceled200(ctx context.Context, lrOSPut200Acceptedcanceled200Options *LrOSPut200Acceptedcanceled200Options) (*ProductResponse, error) { +func (client *lrOSOperations) BeginPut200Acceptedcanceled200(ctx context.Context, lrOSPut200Acceptedcanceled200Options *LrOSPut200Acceptedcanceled200Options) (*ProductPollerResponse, error) { req, err := client.put200Acceptedcanceled200CreateRequest(lrOSPut200Acceptedcanceled200Options) if err != nil { return nil, err @@ -1866,12 +1846,11 @@ func (client *lrOSOperations) put200Acceptedcanceled200CreateRequest(lrOSPut200A } // put200Acceptedcanceled200HandleResponse handles the Put200Acceptedcanceled200 response. -func (client *lrOSOperations) put200Acceptedcanceled200HandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lrOSOperations) put200Acceptedcanceled200HandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusOK, http.StatusNoContent) { return nil, client.put200Acceptedcanceled200HandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // put200Acceptedcanceled200HandleError handles the Put200Acceptedcanceled200 error response. @@ -1884,7 +1863,7 @@ func (client *lrOSOperations) put200Acceptedcanceled200HandleError(resp *azcore. } // Put200Succeeded - Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. -func (client *lrOSOperations) BeginPut200Succeeded(ctx context.Context, lrOSPut200SucceededOptions *LrOSPut200SucceededOptions) (*ProductResponse, error) { +func (client *lrOSOperations) BeginPut200Succeeded(ctx context.Context, lrOSPut200SucceededOptions *LrOSPut200SucceededOptions) (*ProductPollerResponse, error) { req, err := client.put200SucceededCreateRequest(lrOSPut200SucceededOptions) if err != nil { return nil, err @@ -1939,12 +1918,11 @@ func (client *lrOSOperations) put200SucceededCreateRequest(lrOSPut200SucceededOp } // put200SucceededHandleResponse handles the Put200Succeeded response. -func (client *lrOSOperations) put200SucceededHandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lrOSOperations) put200SucceededHandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusOK, http.StatusNoContent) { return nil, client.put200SucceededHandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // put200SucceededHandleError handles the Put200Succeeded error response. @@ -1957,7 +1935,7 @@ func (client *lrOSOperations) put200SucceededHandleError(resp *azcore.Response) } // Put200SucceededNoState - Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. -func (client *lrOSOperations) BeginPut200SucceededNoState(ctx context.Context, lrOSPut200SucceededNoStateOptions *LrOSPut200SucceededNoStateOptions) (*ProductResponse, error) { +func (client *lrOSOperations) BeginPut200SucceededNoState(ctx context.Context, lrOSPut200SucceededNoStateOptions *LrOSPut200SucceededNoStateOptions) (*ProductPollerResponse, error) { req, err := client.put200SucceededNoStateCreateRequest(lrOSPut200SucceededNoStateOptions) if err != nil { return nil, err @@ -2012,12 +1990,11 @@ func (client *lrOSOperations) put200SucceededNoStateCreateRequest(lrOSPut200Succ } // put200SucceededNoStateHandleResponse handles the Put200SucceededNoState response. -func (client *lrOSOperations) put200SucceededNoStateHandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lrOSOperations) put200SucceededNoStateHandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusOK, http.StatusNoContent) { return nil, client.put200SucceededNoStateHandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // put200SucceededNoStateHandleError handles the Put200SucceededNoState error response. @@ -2030,7 +2007,7 @@ func (client *lrOSOperations) put200SucceededNoStateHandleError(resp *azcore.Res } // Put200UpdatingSucceeded204 - Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’ -func (client *lrOSOperations) BeginPut200UpdatingSucceeded204(ctx context.Context, lrOSPut200UpdatingSucceeded204Options *LrOSPut200UpdatingSucceeded204Options) (*ProductResponse, error) { +func (client *lrOSOperations) BeginPut200UpdatingSucceeded204(ctx context.Context, lrOSPut200UpdatingSucceeded204Options *LrOSPut200UpdatingSucceeded204Options) (*ProductPollerResponse, error) { req, err := client.put200UpdatingSucceeded204CreateRequest(lrOSPut200UpdatingSucceeded204Options) if err != nil { return nil, err @@ -2085,12 +2062,11 @@ func (client *lrOSOperations) put200UpdatingSucceeded204CreateRequest(lrOSPut200 } // put200UpdatingSucceeded204HandleResponse handles the Put200UpdatingSucceeded204 response. -func (client *lrOSOperations) put200UpdatingSucceeded204HandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lrOSOperations) put200UpdatingSucceeded204HandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusOK, http.StatusNoContent) { return nil, client.put200UpdatingSucceeded204HandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // put200UpdatingSucceeded204HandleError handles the Put200UpdatingSucceeded204 error response. @@ -2103,7 +2079,7 @@ func (client *lrOSOperations) put200UpdatingSucceeded204HandleError(resp *azcore } // Put201CreatingFailed200 - Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’ -func (client *lrOSOperations) BeginPut201CreatingFailed200(ctx context.Context, lrOSPut201CreatingFailed200Options *LrOSPut201CreatingFailed200Options) (*ProductResponse, error) { +func (client *lrOSOperations) BeginPut201CreatingFailed200(ctx context.Context, lrOSPut201CreatingFailed200Options *LrOSPut201CreatingFailed200Options) (*ProductPollerResponse, error) { req, err := client.put201CreatingFailed200CreateRequest(lrOSPut201CreatingFailed200Options) if err != nil { return nil, err @@ -2158,12 +2134,11 @@ func (client *lrOSOperations) put201CreatingFailed200CreateRequest(lrOSPut201Cre } // put201CreatingFailed200HandleResponse handles the Put201CreatingFailed200 response. -func (client *lrOSOperations) put201CreatingFailed200HandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lrOSOperations) put201CreatingFailed200HandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusOK, http.StatusCreated, http.StatusNoContent) { return nil, client.put201CreatingFailed200HandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // put201CreatingFailed200HandleError handles the Put201CreatingFailed200 error response. @@ -2176,7 +2151,7 @@ func (client *lrOSOperations) put201CreatingFailed200HandleError(resp *azcore.Re } // Put201CreatingSucceeded200 - Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’ -func (client *lrOSOperations) BeginPut201CreatingSucceeded200(ctx context.Context, lrOSPut201CreatingSucceeded200Options *LrOSPut201CreatingSucceeded200Options) (*ProductResponse, error) { +func (client *lrOSOperations) BeginPut201CreatingSucceeded200(ctx context.Context, lrOSPut201CreatingSucceeded200Options *LrOSPut201CreatingSucceeded200Options) (*ProductPollerResponse, error) { req, err := client.put201CreatingSucceeded200CreateRequest(lrOSPut201CreatingSucceeded200Options) if err != nil { return nil, err @@ -2231,12 +2206,11 @@ func (client *lrOSOperations) put201CreatingSucceeded200CreateRequest(lrOSPut201 } // put201CreatingSucceeded200HandleResponse handles the Put201CreatingSucceeded200 response. -func (client *lrOSOperations) put201CreatingSucceeded200HandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lrOSOperations) put201CreatingSucceeded200HandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusOK, http.StatusCreated, http.StatusNoContent) { return nil, client.put201CreatingSucceeded200HandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // put201CreatingSucceeded200HandleError handles the Put201CreatingSucceeded200 error response. @@ -2249,7 +2223,7 @@ func (client *lrOSOperations) put201CreatingSucceeded200HandleError(resp *azcore } // Put201Succeeded - Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. -func (client *lrOSOperations) BeginPut201Succeeded(ctx context.Context, lrOSPut201SucceededOptions *LrOSPut201SucceededOptions) (*ProductResponse, error) { +func (client *lrOSOperations) BeginPut201Succeeded(ctx context.Context, lrOSPut201SucceededOptions *LrOSPut201SucceededOptions) (*ProductPollerResponse, error) { req, err := client.put201SucceededCreateRequest(lrOSPut201SucceededOptions) if err != nil { return nil, err @@ -2304,12 +2278,11 @@ func (client *lrOSOperations) put201SucceededCreateRequest(lrOSPut201SucceededOp } // put201SucceededHandleResponse handles the Put201Succeeded response. -func (client *lrOSOperations) put201SucceededHandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lrOSOperations) put201SucceededHandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusCreated, http.StatusNoContent) { return nil, client.put201SucceededHandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // put201SucceededHandleError handles the Put201Succeeded error response. @@ -2322,7 +2295,7 @@ func (client *lrOSOperations) put201SucceededHandleError(resp *azcore.Response) } // Put202Retry200 - Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState -func (client *lrOSOperations) BeginPut202Retry200(ctx context.Context, lrOSPut202Retry200Options *LrOSPut202Retry200Options) (*ProductResponse, error) { +func (client *lrOSOperations) BeginPut202Retry200(ctx context.Context, lrOSPut202Retry200Options *LrOSPut202Retry200Options) (*ProductPollerResponse, error) { req, err := client.put202Retry200CreateRequest(lrOSPut202Retry200Options) if err != nil { return nil, err @@ -2377,12 +2350,11 @@ func (client *lrOSOperations) put202Retry200CreateRequest(lrOSPut202Retry200Opti } // put202Retry200HandleResponse handles the Put202Retry200 response. -func (client *lrOSOperations) put202Retry200HandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lrOSOperations) put202Retry200HandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.put202Retry200HandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // put202Retry200HandleError handles the Put202Retry200 error response. @@ -2395,7 +2367,7 @@ func (client *lrOSOperations) put202Retry200HandleError(resp *azcore.Response) e } // PutAsyncNoHeaderInRetry - Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. -func (client *lrOSOperations) BeginPutAsyncNoHeaderInRetry(ctx context.Context, lrOSPutAsyncNoHeaderInRetryOptions *LrOSPutAsyncNoHeaderInRetryOptions) (*ProductResponse, error) { +func (client *lrOSOperations) BeginPutAsyncNoHeaderInRetry(ctx context.Context, lrOSPutAsyncNoHeaderInRetryOptions *LrOSPutAsyncNoHeaderInRetryOptions) (*ProductPollerResponse, error) { req, err := client.putAsyncNoHeaderInRetryCreateRequest(lrOSPutAsyncNoHeaderInRetryOptions) if err != nil { return nil, err @@ -2450,12 +2422,11 @@ func (client *lrOSOperations) putAsyncNoHeaderInRetryCreateRequest(lrOSPutAsyncN } // putAsyncNoHeaderInRetryHandleResponse handles the PutAsyncNoHeaderInRetry response. -func (client *lrOSOperations) putAsyncNoHeaderInRetryHandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lrOSOperations) putAsyncNoHeaderInRetryHandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusCreated, http.StatusNoContent) { return nil, client.putAsyncNoHeaderInRetryHandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // putAsyncNoHeaderInRetryHandleError handles the PutAsyncNoHeaderInRetry error response. @@ -2468,7 +2439,7 @@ func (client *lrOSOperations) putAsyncNoHeaderInRetryHandleError(resp *azcore.Re } // PutAsyncNoRetrySucceeded - Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status -func (client *lrOSOperations) BeginPutAsyncNoRetrySucceeded(ctx context.Context, lrOSPutAsyncNoRetrySucceededOptions *LrOSPutAsyncNoRetrySucceededOptions) (*ProductResponse, error) { +func (client *lrOSOperations) BeginPutAsyncNoRetrySucceeded(ctx context.Context, lrOSPutAsyncNoRetrySucceededOptions *LrOSPutAsyncNoRetrySucceededOptions) (*ProductPollerResponse, error) { req, err := client.putAsyncNoRetrySucceededCreateRequest(lrOSPutAsyncNoRetrySucceededOptions) if err != nil { return nil, err @@ -2523,12 +2494,11 @@ func (client *lrOSOperations) putAsyncNoRetrySucceededCreateRequest(lrOSPutAsync } // putAsyncNoRetrySucceededHandleResponse handles the PutAsyncNoRetrySucceeded response. -func (client *lrOSOperations) putAsyncNoRetrySucceededHandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lrOSOperations) putAsyncNoRetrySucceededHandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusOK, http.StatusNoContent) { return nil, client.putAsyncNoRetrySucceededHandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // putAsyncNoRetrySucceededHandleError handles the PutAsyncNoRetrySucceeded error response. @@ -2541,7 +2511,7 @@ func (client *lrOSOperations) putAsyncNoRetrySucceededHandleError(resp *azcore.R } // PutAsyncNoRetrycanceled - Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status -func (client *lrOSOperations) BeginPutAsyncNoRetrycanceled(ctx context.Context, lrOSPutAsyncNoRetrycanceledOptions *LrOSPutAsyncNoRetrycanceledOptions) (*ProductResponse, error) { +func (client *lrOSOperations) BeginPutAsyncNoRetrycanceled(ctx context.Context, lrOSPutAsyncNoRetrycanceledOptions *LrOSPutAsyncNoRetrycanceledOptions) (*ProductPollerResponse, error) { req, err := client.putAsyncNoRetrycanceledCreateRequest(lrOSPutAsyncNoRetrycanceledOptions) if err != nil { return nil, err @@ -2596,12 +2566,11 @@ func (client *lrOSOperations) putAsyncNoRetrycanceledCreateRequest(lrOSPutAsyncN } // putAsyncNoRetrycanceledHandleResponse handles the PutAsyncNoRetrycanceled response. -func (client *lrOSOperations) putAsyncNoRetrycanceledHandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lrOSOperations) putAsyncNoRetrycanceledHandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusOK, http.StatusNoContent) { return nil, client.putAsyncNoRetrycanceledHandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // putAsyncNoRetrycanceledHandleError handles the PutAsyncNoRetrycanceled error response. @@ -2614,7 +2583,7 @@ func (client *lrOSOperations) putAsyncNoRetrycanceledHandleError(resp *azcore.Re } // PutAsyncNonResource - Long running put request with non resource. -func (client *lrOSOperations) BeginPutAsyncNonResource(ctx context.Context, lrOSPutAsyncNonResourceOptions *LrOSPutAsyncNonResourceOptions) (*SkuResponse, error) { +func (client *lrOSOperations) BeginPutAsyncNonResource(ctx context.Context, lrOSPutAsyncNonResourceOptions *LrOSPutAsyncNonResourceOptions) (*SkuPollerResponse, error) { req, err := client.putAsyncNonResourceCreateRequest(lrOSPutAsyncNonResourceOptions) if err != nil { return nil, err @@ -2669,12 +2638,11 @@ func (client *lrOSOperations) putAsyncNonResourceCreateRequest(lrOSPutAsyncNonRe } // putAsyncNonResourceHandleResponse handles the PutAsyncNonResource response. -func (client *lrOSOperations) putAsyncNonResourceHandleResponse(resp *azcore.Response) (*SkuResponse, error) { +func (client *lrOSOperations) putAsyncNonResourceHandleResponse(resp *azcore.Response) (*SkuPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.putAsyncNonResourceHandleError(resp) } - result := SkuResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Sku) + return &SkuPollerResponse{RawResponse: resp.Response}, nil } // putAsyncNonResourceHandleError handles the PutAsyncNonResource error response. @@ -2687,7 +2655,7 @@ func (client *lrOSOperations) putAsyncNonResourceHandleError(resp *azcore.Respon } // PutAsyncRetryFailed - Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status -func (client *lrOSOperations) BeginPutAsyncRetryFailed(ctx context.Context, lrOSPutAsyncRetryFailedOptions *LrOSPutAsyncRetryFailedOptions) (*ProductResponse, error) { +func (client *lrOSOperations) BeginPutAsyncRetryFailed(ctx context.Context, lrOSPutAsyncRetryFailedOptions *LrOSPutAsyncRetryFailedOptions) (*ProductPollerResponse, error) { req, err := client.putAsyncRetryFailedCreateRequest(lrOSPutAsyncRetryFailedOptions) if err != nil { return nil, err @@ -2742,12 +2710,11 @@ func (client *lrOSOperations) putAsyncRetryFailedCreateRequest(lrOSPutAsyncRetry } // putAsyncRetryFailedHandleResponse handles the PutAsyncRetryFailed response. -func (client *lrOSOperations) putAsyncRetryFailedHandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lrOSOperations) putAsyncRetryFailedHandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusOK, http.StatusNoContent) { return nil, client.putAsyncRetryFailedHandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // putAsyncRetryFailedHandleError handles the PutAsyncRetryFailed error response. @@ -2760,7 +2727,7 @@ func (client *lrOSOperations) putAsyncRetryFailedHandleError(resp *azcore.Respon } // PutAsyncRetrySucceeded - Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status -func (client *lrOSOperations) BeginPutAsyncRetrySucceeded(ctx context.Context, lrOSPutAsyncRetrySucceededOptions *LrOSPutAsyncRetrySucceededOptions) (*ProductResponse, error) { +func (client *lrOSOperations) BeginPutAsyncRetrySucceeded(ctx context.Context, lrOSPutAsyncRetrySucceededOptions *LrOSPutAsyncRetrySucceededOptions) (*ProductPollerResponse, error) { req, err := client.putAsyncRetrySucceededCreateRequest(lrOSPutAsyncRetrySucceededOptions) if err != nil { return nil, err @@ -2815,12 +2782,11 @@ func (client *lrOSOperations) putAsyncRetrySucceededCreateRequest(lrOSPutAsyncRe } // putAsyncRetrySucceededHandleResponse handles the PutAsyncRetrySucceeded response. -func (client *lrOSOperations) putAsyncRetrySucceededHandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lrOSOperations) putAsyncRetrySucceededHandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusOK, http.StatusNoContent) { return nil, client.putAsyncRetrySucceededHandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // putAsyncRetrySucceededHandleError handles the PutAsyncRetrySucceeded error response. @@ -2833,7 +2799,7 @@ func (client *lrOSOperations) putAsyncRetrySucceededHandleError(resp *azcore.Res } // PutAsyncSubResource - Long running put request with sub resource. -func (client *lrOSOperations) BeginPutAsyncSubResource(ctx context.Context, lrOSPutAsyncSubResourceOptions *LrOSPutAsyncSubResourceOptions) (*SubProductResponse, error) { +func (client *lrOSOperations) BeginPutAsyncSubResource(ctx context.Context, lrOSPutAsyncSubResourceOptions *LrOSPutAsyncSubResourceOptions) (*SubProductPollerResponse, error) { req, err := client.putAsyncSubResourceCreateRequest(lrOSPutAsyncSubResourceOptions) if err != nil { return nil, err @@ -2888,12 +2854,11 @@ func (client *lrOSOperations) putAsyncSubResourceCreateRequest(lrOSPutAsyncSubRe } // putAsyncSubResourceHandleResponse handles the PutAsyncSubResource response. -func (client *lrOSOperations) putAsyncSubResourceHandleResponse(resp *azcore.Response) (*SubProductResponse, error) { +func (client *lrOSOperations) putAsyncSubResourceHandleResponse(resp *azcore.Response) (*SubProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.putAsyncSubResourceHandleError(resp) } - result := SubProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.SubProduct) + return &SubProductPollerResponse{RawResponse: resp.Response}, nil } // putAsyncSubResourceHandleError handles the PutAsyncSubResource error response. @@ -2906,7 +2871,7 @@ func (client *lrOSOperations) putAsyncSubResourceHandleError(resp *azcore.Respon } // PutNoHeaderInRetry - Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. -func (client *lrOSOperations) BeginPutNoHeaderInRetry(ctx context.Context, lrOSPutNoHeaderInRetryOptions *LrOSPutNoHeaderInRetryOptions) (*ProductResponse, error) { +func (client *lrOSOperations) BeginPutNoHeaderInRetry(ctx context.Context, lrOSPutNoHeaderInRetryOptions *LrOSPutNoHeaderInRetryOptions) (*ProductPollerResponse, error) { req, err := client.putNoHeaderInRetryCreateRequest(lrOSPutNoHeaderInRetryOptions) if err != nil { return nil, err @@ -2961,12 +2926,11 @@ func (client *lrOSOperations) putNoHeaderInRetryCreateRequest(lrOSPutNoHeaderInR } // putNoHeaderInRetryHandleResponse handles the PutNoHeaderInRetry response. -func (client *lrOSOperations) putNoHeaderInRetryHandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lrOSOperations) putNoHeaderInRetryHandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.putNoHeaderInRetryHandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // putNoHeaderInRetryHandleError handles the PutNoHeaderInRetry error response. @@ -2979,7 +2943,7 @@ func (client *lrOSOperations) putNoHeaderInRetryHandleError(resp *azcore.Respons } // PutNonResource - Long running put request with non resource. -func (client *lrOSOperations) BeginPutNonResource(ctx context.Context, lrOSPutNonResourceOptions *LrOSPutNonResourceOptions) (*SkuResponse, error) { +func (client *lrOSOperations) BeginPutNonResource(ctx context.Context, lrOSPutNonResourceOptions *LrOSPutNonResourceOptions) (*SkuPollerResponse, error) { req, err := client.putNonResourceCreateRequest(lrOSPutNonResourceOptions) if err != nil { return nil, err @@ -3034,12 +2998,11 @@ func (client *lrOSOperations) putNonResourceCreateRequest(lrOSPutNonResourceOpti } // putNonResourceHandleResponse handles the PutNonResource response. -func (client *lrOSOperations) putNonResourceHandleResponse(resp *azcore.Response) (*SkuResponse, error) { +func (client *lrOSOperations) putNonResourceHandleResponse(resp *azcore.Response) (*SkuPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.putNonResourceHandleError(resp) } - result := SkuResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Sku) + return &SkuPollerResponse{RawResponse: resp.Response}, nil } // putNonResourceHandleError handles the PutNonResource error response. @@ -3052,7 +3015,7 @@ func (client *lrOSOperations) putNonResourceHandleError(resp *azcore.Response) e } // PutSubResource - Long running put request with sub resource. -func (client *lrOSOperations) BeginPutSubResource(ctx context.Context, lrOSPutSubResourceOptions *LrOSPutSubResourceOptions) (*SubProductResponse, error) { +func (client *lrOSOperations) BeginPutSubResource(ctx context.Context, lrOSPutSubResourceOptions *LrOSPutSubResourceOptions) (*SubProductPollerResponse, error) { req, err := client.putSubResourceCreateRequest(lrOSPutSubResourceOptions) if err != nil { return nil, err @@ -3107,12 +3070,11 @@ func (client *lrOSOperations) putSubResourceCreateRequest(lrOSPutSubResourceOpti } // putSubResourceHandleResponse handles the PutSubResource response. -func (client *lrOSOperations) putSubResourceHandleResponse(resp *azcore.Response) (*SubProductResponse, error) { +func (client *lrOSOperations) putSubResourceHandleResponse(resp *azcore.Response) (*SubProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.putSubResourceHandleError(resp) } - result := SubProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.SubProduct) + return &SubProductPollerResponse{RawResponse: resp.Response}, nil } // putSubResourceHandleError handles the PutSubResource error response. diff --git a/test/autorest/generated/lrogroup/lrosads.go b/test/autorest/generated/lrogroup/lrosads.go index d59b94222..159f4cb87 100644 --- a/test/autorest/generated/lrogroup/lrosads.go +++ b/test/autorest/generated/lrogroup/lrosads.go @@ -15,107 +15,107 @@ import ( // LrosaDsOperations contains the methods for the LrosaDs group. type LrosaDsOperations interface { // BeginDelete202NonRetry400 - Long running delete request, service returns a 202 with a location header - BeginDelete202NonRetry400(ctx context.Context) (*HTTPResponse, error) + BeginDelete202NonRetry400(ctx context.Context) (*HTTPPollerResponse, error) // ResumeDelete202NonRetry400 - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumeDelete202NonRetry400(token string) (HTTPPoller, error) // BeginDelete202RetryInvalidHeader - Long running delete request, service returns a 202 to the initial request receing a reponse with an invalid 'Location' and 'Retry-After' headers - BeginDelete202RetryInvalidHeader(ctx context.Context) (*HTTPResponse, error) + BeginDelete202RetryInvalidHeader(ctx context.Context) (*HTTPPollerResponse, error) // ResumeDelete202RetryInvalidHeader - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumeDelete202RetryInvalidHeader(token string) (HTTPPoller, error) // BeginDelete204Succeeded - Long running delete request, service returns a 204 to the initial request, indicating success. - BeginDelete204Succeeded(ctx context.Context) (*HTTPResponse, error) + BeginDelete204Succeeded(ctx context.Context) (*HTTPPollerResponse, error) // ResumeDelete204Succeeded - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumeDelete204Succeeded(token string) (HTTPPoller, error) // BeginDeleteAsyncRelativeRetry400 - Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status - BeginDeleteAsyncRelativeRetry400(ctx context.Context) (*HTTPResponse, error) + BeginDeleteAsyncRelativeRetry400(ctx context.Context) (*HTTPPollerResponse, error) // ResumeDeleteAsyncRelativeRetry400 - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumeDeleteAsyncRelativeRetry400(token string) (HTTPPoller, error) // BeginDeleteAsyncRelativeRetryInvalidHeader - Long running delete request, service returns a 202 to the initial request. The endpoint indicated in the Azure-AsyncOperation header is invalid - BeginDeleteAsyncRelativeRetryInvalidHeader(ctx context.Context) (*HTTPResponse, error) + BeginDeleteAsyncRelativeRetryInvalidHeader(ctx context.Context) (*HTTPPollerResponse, error) // ResumeDeleteAsyncRelativeRetryInvalidHeader - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumeDeleteAsyncRelativeRetryInvalidHeader(token string) (HTTPPoller, error) // BeginDeleteAsyncRelativeRetryInvalidJSONPolling - Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status - BeginDeleteAsyncRelativeRetryInvalidJSONPolling(ctx context.Context) (*HTTPResponse, error) + BeginDeleteAsyncRelativeRetryInvalidJSONPolling(ctx context.Context) (*HTTPPollerResponse, error) // ResumeDeleteAsyncRelativeRetryInvalidJSONPolling - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumeDeleteAsyncRelativeRetryInvalidJSONPolling(token string) (HTTPPoller, error) // BeginDeleteAsyncRelativeRetryNoStatus - Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status - BeginDeleteAsyncRelativeRetryNoStatus(ctx context.Context) (*HTTPResponse, error) + BeginDeleteAsyncRelativeRetryNoStatus(ctx context.Context) (*HTTPPollerResponse, error) // ResumeDeleteAsyncRelativeRetryNoStatus - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumeDeleteAsyncRelativeRetryNoStatus(token string) (HTTPPoller, error) // BeginDeleteNonRetry400 - Long running delete request, service returns a 400 with an error body - BeginDeleteNonRetry400(ctx context.Context) (*HTTPResponse, error) + BeginDeleteNonRetry400(ctx context.Context) (*HTTPPollerResponse, error) // ResumeDeleteNonRetry400 - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumeDeleteNonRetry400(token string) (HTTPPoller, error) // BeginPost202NoLocation - Long running post request, service returns a 202 to the initial request, without a location header. - BeginPost202NoLocation(ctx context.Context, lrosaDsPost202NoLocationOptions *LrosaDsPost202NoLocationOptions) (*HTTPResponse, error) + BeginPost202NoLocation(ctx context.Context, lrosaDsPost202NoLocationOptions *LrosaDsPost202NoLocationOptions) (*HTTPPollerResponse, error) // ResumePost202NoLocation - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePost202NoLocation(token string) (HTTPPoller, error) // BeginPost202NonRetry400 - Long running post request, service returns a 202 with a location header - BeginPost202NonRetry400(ctx context.Context, lrosaDsPost202NonRetry400Options *LrosaDsPost202NonRetry400Options) (*HTTPResponse, error) + BeginPost202NonRetry400(ctx context.Context, lrosaDsPost202NonRetry400Options *LrosaDsPost202NonRetry400Options) (*HTTPPollerResponse, error) // ResumePost202NonRetry400 - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePost202NonRetry400(token string) (HTTPPoller, error) // BeginPost202RetryInvalidHeader - Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. - BeginPost202RetryInvalidHeader(ctx context.Context, lrosaDsPost202RetryInvalidHeaderOptions *LrosaDsPost202RetryInvalidHeaderOptions) (*HTTPResponse, error) + BeginPost202RetryInvalidHeader(ctx context.Context, lrosaDsPost202RetryInvalidHeaderOptions *LrosaDsPost202RetryInvalidHeaderOptions) (*HTTPPollerResponse, error) // ResumePost202RetryInvalidHeader - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePost202RetryInvalidHeader(token string) (HTTPPoller, error) // BeginPostAsyncRelativeRetry400 - Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status - BeginPostAsyncRelativeRetry400(ctx context.Context, lrosaDsPostAsyncRelativeRetry400Options *LrosaDsPostAsyncRelativeRetry400Options) (*HTTPResponse, error) + BeginPostAsyncRelativeRetry400(ctx context.Context, lrosaDsPostAsyncRelativeRetry400Options *LrosaDsPostAsyncRelativeRetry400Options) (*HTTPPollerResponse, error) // ResumePostAsyncRelativeRetry400 - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePostAsyncRelativeRetry400(token string) (HTTPPoller, error) // BeginPostAsyncRelativeRetryInvalidHeader - Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. - BeginPostAsyncRelativeRetryInvalidHeader(ctx context.Context, lrosaDsPostAsyncRelativeRetryInvalidHeaderOptions *LrosaDsPostAsyncRelativeRetryInvalidHeaderOptions) (*HTTPResponse, error) + BeginPostAsyncRelativeRetryInvalidHeader(ctx context.Context, lrosaDsPostAsyncRelativeRetryInvalidHeaderOptions *LrosaDsPostAsyncRelativeRetryInvalidHeaderOptions) (*HTTPPollerResponse, error) // ResumePostAsyncRelativeRetryInvalidHeader - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePostAsyncRelativeRetryInvalidHeader(token string) (HTTPPoller, error) // BeginPostAsyncRelativeRetryInvalidJSONPolling - Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status - BeginPostAsyncRelativeRetryInvalidJSONPolling(ctx context.Context, lrosaDsPostAsyncRelativeRetryInvalidJsonPollingOptions *LrosaDsPostAsyncRelativeRetryInvalidJSONPollingOptions) (*HTTPResponse, error) + BeginPostAsyncRelativeRetryInvalidJSONPolling(ctx context.Context, lrosaDsPostAsyncRelativeRetryInvalidJsonPollingOptions *LrosaDsPostAsyncRelativeRetryInvalidJSONPollingOptions) (*HTTPPollerResponse, error) // ResumePostAsyncRelativeRetryInvalidJSONPolling - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePostAsyncRelativeRetryInvalidJSONPolling(token string) (HTTPPoller, error) // BeginPostAsyncRelativeRetryNoPayload - Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status - BeginPostAsyncRelativeRetryNoPayload(ctx context.Context, lrosaDsPostAsyncRelativeRetryNoPayloadOptions *LrosaDsPostAsyncRelativeRetryNoPayloadOptions) (*HTTPResponse, error) + BeginPostAsyncRelativeRetryNoPayload(ctx context.Context, lrosaDsPostAsyncRelativeRetryNoPayloadOptions *LrosaDsPostAsyncRelativeRetryNoPayloadOptions) (*HTTPPollerResponse, error) // ResumePostAsyncRelativeRetryNoPayload - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePostAsyncRelativeRetryNoPayload(token string) (HTTPPoller, error) // BeginPostNonRetry400 - Long running post request, service returns a 400 with no error body - BeginPostNonRetry400(ctx context.Context, lrosaDsPostNonRetry400Options *LrosaDsPostNonRetry400Options) (*HTTPResponse, error) + BeginPostNonRetry400(ctx context.Context, lrosaDsPostNonRetry400Options *LrosaDsPostNonRetry400Options) (*HTTPPollerResponse, error) // ResumePostNonRetry400 - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePostNonRetry400(token string) (HTTPPoller, error) // BeginPut200InvalidJSON - Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json - BeginPut200InvalidJSON(ctx context.Context, lrosaDsPut200InvalidJsonOptions *LrosaDsPut200InvalidJSONOptions) (*ProductResponse, error) + BeginPut200InvalidJSON(ctx context.Context, lrosaDsPut200InvalidJsonOptions *LrosaDsPut200InvalidJSONOptions) (*ProductPollerResponse, error) // ResumePut200InvalidJSON - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePut200InvalidJSON(token string) (ProductPoller, error) // BeginPutAsyncRelativeRetry400 - Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status - BeginPutAsyncRelativeRetry400(ctx context.Context, lrosaDsPutAsyncRelativeRetry400Options *LrosaDsPutAsyncRelativeRetry400Options) (*ProductResponse, error) + BeginPutAsyncRelativeRetry400(ctx context.Context, lrosaDsPutAsyncRelativeRetry400Options *LrosaDsPutAsyncRelativeRetry400Options) (*ProductPollerResponse, error) // ResumePutAsyncRelativeRetry400 - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePutAsyncRelativeRetry400(token string) (ProductPoller, error) // BeginPutAsyncRelativeRetryInvalidHeader - Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. - BeginPutAsyncRelativeRetryInvalidHeader(ctx context.Context, lrosaDsPutAsyncRelativeRetryInvalidHeaderOptions *LrosaDsPutAsyncRelativeRetryInvalidHeaderOptions) (*ProductResponse, error) + BeginPutAsyncRelativeRetryInvalidHeader(ctx context.Context, lrosaDsPutAsyncRelativeRetryInvalidHeaderOptions *LrosaDsPutAsyncRelativeRetryInvalidHeaderOptions) (*ProductPollerResponse, error) // ResumePutAsyncRelativeRetryInvalidHeader - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePutAsyncRelativeRetryInvalidHeader(token string) (ProductPoller, error) // BeginPutAsyncRelativeRetryInvalidJSONPolling - Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status - BeginPutAsyncRelativeRetryInvalidJSONPolling(ctx context.Context, lrosaDsPutAsyncRelativeRetryInvalidJsonPollingOptions *LrosaDsPutAsyncRelativeRetryInvalidJSONPollingOptions) (*ProductResponse, error) + BeginPutAsyncRelativeRetryInvalidJSONPolling(ctx context.Context, lrosaDsPutAsyncRelativeRetryInvalidJsonPollingOptions *LrosaDsPutAsyncRelativeRetryInvalidJSONPollingOptions) (*ProductPollerResponse, error) // ResumePutAsyncRelativeRetryInvalidJSONPolling - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePutAsyncRelativeRetryInvalidJSONPolling(token string) (ProductPoller, error) // BeginPutAsyncRelativeRetryNoStatus - Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status - BeginPutAsyncRelativeRetryNoStatus(ctx context.Context, lrosaDsPutAsyncRelativeRetryNoStatusOptions *LrosaDsPutAsyncRelativeRetryNoStatusOptions) (*ProductResponse, error) + BeginPutAsyncRelativeRetryNoStatus(ctx context.Context, lrosaDsPutAsyncRelativeRetryNoStatusOptions *LrosaDsPutAsyncRelativeRetryNoStatusOptions) (*ProductPollerResponse, error) // ResumePutAsyncRelativeRetryNoStatus - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePutAsyncRelativeRetryNoStatus(token string) (ProductPoller, error) // BeginPutAsyncRelativeRetryNoStatusPayload - Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status - BeginPutAsyncRelativeRetryNoStatusPayload(ctx context.Context, lrosaDsPutAsyncRelativeRetryNoStatusPayloadOptions *LrosaDsPutAsyncRelativeRetryNoStatusPayloadOptions) (*ProductResponse, error) + BeginPutAsyncRelativeRetryNoStatusPayload(ctx context.Context, lrosaDsPutAsyncRelativeRetryNoStatusPayloadOptions *LrosaDsPutAsyncRelativeRetryNoStatusPayloadOptions) (*ProductPollerResponse, error) // ResumePutAsyncRelativeRetryNoStatusPayload - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePutAsyncRelativeRetryNoStatusPayload(token string) (ProductPoller, error) // BeginPutError201NoProvisioningStatePayload - Long running put request, service returns a 201 to the initial request with no payload - BeginPutError201NoProvisioningStatePayload(ctx context.Context, lrosaDsPutError201NoProvisioningStatePayloadOptions *LrosaDsPutError201NoProvisioningStatePayloadOptions) (*ProductResponse, error) + BeginPutError201NoProvisioningStatePayload(ctx context.Context, lrosaDsPutError201NoProvisioningStatePayloadOptions *LrosaDsPutError201NoProvisioningStatePayloadOptions) (*ProductPollerResponse, error) // ResumePutError201NoProvisioningStatePayload - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePutError201NoProvisioningStatePayload(token string) (ProductPoller, error) // BeginPutNonRetry201Creating400 - Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code - BeginPutNonRetry201Creating400(ctx context.Context, lrosaDsPutNonRetry201Creating400Options *LrosaDsPutNonRetry201Creating400Options) (*ProductResponse, error) + BeginPutNonRetry201Creating400(ctx context.Context, lrosaDsPutNonRetry201Creating400Options *LrosaDsPutNonRetry201Creating400Options) (*ProductPollerResponse, error) // ResumePutNonRetry201Creating400 - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePutNonRetry201Creating400(token string) (ProductPoller, error) // BeginPutNonRetry201Creating400InvalidJSON - Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code - BeginPutNonRetry201Creating400InvalidJSON(ctx context.Context, lrosaDsPutNonRetry201Creating400InvalidJsonOptions *LrosaDsPutNonRetry201Creating400InvalidJSONOptions) (*ProductResponse, error) + BeginPutNonRetry201Creating400InvalidJSON(ctx context.Context, lrosaDsPutNonRetry201Creating400InvalidJsonOptions *LrosaDsPutNonRetry201Creating400InvalidJSONOptions) (*ProductPollerResponse, error) // ResumePutNonRetry201Creating400InvalidJSON - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePutNonRetry201Creating400InvalidJSON(token string) (ProductPoller, error) // BeginPutNonRetry400 - Long running put request, service returns a 400 to the initial request - BeginPutNonRetry400(ctx context.Context, lrosaDsPutNonRetry400Options *LrosaDsPutNonRetry400Options) (*ProductResponse, error) + BeginPutNonRetry400(ctx context.Context, lrosaDsPutNonRetry400Options *LrosaDsPutNonRetry400Options) (*ProductPollerResponse, error) // ResumePutNonRetry400 - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePutNonRetry400(token string) (ProductPoller, error) } @@ -126,7 +126,7 @@ type lrosaDsOperations struct { } // Delete202NonRetry400 - Long running delete request, service returns a 202 with a location header -func (client *lrosaDsOperations) BeginDelete202NonRetry400(ctx context.Context) (*HTTPResponse, error) { +func (client *lrosaDsOperations) BeginDelete202NonRetry400(ctx context.Context) (*HTTPPollerResponse, error) { req, err := client.delete202NonRetry400CreateRequest() if err != nil { return nil, err @@ -178,11 +178,11 @@ func (client *lrosaDsOperations) delete202NonRetry400CreateRequest() (*azcore.Re } // delete202NonRetry400HandleResponse handles the Delete202NonRetry400 response. -func (client *lrosaDsOperations) delete202NonRetry400HandleResponse(resp *azcore.Response) (*HTTPResponse, error) { +func (client *lrosaDsOperations) delete202NonRetry400HandleResponse(resp *azcore.Response) (*HTTPPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.delete202NonRetry400HandleError(resp) } - return &HTTPResponse{RawResponse: resp.Response}, nil + return &HTTPPollerResponse{RawResponse: resp.Response}, nil } // delete202NonRetry400HandleError handles the Delete202NonRetry400 error response. @@ -195,7 +195,7 @@ func (client *lrosaDsOperations) delete202NonRetry400HandleError(resp *azcore.Re } // Delete202RetryInvalidHeader - Long running delete request, service returns a 202 to the initial request receing a reponse with an invalid 'Location' and 'Retry-After' headers -func (client *lrosaDsOperations) BeginDelete202RetryInvalidHeader(ctx context.Context) (*HTTPResponse, error) { +func (client *lrosaDsOperations) BeginDelete202RetryInvalidHeader(ctx context.Context) (*HTTPPollerResponse, error) { req, err := client.delete202RetryInvalidHeaderCreateRequest() if err != nil { return nil, err @@ -247,11 +247,11 @@ func (client *lrosaDsOperations) delete202RetryInvalidHeaderCreateRequest() (*az } // delete202RetryInvalidHeaderHandleResponse handles the Delete202RetryInvalidHeader response. -func (client *lrosaDsOperations) delete202RetryInvalidHeaderHandleResponse(resp *azcore.Response) (*HTTPResponse, error) { +func (client *lrosaDsOperations) delete202RetryInvalidHeaderHandleResponse(resp *azcore.Response) (*HTTPPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.delete202RetryInvalidHeaderHandleError(resp) } - return &HTTPResponse{RawResponse: resp.Response}, nil + return &HTTPPollerResponse{RawResponse: resp.Response}, nil } // delete202RetryInvalidHeaderHandleError handles the Delete202RetryInvalidHeader error response. @@ -264,7 +264,7 @@ func (client *lrosaDsOperations) delete202RetryInvalidHeaderHandleError(resp *az } // Delete204Succeeded - Long running delete request, service returns a 204 to the initial request, indicating success. -func (client *lrosaDsOperations) BeginDelete204Succeeded(ctx context.Context) (*HTTPResponse, error) { +func (client *lrosaDsOperations) BeginDelete204Succeeded(ctx context.Context) (*HTTPPollerResponse, error) { req, err := client.delete204SucceededCreateRequest() if err != nil { return nil, err @@ -316,11 +316,11 @@ func (client *lrosaDsOperations) delete204SucceededCreateRequest() (*azcore.Requ } // delete204SucceededHandleResponse handles the Delete204Succeeded response. -func (client *lrosaDsOperations) delete204SucceededHandleResponse(resp *azcore.Response) (*HTTPResponse, error) { +func (client *lrosaDsOperations) delete204SucceededHandleResponse(resp *azcore.Response) (*HTTPPollerResponse, error) { if !resp.HasStatusCode(http.StatusNoContent) { return nil, client.delete204SucceededHandleError(resp) } - return &HTTPResponse{RawResponse: resp.Response}, nil + return &HTTPPollerResponse{RawResponse: resp.Response}, nil } // delete204SucceededHandleError handles the Delete204Succeeded error response. @@ -333,7 +333,7 @@ func (client *lrosaDsOperations) delete204SucceededHandleError(resp *azcore.Resp } // DeleteAsyncRelativeRetry400 - Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status -func (client *lrosaDsOperations) BeginDeleteAsyncRelativeRetry400(ctx context.Context) (*HTTPResponse, error) { +func (client *lrosaDsOperations) BeginDeleteAsyncRelativeRetry400(ctx context.Context) (*HTTPPollerResponse, error) { req, err := client.deleteAsyncRelativeRetry400CreateRequest() if err != nil { return nil, err @@ -385,11 +385,11 @@ func (client *lrosaDsOperations) deleteAsyncRelativeRetry400CreateRequest() (*az } // deleteAsyncRelativeRetry400HandleResponse handles the DeleteAsyncRelativeRetry400 response. -func (client *lrosaDsOperations) deleteAsyncRelativeRetry400HandleResponse(resp *azcore.Response) (*HTTPResponse, error) { +func (client *lrosaDsOperations) deleteAsyncRelativeRetry400HandleResponse(resp *azcore.Response) (*HTTPPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.deleteAsyncRelativeRetry400HandleError(resp) } - return &HTTPResponse{RawResponse: resp.Response}, nil + return &HTTPPollerResponse{RawResponse: resp.Response}, nil } // deleteAsyncRelativeRetry400HandleError handles the DeleteAsyncRelativeRetry400 error response. @@ -402,7 +402,7 @@ func (client *lrosaDsOperations) deleteAsyncRelativeRetry400HandleError(resp *az } // DeleteAsyncRelativeRetryInvalidHeader - Long running delete request, service returns a 202 to the initial request. The endpoint indicated in the Azure-AsyncOperation header is invalid -func (client *lrosaDsOperations) BeginDeleteAsyncRelativeRetryInvalidHeader(ctx context.Context) (*HTTPResponse, error) { +func (client *lrosaDsOperations) BeginDeleteAsyncRelativeRetryInvalidHeader(ctx context.Context) (*HTTPPollerResponse, error) { req, err := client.deleteAsyncRelativeRetryInvalidHeaderCreateRequest() if err != nil { return nil, err @@ -454,11 +454,11 @@ func (client *lrosaDsOperations) deleteAsyncRelativeRetryInvalidHeaderCreateRequ } // deleteAsyncRelativeRetryInvalidHeaderHandleResponse handles the DeleteAsyncRelativeRetryInvalidHeader response. -func (client *lrosaDsOperations) deleteAsyncRelativeRetryInvalidHeaderHandleResponse(resp *azcore.Response) (*HTTPResponse, error) { +func (client *lrosaDsOperations) deleteAsyncRelativeRetryInvalidHeaderHandleResponse(resp *azcore.Response) (*HTTPPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.deleteAsyncRelativeRetryInvalidHeaderHandleError(resp) } - return &HTTPResponse{RawResponse: resp.Response}, nil + return &HTTPPollerResponse{RawResponse: resp.Response}, nil } // deleteAsyncRelativeRetryInvalidHeaderHandleError handles the DeleteAsyncRelativeRetryInvalidHeader error response. @@ -471,7 +471,7 @@ func (client *lrosaDsOperations) deleteAsyncRelativeRetryInvalidHeaderHandleErro } // DeleteAsyncRelativeRetryInvalidJSONPolling - Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status -func (client *lrosaDsOperations) BeginDeleteAsyncRelativeRetryInvalidJSONPolling(ctx context.Context) (*HTTPResponse, error) { +func (client *lrosaDsOperations) BeginDeleteAsyncRelativeRetryInvalidJSONPolling(ctx context.Context) (*HTTPPollerResponse, error) { req, err := client.deleteAsyncRelativeRetryInvalidJsonPollingCreateRequest() if err != nil { return nil, err @@ -523,11 +523,11 @@ func (client *lrosaDsOperations) deleteAsyncRelativeRetryInvalidJsonPollingCreat } // deleteAsyncRelativeRetryInvalidJsonPollingHandleResponse handles the DeleteAsyncRelativeRetryInvalidJSONPolling response. -func (client *lrosaDsOperations) deleteAsyncRelativeRetryInvalidJsonPollingHandleResponse(resp *azcore.Response) (*HTTPResponse, error) { +func (client *lrosaDsOperations) deleteAsyncRelativeRetryInvalidJsonPollingHandleResponse(resp *azcore.Response) (*HTTPPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.deleteAsyncRelativeRetryInvalidJsonPollingHandleError(resp) } - return &HTTPResponse{RawResponse: resp.Response}, nil + return &HTTPPollerResponse{RawResponse: resp.Response}, nil } // deleteAsyncRelativeRetryInvalidJsonPollingHandleError handles the DeleteAsyncRelativeRetryInvalidJSONPolling error response. @@ -540,7 +540,7 @@ func (client *lrosaDsOperations) deleteAsyncRelativeRetryInvalidJsonPollingHandl } // DeleteAsyncRelativeRetryNoStatus - Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status -func (client *lrosaDsOperations) BeginDeleteAsyncRelativeRetryNoStatus(ctx context.Context) (*HTTPResponse, error) { +func (client *lrosaDsOperations) BeginDeleteAsyncRelativeRetryNoStatus(ctx context.Context) (*HTTPPollerResponse, error) { req, err := client.deleteAsyncRelativeRetryNoStatusCreateRequest() if err != nil { return nil, err @@ -592,11 +592,11 @@ func (client *lrosaDsOperations) deleteAsyncRelativeRetryNoStatusCreateRequest() } // deleteAsyncRelativeRetryNoStatusHandleResponse handles the DeleteAsyncRelativeRetryNoStatus response. -func (client *lrosaDsOperations) deleteAsyncRelativeRetryNoStatusHandleResponse(resp *azcore.Response) (*HTTPResponse, error) { +func (client *lrosaDsOperations) deleteAsyncRelativeRetryNoStatusHandleResponse(resp *azcore.Response) (*HTTPPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.deleteAsyncRelativeRetryNoStatusHandleError(resp) } - return &HTTPResponse{RawResponse: resp.Response}, nil + return &HTTPPollerResponse{RawResponse: resp.Response}, nil } // deleteAsyncRelativeRetryNoStatusHandleError handles the DeleteAsyncRelativeRetryNoStatus error response. @@ -609,7 +609,7 @@ func (client *lrosaDsOperations) deleteAsyncRelativeRetryNoStatusHandleError(res } // DeleteNonRetry400 - Long running delete request, service returns a 400 with an error body -func (client *lrosaDsOperations) BeginDeleteNonRetry400(ctx context.Context) (*HTTPResponse, error) { +func (client *lrosaDsOperations) BeginDeleteNonRetry400(ctx context.Context) (*HTTPPollerResponse, error) { req, err := client.deleteNonRetry400CreateRequest() if err != nil { return nil, err @@ -661,11 +661,11 @@ func (client *lrosaDsOperations) deleteNonRetry400CreateRequest() (*azcore.Reque } // deleteNonRetry400HandleResponse handles the DeleteNonRetry400 response. -func (client *lrosaDsOperations) deleteNonRetry400HandleResponse(resp *azcore.Response) (*HTTPResponse, error) { +func (client *lrosaDsOperations) deleteNonRetry400HandleResponse(resp *azcore.Response) (*HTTPPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.deleteNonRetry400HandleError(resp) } - return &HTTPResponse{RawResponse: resp.Response}, nil + return &HTTPPollerResponse{RawResponse: resp.Response}, nil } // deleteNonRetry400HandleError handles the DeleteNonRetry400 error response. @@ -678,7 +678,7 @@ func (client *lrosaDsOperations) deleteNonRetry400HandleError(resp *azcore.Respo } // Post202NoLocation - Long running post request, service returns a 202 to the initial request, without a location header. -func (client *lrosaDsOperations) BeginPost202NoLocation(ctx context.Context, lrosaDsPost202NoLocationOptions *LrosaDsPost202NoLocationOptions) (*HTTPResponse, error) { +func (client *lrosaDsOperations) BeginPost202NoLocation(ctx context.Context, lrosaDsPost202NoLocationOptions *LrosaDsPost202NoLocationOptions) (*HTTPPollerResponse, error) { req, err := client.post202NoLocationCreateRequest(lrosaDsPost202NoLocationOptions) if err != nil { return nil, err @@ -733,11 +733,11 @@ func (client *lrosaDsOperations) post202NoLocationCreateRequest(lrosaDsPost202No } // post202NoLocationHandleResponse handles the Post202NoLocation response. -func (client *lrosaDsOperations) post202NoLocationHandleResponse(resp *azcore.Response) (*HTTPResponse, error) { +func (client *lrosaDsOperations) post202NoLocationHandleResponse(resp *azcore.Response) (*HTTPPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.post202NoLocationHandleError(resp) } - return &HTTPResponse{RawResponse: resp.Response}, nil + return &HTTPPollerResponse{RawResponse: resp.Response}, nil } // post202NoLocationHandleError handles the Post202NoLocation error response. @@ -750,7 +750,7 @@ func (client *lrosaDsOperations) post202NoLocationHandleError(resp *azcore.Respo } // Post202NonRetry400 - Long running post request, service returns a 202 with a location header -func (client *lrosaDsOperations) BeginPost202NonRetry400(ctx context.Context, lrosaDsPost202NonRetry400Options *LrosaDsPost202NonRetry400Options) (*HTTPResponse, error) { +func (client *lrosaDsOperations) BeginPost202NonRetry400(ctx context.Context, lrosaDsPost202NonRetry400Options *LrosaDsPost202NonRetry400Options) (*HTTPPollerResponse, error) { req, err := client.post202NonRetry400CreateRequest(lrosaDsPost202NonRetry400Options) if err != nil { return nil, err @@ -805,11 +805,11 @@ func (client *lrosaDsOperations) post202NonRetry400CreateRequest(lrosaDsPost202N } // post202NonRetry400HandleResponse handles the Post202NonRetry400 response. -func (client *lrosaDsOperations) post202NonRetry400HandleResponse(resp *azcore.Response) (*HTTPResponse, error) { +func (client *lrosaDsOperations) post202NonRetry400HandleResponse(resp *azcore.Response) (*HTTPPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.post202NonRetry400HandleError(resp) } - return &HTTPResponse{RawResponse: resp.Response}, nil + return &HTTPPollerResponse{RawResponse: resp.Response}, nil } // post202NonRetry400HandleError handles the Post202NonRetry400 error response. @@ -822,7 +822,7 @@ func (client *lrosaDsOperations) post202NonRetry400HandleError(resp *azcore.Resp } // Post202RetryInvalidHeader - Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. -func (client *lrosaDsOperations) BeginPost202RetryInvalidHeader(ctx context.Context, lrosaDsPost202RetryInvalidHeaderOptions *LrosaDsPost202RetryInvalidHeaderOptions) (*HTTPResponse, error) { +func (client *lrosaDsOperations) BeginPost202RetryInvalidHeader(ctx context.Context, lrosaDsPost202RetryInvalidHeaderOptions *LrosaDsPost202RetryInvalidHeaderOptions) (*HTTPPollerResponse, error) { req, err := client.post202RetryInvalidHeaderCreateRequest(lrosaDsPost202RetryInvalidHeaderOptions) if err != nil { return nil, err @@ -877,11 +877,11 @@ func (client *lrosaDsOperations) post202RetryInvalidHeaderCreateRequest(lrosaDsP } // post202RetryInvalidHeaderHandleResponse handles the Post202RetryInvalidHeader response. -func (client *lrosaDsOperations) post202RetryInvalidHeaderHandleResponse(resp *azcore.Response) (*HTTPResponse, error) { +func (client *lrosaDsOperations) post202RetryInvalidHeaderHandleResponse(resp *azcore.Response) (*HTTPPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.post202RetryInvalidHeaderHandleError(resp) } - return &HTTPResponse{RawResponse: resp.Response}, nil + return &HTTPPollerResponse{RawResponse: resp.Response}, nil } // post202RetryInvalidHeaderHandleError handles the Post202RetryInvalidHeader error response. @@ -894,7 +894,7 @@ func (client *lrosaDsOperations) post202RetryInvalidHeaderHandleError(resp *azco } // PostAsyncRelativeRetry400 - Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status -func (client *lrosaDsOperations) BeginPostAsyncRelativeRetry400(ctx context.Context, lrosaDsPostAsyncRelativeRetry400Options *LrosaDsPostAsyncRelativeRetry400Options) (*HTTPResponse, error) { +func (client *lrosaDsOperations) BeginPostAsyncRelativeRetry400(ctx context.Context, lrosaDsPostAsyncRelativeRetry400Options *LrosaDsPostAsyncRelativeRetry400Options) (*HTTPPollerResponse, error) { req, err := client.postAsyncRelativeRetry400CreateRequest(lrosaDsPostAsyncRelativeRetry400Options) if err != nil { return nil, err @@ -949,11 +949,11 @@ func (client *lrosaDsOperations) postAsyncRelativeRetry400CreateRequest(lrosaDsP } // postAsyncRelativeRetry400HandleResponse handles the PostAsyncRelativeRetry400 response. -func (client *lrosaDsOperations) postAsyncRelativeRetry400HandleResponse(resp *azcore.Response) (*HTTPResponse, error) { +func (client *lrosaDsOperations) postAsyncRelativeRetry400HandleResponse(resp *azcore.Response) (*HTTPPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.postAsyncRelativeRetry400HandleError(resp) } - return &HTTPResponse{RawResponse: resp.Response}, nil + return &HTTPPollerResponse{RawResponse: resp.Response}, nil } // postAsyncRelativeRetry400HandleError handles the PostAsyncRelativeRetry400 error response. @@ -966,7 +966,7 @@ func (client *lrosaDsOperations) postAsyncRelativeRetry400HandleError(resp *azco } // PostAsyncRelativeRetryInvalidHeader - Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. -func (client *lrosaDsOperations) BeginPostAsyncRelativeRetryInvalidHeader(ctx context.Context, lrosaDsPostAsyncRelativeRetryInvalidHeaderOptions *LrosaDsPostAsyncRelativeRetryInvalidHeaderOptions) (*HTTPResponse, error) { +func (client *lrosaDsOperations) BeginPostAsyncRelativeRetryInvalidHeader(ctx context.Context, lrosaDsPostAsyncRelativeRetryInvalidHeaderOptions *LrosaDsPostAsyncRelativeRetryInvalidHeaderOptions) (*HTTPPollerResponse, error) { req, err := client.postAsyncRelativeRetryInvalidHeaderCreateRequest(lrosaDsPostAsyncRelativeRetryInvalidHeaderOptions) if err != nil { return nil, err @@ -1021,11 +1021,11 @@ func (client *lrosaDsOperations) postAsyncRelativeRetryInvalidHeaderCreateReques } // postAsyncRelativeRetryInvalidHeaderHandleResponse handles the PostAsyncRelativeRetryInvalidHeader response. -func (client *lrosaDsOperations) postAsyncRelativeRetryInvalidHeaderHandleResponse(resp *azcore.Response) (*HTTPResponse, error) { +func (client *lrosaDsOperations) postAsyncRelativeRetryInvalidHeaderHandleResponse(resp *azcore.Response) (*HTTPPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.postAsyncRelativeRetryInvalidHeaderHandleError(resp) } - return &HTTPResponse{RawResponse: resp.Response}, nil + return &HTTPPollerResponse{RawResponse: resp.Response}, nil } // postAsyncRelativeRetryInvalidHeaderHandleError handles the PostAsyncRelativeRetryInvalidHeader error response. @@ -1038,7 +1038,7 @@ func (client *lrosaDsOperations) postAsyncRelativeRetryInvalidHeaderHandleError( } // PostAsyncRelativeRetryInvalidJSONPolling - Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status -func (client *lrosaDsOperations) BeginPostAsyncRelativeRetryInvalidJSONPolling(ctx context.Context, lrosaDsPostAsyncRelativeRetryInvalidJsonPollingOptions *LrosaDsPostAsyncRelativeRetryInvalidJSONPollingOptions) (*HTTPResponse, error) { +func (client *lrosaDsOperations) BeginPostAsyncRelativeRetryInvalidJSONPolling(ctx context.Context, lrosaDsPostAsyncRelativeRetryInvalidJsonPollingOptions *LrosaDsPostAsyncRelativeRetryInvalidJSONPollingOptions) (*HTTPPollerResponse, error) { req, err := client.postAsyncRelativeRetryInvalidJsonPollingCreateRequest(lrosaDsPostAsyncRelativeRetryInvalidJsonPollingOptions) if err != nil { return nil, err @@ -1093,11 +1093,11 @@ func (client *lrosaDsOperations) postAsyncRelativeRetryInvalidJsonPollingCreateR } // postAsyncRelativeRetryInvalidJsonPollingHandleResponse handles the PostAsyncRelativeRetryInvalidJSONPolling response. -func (client *lrosaDsOperations) postAsyncRelativeRetryInvalidJsonPollingHandleResponse(resp *azcore.Response) (*HTTPResponse, error) { +func (client *lrosaDsOperations) postAsyncRelativeRetryInvalidJsonPollingHandleResponse(resp *azcore.Response) (*HTTPPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.postAsyncRelativeRetryInvalidJsonPollingHandleError(resp) } - return &HTTPResponse{RawResponse: resp.Response}, nil + return &HTTPPollerResponse{RawResponse: resp.Response}, nil } // postAsyncRelativeRetryInvalidJsonPollingHandleError handles the PostAsyncRelativeRetryInvalidJSONPolling error response. @@ -1110,7 +1110,7 @@ func (client *lrosaDsOperations) postAsyncRelativeRetryInvalidJsonPollingHandleE } // PostAsyncRelativeRetryNoPayload - Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status -func (client *lrosaDsOperations) BeginPostAsyncRelativeRetryNoPayload(ctx context.Context, lrosaDsPostAsyncRelativeRetryNoPayloadOptions *LrosaDsPostAsyncRelativeRetryNoPayloadOptions) (*HTTPResponse, error) { +func (client *lrosaDsOperations) BeginPostAsyncRelativeRetryNoPayload(ctx context.Context, lrosaDsPostAsyncRelativeRetryNoPayloadOptions *LrosaDsPostAsyncRelativeRetryNoPayloadOptions) (*HTTPPollerResponse, error) { req, err := client.postAsyncRelativeRetryNoPayloadCreateRequest(lrosaDsPostAsyncRelativeRetryNoPayloadOptions) if err != nil { return nil, err @@ -1165,11 +1165,11 @@ func (client *lrosaDsOperations) postAsyncRelativeRetryNoPayloadCreateRequest(lr } // postAsyncRelativeRetryNoPayloadHandleResponse handles the PostAsyncRelativeRetryNoPayload response. -func (client *lrosaDsOperations) postAsyncRelativeRetryNoPayloadHandleResponse(resp *azcore.Response) (*HTTPResponse, error) { +func (client *lrosaDsOperations) postAsyncRelativeRetryNoPayloadHandleResponse(resp *azcore.Response) (*HTTPPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.postAsyncRelativeRetryNoPayloadHandleError(resp) } - return &HTTPResponse{RawResponse: resp.Response}, nil + return &HTTPPollerResponse{RawResponse: resp.Response}, nil } // postAsyncRelativeRetryNoPayloadHandleError handles the PostAsyncRelativeRetryNoPayload error response. @@ -1182,7 +1182,7 @@ func (client *lrosaDsOperations) postAsyncRelativeRetryNoPayloadHandleError(resp } // PostNonRetry400 - Long running post request, service returns a 400 with no error body -func (client *lrosaDsOperations) BeginPostNonRetry400(ctx context.Context, lrosaDsPostNonRetry400Options *LrosaDsPostNonRetry400Options) (*HTTPResponse, error) { +func (client *lrosaDsOperations) BeginPostNonRetry400(ctx context.Context, lrosaDsPostNonRetry400Options *LrosaDsPostNonRetry400Options) (*HTTPPollerResponse, error) { req, err := client.postNonRetry400CreateRequest(lrosaDsPostNonRetry400Options) if err != nil { return nil, err @@ -1237,11 +1237,11 @@ func (client *lrosaDsOperations) postNonRetry400CreateRequest(lrosaDsPostNonRetr } // postNonRetry400HandleResponse handles the PostNonRetry400 response. -func (client *lrosaDsOperations) postNonRetry400HandleResponse(resp *azcore.Response) (*HTTPResponse, error) { +func (client *lrosaDsOperations) postNonRetry400HandleResponse(resp *azcore.Response) (*HTTPPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.postNonRetry400HandleError(resp) } - return &HTTPResponse{RawResponse: resp.Response}, nil + return &HTTPPollerResponse{RawResponse: resp.Response}, nil } // postNonRetry400HandleError handles the PostNonRetry400 error response. @@ -1254,7 +1254,7 @@ func (client *lrosaDsOperations) postNonRetry400HandleError(resp *azcore.Respons } // Put200InvalidJSON - Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json -func (client *lrosaDsOperations) BeginPut200InvalidJSON(ctx context.Context, lrosaDsPut200InvalidJsonOptions *LrosaDsPut200InvalidJSONOptions) (*ProductResponse, error) { +func (client *lrosaDsOperations) BeginPut200InvalidJSON(ctx context.Context, lrosaDsPut200InvalidJsonOptions *LrosaDsPut200InvalidJSONOptions) (*ProductPollerResponse, error) { req, err := client.put200InvalidJsonCreateRequest(lrosaDsPut200InvalidJsonOptions) if err != nil { return nil, err @@ -1309,12 +1309,11 @@ func (client *lrosaDsOperations) put200InvalidJsonCreateRequest(lrosaDsPut200Inv } // put200InvalidJsonHandleResponse handles the Put200InvalidJSON response. -func (client *lrosaDsOperations) put200InvalidJsonHandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lrosaDsOperations) put200InvalidJsonHandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusOK, http.StatusNoContent) { return nil, client.put200InvalidJsonHandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // put200InvalidJsonHandleError handles the Put200InvalidJSON error response. @@ -1327,7 +1326,7 @@ func (client *lrosaDsOperations) put200InvalidJsonHandleError(resp *azcore.Respo } // PutAsyncRelativeRetry400 - Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status -func (client *lrosaDsOperations) BeginPutAsyncRelativeRetry400(ctx context.Context, lrosaDsPutAsyncRelativeRetry400Options *LrosaDsPutAsyncRelativeRetry400Options) (*ProductResponse, error) { +func (client *lrosaDsOperations) BeginPutAsyncRelativeRetry400(ctx context.Context, lrosaDsPutAsyncRelativeRetry400Options *LrosaDsPutAsyncRelativeRetry400Options) (*ProductPollerResponse, error) { req, err := client.putAsyncRelativeRetry400CreateRequest(lrosaDsPutAsyncRelativeRetry400Options) if err != nil { return nil, err @@ -1382,12 +1381,11 @@ func (client *lrosaDsOperations) putAsyncRelativeRetry400CreateRequest(lrosaDsPu } // putAsyncRelativeRetry400HandleResponse handles the PutAsyncRelativeRetry400 response. -func (client *lrosaDsOperations) putAsyncRelativeRetry400HandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lrosaDsOperations) putAsyncRelativeRetry400HandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusOK, http.StatusNoContent) { return nil, client.putAsyncRelativeRetry400HandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // putAsyncRelativeRetry400HandleError handles the PutAsyncRelativeRetry400 error response. @@ -1400,7 +1398,7 @@ func (client *lrosaDsOperations) putAsyncRelativeRetry400HandleError(resp *azcor } // PutAsyncRelativeRetryInvalidHeader - Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. -func (client *lrosaDsOperations) BeginPutAsyncRelativeRetryInvalidHeader(ctx context.Context, lrosaDsPutAsyncRelativeRetryInvalidHeaderOptions *LrosaDsPutAsyncRelativeRetryInvalidHeaderOptions) (*ProductResponse, error) { +func (client *lrosaDsOperations) BeginPutAsyncRelativeRetryInvalidHeader(ctx context.Context, lrosaDsPutAsyncRelativeRetryInvalidHeaderOptions *LrosaDsPutAsyncRelativeRetryInvalidHeaderOptions) (*ProductPollerResponse, error) { req, err := client.putAsyncRelativeRetryInvalidHeaderCreateRequest(lrosaDsPutAsyncRelativeRetryInvalidHeaderOptions) if err != nil { return nil, err @@ -1455,12 +1453,11 @@ func (client *lrosaDsOperations) putAsyncRelativeRetryInvalidHeaderCreateRequest } // putAsyncRelativeRetryInvalidHeaderHandleResponse handles the PutAsyncRelativeRetryInvalidHeader response. -func (client *lrosaDsOperations) putAsyncRelativeRetryInvalidHeaderHandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lrosaDsOperations) putAsyncRelativeRetryInvalidHeaderHandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusOK, http.StatusNoContent) { return nil, client.putAsyncRelativeRetryInvalidHeaderHandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // putAsyncRelativeRetryInvalidHeaderHandleError handles the PutAsyncRelativeRetryInvalidHeader error response. @@ -1473,7 +1470,7 @@ func (client *lrosaDsOperations) putAsyncRelativeRetryInvalidHeaderHandleError(r } // PutAsyncRelativeRetryInvalidJSONPolling - Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status -func (client *lrosaDsOperations) BeginPutAsyncRelativeRetryInvalidJSONPolling(ctx context.Context, lrosaDsPutAsyncRelativeRetryInvalidJsonPollingOptions *LrosaDsPutAsyncRelativeRetryInvalidJSONPollingOptions) (*ProductResponse, error) { +func (client *lrosaDsOperations) BeginPutAsyncRelativeRetryInvalidJSONPolling(ctx context.Context, lrosaDsPutAsyncRelativeRetryInvalidJsonPollingOptions *LrosaDsPutAsyncRelativeRetryInvalidJSONPollingOptions) (*ProductPollerResponse, error) { req, err := client.putAsyncRelativeRetryInvalidJsonPollingCreateRequest(lrosaDsPutAsyncRelativeRetryInvalidJsonPollingOptions) if err != nil { return nil, err @@ -1528,12 +1525,11 @@ func (client *lrosaDsOperations) putAsyncRelativeRetryInvalidJsonPollingCreateRe } // putAsyncRelativeRetryInvalidJsonPollingHandleResponse handles the PutAsyncRelativeRetryInvalidJSONPolling response. -func (client *lrosaDsOperations) putAsyncRelativeRetryInvalidJsonPollingHandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lrosaDsOperations) putAsyncRelativeRetryInvalidJsonPollingHandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusOK, http.StatusNoContent) { return nil, client.putAsyncRelativeRetryInvalidJsonPollingHandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // putAsyncRelativeRetryInvalidJsonPollingHandleError handles the PutAsyncRelativeRetryInvalidJSONPolling error response. @@ -1546,7 +1542,7 @@ func (client *lrosaDsOperations) putAsyncRelativeRetryInvalidJsonPollingHandleEr } // PutAsyncRelativeRetryNoStatus - Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status -func (client *lrosaDsOperations) BeginPutAsyncRelativeRetryNoStatus(ctx context.Context, lrosaDsPutAsyncRelativeRetryNoStatusOptions *LrosaDsPutAsyncRelativeRetryNoStatusOptions) (*ProductResponse, error) { +func (client *lrosaDsOperations) BeginPutAsyncRelativeRetryNoStatus(ctx context.Context, lrosaDsPutAsyncRelativeRetryNoStatusOptions *LrosaDsPutAsyncRelativeRetryNoStatusOptions) (*ProductPollerResponse, error) { req, err := client.putAsyncRelativeRetryNoStatusCreateRequest(lrosaDsPutAsyncRelativeRetryNoStatusOptions) if err != nil { return nil, err @@ -1601,12 +1597,11 @@ func (client *lrosaDsOperations) putAsyncRelativeRetryNoStatusCreateRequest(lros } // putAsyncRelativeRetryNoStatusHandleResponse handles the PutAsyncRelativeRetryNoStatus response. -func (client *lrosaDsOperations) putAsyncRelativeRetryNoStatusHandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lrosaDsOperations) putAsyncRelativeRetryNoStatusHandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusOK, http.StatusNoContent) { return nil, client.putAsyncRelativeRetryNoStatusHandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // putAsyncRelativeRetryNoStatusHandleError handles the PutAsyncRelativeRetryNoStatus error response. @@ -1619,7 +1614,7 @@ func (client *lrosaDsOperations) putAsyncRelativeRetryNoStatusHandleError(resp * } // PutAsyncRelativeRetryNoStatusPayload - Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status -func (client *lrosaDsOperations) BeginPutAsyncRelativeRetryNoStatusPayload(ctx context.Context, lrosaDsPutAsyncRelativeRetryNoStatusPayloadOptions *LrosaDsPutAsyncRelativeRetryNoStatusPayloadOptions) (*ProductResponse, error) { +func (client *lrosaDsOperations) BeginPutAsyncRelativeRetryNoStatusPayload(ctx context.Context, lrosaDsPutAsyncRelativeRetryNoStatusPayloadOptions *LrosaDsPutAsyncRelativeRetryNoStatusPayloadOptions) (*ProductPollerResponse, error) { req, err := client.putAsyncRelativeRetryNoStatusPayloadCreateRequest(lrosaDsPutAsyncRelativeRetryNoStatusPayloadOptions) if err != nil { return nil, err @@ -1674,12 +1669,11 @@ func (client *lrosaDsOperations) putAsyncRelativeRetryNoStatusPayloadCreateReque } // putAsyncRelativeRetryNoStatusPayloadHandleResponse handles the PutAsyncRelativeRetryNoStatusPayload response. -func (client *lrosaDsOperations) putAsyncRelativeRetryNoStatusPayloadHandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lrosaDsOperations) putAsyncRelativeRetryNoStatusPayloadHandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusOK, http.StatusNoContent) { return nil, client.putAsyncRelativeRetryNoStatusPayloadHandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // putAsyncRelativeRetryNoStatusPayloadHandleError handles the PutAsyncRelativeRetryNoStatusPayload error response. @@ -1692,7 +1686,7 @@ func (client *lrosaDsOperations) putAsyncRelativeRetryNoStatusPayloadHandleError } // PutError201NoProvisioningStatePayload - Long running put request, service returns a 201 to the initial request with no payload -func (client *lrosaDsOperations) BeginPutError201NoProvisioningStatePayload(ctx context.Context, lrosaDsPutError201NoProvisioningStatePayloadOptions *LrosaDsPutError201NoProvisioningStatePayloadOptions) (*ProductResponse, error) { +func (client *lrosaDsOperations) BeginPutError201NoProvisioningStatePayload(ctx context.Context, lrosaDsPutError201NoProvisioningStatePayloadOptions *LrosaDsPutError201NoProvisioningStatePayloadOptions) (*ProductPollerResponse, error) { req, err := client.putError201NoProvisioningStatePayloadCreateRequest(lrosaDsPutError201NoProvisioningStatePayloadOptions) if err != nil { return nil, err @@ -1747,12 +1741,11 @@ func (client *lrosaDsOperations) putError201NoProvisioningStatePayloadCreateRequ } // putError201NoProvisioningStatePayloadHandleResponse handles the PutError201NoProvisioningStatePayload response. -func (client *lrosaDsOperations) putError201NoProvisioningStatePayloadHandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lrosaDsOperations) putError201NoProvisioningStatePayloadHandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusOK, http.StatusCreated, http.StatusNoContent) { return nil, client.putError201NoProvisioningStatePayloadHandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // putError201NoProvisioningStatePayloadHandleError handles the PutError201NoProvisioningStatePayload error response. @@ -1765,7 +1758,7 @@ func (client *lrosaDsOperations) putError201NoProvisioningStatePayloadHandleErro } // PutNonRetry201Creating400 - Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code -func (client *lrosaDsOperations) BeginPutNonRetry201Creating400(ctx context.Context, lrosaDsPutNonRetry201Creating400Options *LrosaDsPutNonRetry201Creating400Options) (*ProductResponse, error) { +func (client *lrosaDsOperations) BeginPutNonRetry201Creating400(ctx context.Context, lrosaDsPutNonRetry201Creating400Options *LrosaDsPutNonRetry201Creating400Options) (*ProductPollerResponse, error) { req, err := client.putNonRetry201Creating400CreateRequest(lrosaDsPutNonRetry201Creating400Options) if err != nil { return nil, err @@ -1820,12 +1813,11 @@ func (client *lrosaDsOperations) putNonRetry201Creating400CreateRequest(lrosaDsP } // putNonRetry201Creating400HandleResponse handles the PutNonRetry201Creating400 response. -func (client *lrosaDsOperations) putNonRetry201Creating400HandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lrosaDsOperations) putNonRetry201Creating400HandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusOK, http.StatusCreated, http.StatusNoContent) { return nil, client.putNonRetry201Creating400HandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // putNonRetry201Creating400HandleError handles the PutNonRetry201Creating400 error response. @@ -1838,7 +1830,7 @@ func (client *lrosaDsOperations) putNonRetry201Creating400HandleError(resp *azco } // PutNonRetry201Creating400InvalidJSON - Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code -func (client *lrosaDsOperations) BeginPutNonRetry201Creating400InvalidJSON(ctx context.Context, lrosaDsPutNonRetry201Creating400InvalidJsonOptions *LrosaDsPutNonRetry201Creating400InvalidJSONOptions) (*ProductResponse, error) { +func (client *lrosaDsOperations) BeginPutNonRetry201Creating400InvalidJSON(ctx context.Context, lrosaDsPutNonRetry201Creating400InvalidJsonOptions *LrosaDsPutNonRetry201Creating400InvalidJSONOptions) (*ProductPollerResponse, error) { req, err := client.putNonRetry201Creating400InvalidJsonCreateRequest(lrosaDsPutNonRetry201Creating400InvalidJsonOptions) if err != nil { return nil, err @@ -1893,12 +1885,11 @@ func (client *lrosaDsOperations) putNonRetry201Creating400InvalidJsonCreateReque } // putNonRetry201Creating400InvalidJsonHandleResponse handles the PutNonRetry201Creating400InvalidJSON response. -func (client *lrosaDsOperations) putNonRetry201Creating400InvalidJsonHandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lrosaDsOperations) putNonRetry201Creating400InvalidJsonHandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusOK, http.StatusCreated, http.StatusNoContent) { return nil, client.putNonRetry201Creating400InvalidJsonHandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // putNonRetry201Creating400InvalidJsonHandleError handles the PutNonRetry201Creating400InvalidJSON error response. @@ -1911,7 +1902,7 @@ func (client *lrosaDsOperations) putNonRetry201Creating400InvalidJsonHandleError } // PutNonRetry400 - Long running put request, service returns a 400 to the initial request -func (client *lrosaDsOperations) BeginPutNonRetry400(ctx context.Context, lrosaDsPutNonRetry400Options *LrosaDsPutNonRetry400Options) (*ProductResponse, error) { +func (client *lrosaDsOperations) BeginPutNonRetry400(ctx context.Context, lrosaDsPutNonRetry400Options *LrosaDsPutNonRetry400Options) (*ProductPollerResponse, error) { req, err := client.putNonRetry400CreateRequest(lrosaDsPutNonRetry400Options) if err != nil { return nil, err @@ -1966,12 +1957,11 @@ func (client *lrosaDsOperations) putNonRetry400CreateRequest(lrosaDsPutNonRetry4 } // putNonRetry400HandleResponse handles the PutNonRetry400 response. -func (client *lrosaDsOperations) putNonRetry400HandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lrosaDsOperations) putNonRetry400HandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusOK, http.StatusCreated, http.StatusNoContent) { return nil, client.putNonRetry400HandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // putNonRetry400HandleError handles the PutNonRetry400 error response. diff --git a/test/autorest/generated/lrogroup/lroscustomheader.go b/test/autorest/generated/lrogroup/lroscustomheader.go index e8cf18bdb..1960b129a 100644 --- a/test/autorest/generated/lrogroup/lroscustomheader.go +++ b/test/autorest/generated/lrogroup/lroscustomheader.go @@ -15,19 +15,19 @@ import ( // LrOSCustomHeaderOperations contains the methods for the LrOSCustomHeader group. type LrOSCustomHeaderOperations interface { // BeginPost202Retry200 - x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success - BeginPost202Retry200(ctx context.Context, lrOSCustomHeaderPost202Retry200Options *LrOSCustomHeaderPost202Retry200Options) (*HTTPResponse, error) + BeginPost202Retry200(ctx context.Context, lrOSCustomHeaderPost202Retry200Options *LrOSCustomHeaderPost202Retry200Options) (*HTTPPollerResponse, error) // ResumePost202Retry200 - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePost202Retry200(token string) (HTTPPoller, error) // BeginPostAsyncRetrySucceeded - x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status - BeginPostAsyncRetrySucceeded(ctx context.Context, lrOSCustomHeaderPostAsyncRetrySucceededOptions *LrOSCustomHeaderPostAsyncRetrySucceededOptions) (*HTTPResponse, error) + BeginPostAsyncRetrySucceeded(ctx context.Context, lrOSCustomHeaderPostAsyncRetrySucceededOptions *LrOSCustomHeaderPostAsyncRetrySucceededOptions) (*HTTPPollerResponse, error) // ResumePostAsyncRetrySucceeded - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePostAsyncRetrySucceeded(token string) (HTTPPoller, error) // BeginPut201CreatingSucceeded200 - x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’ - BeginPut201CreatingSucceeded200(ctx context.Context, lrOSCustomHeaderPut201CreatingSucceeded200Options *LrOSCustomHeaderPut201CreatingSucceeded200Options) (*ProductResponse, error) + BeginPut201CreatingSucceeded200(ctx context.Context, lrOSCustomHeaderPut201CreatingSucceeded200Options *LrOSCustomHeaderPut201CreatingSucceeded200Options) (*ProductPollerResponse, error) // ResumePut201CreatingSucceeded200 - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePut201CreatingSucceeded200(token string) (ProductPoller, error) // BeginPutAsyncRetrySucceeded - x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status - BeginPutAsyncRetrySucceeded(ctx context.Context, lrOSCustomHeaderPutAsyncRetrySucceededOptions *LrOSCustomHeaderPutAsyncRetrySucceededOptions) (*ProductResponse, error) + BeginPutAsyncRetrySucceeded(ctx context.Context, lrOSCustomHeaderPutAsyncRetrySucceededOptions *LrOSCustomHeaderPutAsyncRetrySucceededOptions) (*ProductPollerResponse, error) // ResumePutAsyncRetrySucceeded - Used to create a new instance of this poller from the resume token of a previous instance of this poller type. ResumePutAsyncRetrySucceeded(token string) (ProductPoller, error) } @@ -38,7 +38,7 @@ type lrOSCustomHeaderOperations struct { } // Post202Retry200 - x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success -func (client *lrOSCustomHeaderOperations) BeginPost202Retry200(ctx context.Context, lrOSCustomHeaderPost202Retry200Options *LrOSCustomHeaderPost202Retry200Options) (*HTTPResponse, error) { +func (client *lrOSCustomHeaderOperations) BeginPost202Retry200(ctx context.Context, lrOSCustomHeaderPost202Retry200Options *LrOSCustomHeaderPost202Retry200Options) (*HTTPPollerResponse, error) { req, err := client.post202Retry200CreateRequest(lrOSCustomHeaderPost202Retry200Options) if err != nil { return nil, err @@ -93,11 +93,11 @@ func (client *lrOSCustomHeaderOperations) post202Retry200CreateRequest(lrOSCusto } // post202Retry200HandleResponse handles the Post202Retry200 response. -func (client *lrOSCustomHeaderOperations) post202Retry200HandleResponse(resp *azcore.Response) (*HTTPResponse, error) { +func (client *lrOSCustomHeaderOperations) post202Retry200HandleResponse(resp *azcore.Response) (*HTTPPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.post202Retry200HandleError(resp) } - return &HTTPResponse{RawResponse: resp.Response}, nil + return &HTTPPollerResponse{RawResponse: resp.Response}, nil } // post202Retry200HandleError handles the Post202Retry200 error response. @@ -110,7 +110,7 @@ func (client *lrOSCustomHeaderOperations) post202Retry200HandleError(resp *azcor } // PostAsyncRetrySucceeded - x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status -func (client *lrOSCustomHeaderOperations) BeginPostAsyncRetrySucceeded(ctx context.Context, lrOSCustomHeaderPostAsyncRetrySucceededOptions *LrOSCustomHeaderPostAsyncRetrySucceededOptions) (*HTTPResponse, error) { +func (client *lrOSCustomHeaderOperations) BeginPostAsyncRetrySucceeded(ctx context.Context, lrOSCustomHeaderPostAsyncRetrySucceededOptions *LrOSCustomHeaderPostAsyncRetrySucceededOptions) (*HTTPPollerResponse, error) { req, err := client.postAsyncRetrySucceededCreateRequest(lrOSCustomHeaderPostAsyncRetrySucceededOptions) if err != nil { return nil, err @@ -165,11 +165,11 @@ func (client *lrOSCustomHeaderOperations) postAsyncRetrySucceededCreateRequest(l } // postAsyncRetrySucceededHandleResponse handles the PostAsyncRetrySucceeded response. -func (client *lrOSCustomHeaderOperations) postAsyncRetrySucceededHandleResponse(resp *azcore.Response) (*HTTPResponse, error) { +func (client *lrOSCustomHeaderOperations) postAsyncRetrySucceededHandleResponse(resp *azcore.Response) (*HTTPPollerResponse, error) { if !resp.HasStatusCode(http.StatusAccepted, http.StatusNoContent) { return nil, client.postAsyncRetrySucceededHandleError(resp) } - return &HTTPResponse{RawResponse: resp.Response}, nil + return &HTTPPollerResponse{RawResponse: resp.Response}, nil } // postAsyncRetrySucceededHandleError handles the PostAsyncRetrySucceeded error response. @@ -182,7 +182,7 @@ func (client *lrOSCustomHeaderOperations) postAsyncRetrySucceededHandleError(res } // Put201CreatingSucceeded200 - x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’ -func (client *lrOSCustomHeaderOperations) BeginPut201CreatingSucceeded200(ctx context.Context, lrOSCustomHeaderPut201CreatingSucceeded200Options *LrOSCustomHeaderPut201CreatingSucceeded200Options) (*ProductResponse, error) { +func (client *lrOSCustomHeaderOperations) BeginPut201CreatingSucceeded200(ctx context.Context, lrOSCustomHeaderPut201CreatingSucceeded200Options *LrOSCustomHeaderPut201CreatingSucceeded200Options) (*ProductPollerResponse, error) { req, err := client.put201CreatingSucceeded200CreateRequest(lrOSCustomHeaderPut201CreatingSucceeded200Options) if err != nil { return nil, err @@ -237,12 +237,11 @@ func (client *lrOSCustomHeaderOperations) put201CreatingSucceeded200CreateReques } // put201CreatingSucceeded200HandleResponse handles the Put201CreatingSucceeded200 response. -func (client *lrOSCustomHeaderOperations) put201CreatingSucceeded200HandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lrOSCustomHeaderOperations) put201CreatingSucceeded200HandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusOK, http.StatusCreated, http.StatusNoContent) { return nil, client.put201CreatingSucceeded200HandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // put201CreatingSucceeded200HandleError handles the Put201CreatingSucceeded200 error response. @@ -255,7 +254,7 @@ func (client *lrOSCustomHeaderOperations) put201CreatingSucceeded200HandleError( } // PutAsyncRetrySucceeded - x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status -func (client *lrOSCustomHeaderOperations) BeginPutAsyncRetrySucceeded(ctx context.Context, lrOSCustomHeaderPutAsyncRetrySucceededOptions *LrOSCustomHeaderPutAsyncRetrySucceededOptions) (*ProductResponse, error) { +func (client *lrOSCustomHeaderOperations) BeginPutAsyncRetrySucceeded(ctx context.Context, lrOSCustomHeaderPutAsyncRetrySucceededOptions *LrOSCustomHeaderPutAsyncRetrySucceededOptions) (*ProductPollerResponse, error) { req, err := client.putAsyncRetrySucceededCreateRequest(lrOSCustomHeaderPutAsyncRetrySucceededOptions) if err != nil { return nil, err @@ -310,12 +309,11 @@ func (client *lrOSCustomHeaderOperations) putAsyncRetrySucceededCreateRequest(lr } // putAsyncRetrySucceededHandleResponse handles the PutAsyncRetrySucceeded response. -func (client *lrOSCustomHeaderOperations) putAsyncRetrySucceededHandleResponse(resp *azcore.Response) (*ProductResponse, error) { +func (client *lrOSCustomHeaderOperations) putAsyncRetrySucceededHandleResponse(resp *azcore.Response) (*ProductPollerResponse, error) { if !resp.HasStatusCode(http.StatusOK, http.StatusNoContent) { return nil, client.putAsyncRetrySucceededHandleError(resp) } - result := ProductResponse{RawResponse: resp.Response} - return &result, resp.UnmarshalAsJSON(&result.Product) + return &ProductPollerResponse{RawResponse: resp.Response}, nil } // putAsyncRetrySucceededHandleError handles the PutAsyncRetrySucceeded error response. diff --git a/test/autorest/generated/lrogroup/models.go b/test/autorest/generated/lrogroup/models.go index df6adf599..fd3fcaa63 100644 --- a/test/autorest/generated/lrogroup/models.go +++ b/test/autorest/generated/lrogroup/models.go @@ -31,12 +31,12 @@ func (e CloudError) Error() string { return msg } -// HTTPResponse contains the HTTP response from the call to the service endpoint -type HTTPResponse struct { +// HTTPPollerResponse contains the asynchronous HTTP response from the call to the service endpoint. +type HTTPPollerResponse struct { // PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received PollUntilDone func(ctx context.Context, frequency time.Duration) (*http.Response, error) - // Poller contains an initialized poller + // Poller contains an initialized poller. Poller HTTPPoller // RawResponse contains the underlying HTTP response. @@ -378,20 +378,20 @@ type Product struct { Properties *ProductProperties `json:"properties,omitempty"` } -// ProductArrayResponse is the response envelope for operations that return a []Product type. -type ProductArrayResponse struct { - // AzureAsyncOperation contains the information returned from the Azure-AsyncOperation header response. - AzureAsyncOperation *string - - // Location contains the information returned from the Location header response. - Location *string - +// ProductArrayPollerResponse is the response envelope for operations that asynchronously return a []Product type. +type ProductArrayPollerResponse struct { // PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received PollUntilDone func(ctx context.Context, frequency time.Duration) (*ProductArrayResponse, error) - // Poller contains an initialized poller + // Poller contains an initialized poller. Poller ProductArrayPoller + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// ProductArrayResponse is the response envelope for operations that return a []Product type. +type ProductArrayResponse struct { // Array of Product ProductArray *[]Product @@ -399,6 +399,18 @@ type ProductArrayResponse struct { RawResponse *http.Response } +// ProductPollerResponse is the response envelope for operations that asynchronously return a Product type. +type ProductPollerResponse struct { + // PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received + PollUntilDone func(ctx context.Context, frequency time.Duration) (*ProductResponse, error) + + // Poller contains an initialized poller. + Poller ProductPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + type ProductProperties struct { ProvisioningState *string `json:"provisioningState,omitempty"` ProvisioningStateValues *ProductPropertiesProvisioningStateValues `json:"provisioningStateValues,omitempty"` @@ -406,11 +418,6 @@ type ProductProperties struct { // ProductResponse is the response envelope for operations that return a Product type. type ProductResponse struct { - // PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received - PollUntilDone func(ctx context.Context, frequency time.Duration) (*ProductResponse, error) - - // Poller contains an initialized poller - Poller ProductPoller Product *Product // RawResponse contains the underlying HTTP response. @@ -439,16 +446,22 @@ type Sku struct { Name *string `json:"name,omitempty"` } -// SkuResponse is the response envelope for operations that return a Sku type. -type SkuResponse struct { +// SkuPollerResponse is the response envelope for operations that asynchronously return a Sku type. +type SkuPollerResponse struct { // PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received PollUntilDone func(ctx context.Context, frequency time.Duration) (*SkuResponse, error) - // Poller contains an initialized poller + // Poller contains an initialized poller. Poller SkuPoller // RawResponse contains the underlying HTTP response. RawResponse *http.Response +} + +// SkuResponse is the response envelope for operations that return a Sku type. +type SkuResponse struct { + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response Sku *Sku } @@ -457,6 +470,18 @@ type SubProduct struct { Properties *SubProductProperties `json:"properties,omitempty"` } +// SubProductPollerResponse is the response envelope for operations that asynchronously return a SubProduct type. +type SubProductPollerResponse struct { + // PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received + PollUntilDone func(ctx context.Context, frequency time.Duration) (*SubProductResponse, error) + + // Poller contains an initialized poller. + Poller SubProductPoller + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + type SubProductProperties struct { ProvisioningState *string `json:"provisioningState,omitempty"` ProvisioningStateValues *SubProductPropertiesProvisioningStateValues `json:"provisioningStateValues,omitempty"` @@ -464,12 +489,6 @@ type SubProductProperties struct { // SubProductResponse is the response envelope for operations that return a SubProduct type. type SubProductResponse struct { - // PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received - PollUntilDone func(ctx context.Context, frequency time.Duration) (*SubProductResponse, error) - - // Poller contains an initialized poller - Poller SubProductPoller - // RawResponse contains the underlying HTTP response. RawResponse *http.Response SubProduct *SubProduct diff --git a/test/autorest/generated/paginggroup/models.go b/test/autorest/generated/paginggroup/models.go index fbdcce9d8..10a8b3cf3 100644 --- a/test/autorest/generated/paginggroup/models.go +++ b/test/autorest/generated/paginggroup/models.go @@ -5,11 +5,7 @@ package paginggroup -import ( - "context" - "net/http" - "time" -) +import "net/http" // CustomParameterGroup contains a group of parameters for the Paging.GetMultiplePagesFragmentWithGroupingNextLink method. type CustomParameterGroup struct { @@ -91,11 +87,6 @@ type ProductResult struct { // ProductResultResponse is the response envelope for operations that return a ProductResult type. type ProductResultResponse struct { - // PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received - PollUntilDone func(ctx context.Context, frequency time.Duration) (*ProductResultResponse, error) - - // Poller contains an initialized poller - Poller ProductResultPoller ProductResult *ProductResult // RawResponse contains the underlying HTTP response. diff --git a/test/autorest/generated/paginggroup/paging.go b/test/autorest/generated/paginggroup/paging.go index 07b3b8765..9cb5f745e 100644 --- a/test/autorest/generated/paginggroup/paging.go +++ b/test/autorest/generated/paginggroup/paging.go @@ -30,7 +30,7 @@ type PagingOperations interface { // GetMultiplePagesFragmentWithGroupingNextLink - A paging operation that doesn't return a full URL, just a fragment with parameters grouped GetMultiplePagesFragmentWithGroupingNextLink(customParameterGroup CustomParameterGroup) (OdataProductResultPager, error) // BeginGetMultiplePagesLro - A long-running paging operation that includes a nextLink that has 10 pages - BeginGetMultiplePagesLro(pagingGetMultiplePagesLroOptions *PagingGetMultiplePagesLroOptions) (ProductResultPager, error) + BeginGetMultiplePagesLro(pagingGetMultiplePagesLroOptions *PagingGetMultiplePagesLroOptions) (*ProductResultResponse, error) // GetMultiplePagesRetryFirst - A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages GetMultiplePagesRetryFirst() (ProductResultPager, error) // GetMultiplePagesRetrySecond - A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. @@ -337,7 +337,7 @@ func (client *pagingOperations) getMultiplePagesFragmentWithGroupingNextLinkHand } // GetMultiplePagesLro - A long-running paging operation that includes a nextLink that has 10 pages -func (client *pagingOperations) BeginGetMultiplePagesLro(pagingGetMultiplePagesLroOptions *PagingGetMultiplePagesLroOptions) (ProductResultPager, error) { +func (client *pagingOperations) BeginGetMultiplePagesLro(pagingGetMultiplePagesLroOptions *PagingGetMultiplePagesLroOptions) (*ProductResultResponse, error) { return nil, nil } diff --git a/test/autorest/lrogroup/lros_test.go b/test/autorest/lrogroup/lros_test.go index 6287148e5..f2dcc2771 100644 --- a/test/autorest/lrogroup/lros_test.go +++ b/test/autorest/lrogroup/lros_test.go @@ -75,11 +75,11 @@ func TestLROBeginDelete202NoRetry204(t *testing.T) { if err != nil { t.Fatal(err) } - resp, err = resp.PollUntilDone(context.Background(), 1*time.Millisecond) + prodResp, err := resp.PollUntilDone(context.Background(), 1*time.Millisecond) if err != nil { t.Fatal(err) } - helpers.VerifyStatusCode(t, resp.RawResponse, 204) + helpers.VerifyStatusCode(t, prodResp.RawResponse, 204) } func TestLROBeginDelete202Retry200(t *testing.T) { @@ -97,11 +97,11 @@ func TestLROBeginDelete202Retry200(t *testing.T) { if err != nil { t.Fatal(err) } - resp, err = resp.PollUntilDone(context.Background(), 1*time.Millisecond) + prodResp, err := resp.PollUntilDone(context.Background(), 1*time.Millisecond) if err != nil { t.Fatal(err) } - helpers.VerifyStatusCode(t, resp.RawResponse, 200) + helpers.VerifyStatusCode(t, prodResp.RawResponse, 200) } func TestLROBeginDelete204Succeeded(t *testing.T) { @@ -281,11 +281,11 @@ func TestLROBeginDeleteProvisioning202Accepted200Succeeded(t *testing.T) { if err != nil { t.Fatal(err) } - resp, err = resp.PollUntilDone(context.Background(), 1*time.Millisecond) + prodResp, err := resp.PollUntilDone(context.Background(), 1*time.Millisecond) if err != nil { t.Fatal(err) } - helpers.VerifyStatusCode(t, resp.RawResponse, 200) + helpers.VerifyStatusCode(t, prodResp.RawResponse, 200) } func TestLROBeginDeleteProvisioning202DeletingFailed200(t *testing.T) { @@ -303,7 +303,7 @@ func TestLROBeginDeleteProvisioning202DeletingFailed200(t *testing.T) { if err != nil { t.Fatal(err) } - resp, err = resp.PollUntilDone(context.Background(), 1*time.Millisecond) + _, err = resp.PollUntilDone(context.Background(), 1*time.Millisecond) if err == nil { t.Fatal("expected an error but did not receive one") } @@ -324,7 +324,7 @@ func TestLROBeginDeleteProvisioning202Deletingcanceled200(t *testing.T) { if err != nil { t.Fatal(err) } - resp, err = resp.PollUntilDone(context.Background(), 1*time.Millisecond) + _, err = resp.PollUntilDone(context.Background(), 1*time.Millisecond) if err == nil { t.Fatal("expected an error but did not receive one") } @@ -345,12 +345,12 @@ func TestLROBeginPost200WithPayload(t *testing.T) { if err != nil { t.Fatal(err) } - resp, err = resp.PollUntilDone(context.Background(), 1*time.Millisecond) + skuResp, err := resp.PollUntilDone(context.Background(), 1*time.Millisecond) if err != nil { t.Fatal(err) } - helpers.VerifyStatusCode(t, resp.RawResponse, 200) - helpers.DeepEqualOrFatal(t, resp.Sku, &lrogroup.Sku{ + helpers.VerifyStatusCode(t, skuResp.RawResponse, 200) + helpers.DeepEqualOrFatal(t, skuResp.Sku, &lrogroup.Sku{ ID: to.StringPtr("1"), Name: to.StringPtr("product"), }) @@ -371,12 +371,12 @@ func TestLROBeginPost202List(t *testing.T) { if err != nil { t.Fatal(err) } - resp, err = resp.PollUntilDone(context.Background(), 1*time.Millisecond) + prodArrayResp, err := resp.PollUntilDone(context.Background(), 1*time.Millisecond) if err != nil { t.Fatal(err) } - helpers.VerifyStatusCode(t, resp.RawResponse, 200) - helpers.DeepEqualOrFatal(t, resp.ProductArray, &[]lrogroup.Product{ + helpers.VerifyStatusCode(t, prodArrayResp.RawResponse, 200) + helpers.DeepEqualOrFatal(t, prodArrayResp.ProductArray, &[]lrogroup.Product{ lrogroup.Product{ Resource: lrogroup.Resource{ ID: to.StringPtr("100"), @@ -401,11 +401,11 @@ func TestLROBeginPost202NoRetry204(t *testing.T) { if err != nil { t.Fatal(err) } - resp, err = resp.PollUntilDone(context.Background(), 1*time.Millisecond) + prodResp, err := resp.PollUntilDone(context.Background(), 1*time.Millisecond) if err != nil { t.Fatal(err) } - helpers.VerifyStatusCode(t, resp.RawResponse, 204) + helpers.VerifyStatusCode(t, prodResp.RawResponse, 204) } func TestLROBeginPost202Retry200(t *testing.T) {