From a102739022f640bc1405f022765299ba62962e7c Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 25 Oct 2018 20:08:39 +0000 Subject: [PATCH] Generated from 6533a0dd2a5dfbe7ec76f3f2b6c407c876d4315d Add missing endpoints to newest versions --- profiles/latest/logic/mgmt/logic/models.go | 18 ++ profiles/preview/logic/mgmt/logic/models.go | 18 ++ .../preview/logic/mgmt/logic/models.go | 18 ++ .../logic/mgmt/2016-06-01/logic/models.go | 85 ++++++++ ...lowrunactionrepetitionsrequesthistories.go | 190 ++++++++++++++++++ .../workflowrunactionrequesthistories.go | 186 +++++++++++++++++ .../2015-02-01-preview/logic/workflows.go | 4 - .../mgmt/2018-07-01-preview/logic/models.go | 85 ++++++++ ...lowrunactionrepetitionsrequesthistories.go | 190 ++++++++++++++++++ .../workflowrunactionrequesthistories.go | 186 +++++++++++++++++ 10 files changed, 976 insertions(+), 4 deletions(-) create mode 100644 services/logic/mgmt/2016-06-01/logic/workflowrunactionrepetitionsrequesthistories.go create mode 100644 services/logic/mgmt/2016-06-01/logic/workflowrunactionrequesthistories.go create mode 100644 services/preview/logic/mgmt/2018-07-01-preview/logic/workflowrunactionrepetitionsrequesthistories.go create mode 100644 services/preview/logic/mgmt/2018-07-01-preview/logic/workflowrunactionrequesthistories.go diff --git a/profiles/latest/logic/mgmt/logic/models.go b/profiles/latest/logic/mgmt/logic/models.go index 282b1ecca535..80e54bdfc38b 100644 --- a/profiles/latest/logic/mgmt/logic/models.go +++ b/profiles/latest/logic/mgmt/logic/models.go @@ -500,8 +500,12 @@ type RecurrenceSchedule = original.RecurrenceSchedule type RecurrenceScheduleOccurrence = original.RecurrenceScheduleOccurrence type RegenerateActionParameter = original.RegenerateActionParameter type RepetitionIndex = original.RepetitionIndex +type Request = original.Request +type RequestHistory = original.RequestHistory +type RequestHistoryListResult = original.RequestHistoryListResult type Resource = original.Resource type ResourceReference = original.ResourceReference +type Response = original.Response type RetryHistory = original.RetryHistory type RunActionCorrelation = original.RunActionCorrelation type RunCorrelation = original.RunCorrelation @@ -575,6 +579,8 @@ type PartnersClient = original.PartnersClient type SchemasClient = original.SchemasClient type SessionsClient = original.SessionsClient type WorkflowRunActionRepetitionsClient = original.WorkflowRunActionRepetitionsClient +type WorkflowRunActionRepetitionsRequestHistoriesClient = original.WorkflowRunActionRepetitionsRequestHistoriesClient +type WorkflowRunActionRequestHistoriesClient = original.WorkflowRunActionRequestHistoriesClient type WorkflowRunActionsClient = original.WorkflowRunActionsClient type WorkflowRunActionScopedRepetitionsClient = original.WorkflowRunActionScopedRepetitionsClient type WorkflowRunOperationsClient = original.WorkflowRunOperationsClient @@ -749,6 +755,18 @@ func NewWorkflowRunActionRepetitionsClient(subscriptionID string) WorkflowRunAct func NewWorkflowRunActionRepetitionsClientWithBaseURI(baseURI string, subscriptionID string) WorkflowRunActionRepetitionsClient { return original.NewWorkflowRunActionRepetitionsClientWithBaseURI(baseURI, subscriptionID) } +func NewWorkflowRunActionRepetitionsRequestHistoriesClient(subscriptionID string) WorkflowRunActionRepetitionsRequestHistoriesClient { + return original.NewWorkflowRunActionRepetitionsRequestHistoriesClient(subscriptionID) +} +func NewWorkflowRunActionRepetitionsRequestHistoriesClientWithBaseURI(baseURI string, subscriptionID string) WorkflowRunActionRepetitionsRequestHistoriesClient { + return original.NewWorkflowRunActionRepetitionsRequestHistoriesClientWithBaseURI(baseURI, subscriptionID) +} +func NewWorkflowRunActionRequestHistoriesClient(subscriptionID string) WorkflowRunActionRequestHistoriesClient { + return original.NewWorkflowRunActionRequestHistoriesClient(subscriptionID) +} +func NewWorkflowRunActionRequestHistoriesClientWithBaseURI(baseURI string, subscriptionID string) WorkflowRunActionRequestHistoriesClient { + return original.NewWorkflowRunActionRequestHistoriesClientWithBaseURI(baseURI, subscriptionID) +} func NewWorkflowRunActionsClient(subscriptionID string) WorkflowRunActionsClient { return original.NewWorkflowRunActionsClient(subscriptionID) } diff --git a/profiles/preview/logic/mgmt/logic/models.go b/profiles/preview/logic/mgmt/logic/models.go index 71ac161179ce..4a1ad785a20e 100644 --- a/profiles/preview/logic/mgmt/logic/models.go +++ b/profiles/preview/logic/mgmt/logic/models.go @@ -500,8 +500,12 @@ type RecurrenceSchedule = original.RecurrenceSchedule type RecurrenceScheduleOccurrence = original.RecurrenceScheduleOccurrence type RegenerateActionParameter = original.RegenerateActionParameter type RepetitionIndex = original.RepetitionIndex +type Request = original.Request +type RequestHistory = original.RequestHistory +type RequestHistoryListResult = original.RequestHistoryListResult type Resource = original.Resource type ResourceReference = original.ResourceReference +type Response = original.Response type RetryHistory = original.RetryHistory type RunActionCorrelation = original.RunActionCorrelation type RunCorrelation = original.RunCorrelation @@ -575,6 +579,8 @@ type PartnersClient = original.PartnersClient type SchemasClient = original.SchemasClient type SessionsClient = original.SessionsClient type WorkflowRunActionRepetitionsClient = original.WorkflowRunActionRepetitionsClient +type WorkflowRunActionRepetitionsRequestHistoriesClient = original.WorkflowRunActionRepetitionsRequestHistoriesClient +type WorkflowRunActionRequestHistoriesClient = original.WorkflowRunActionRequestHistoriesClient type WorkflowRunActionsClient = original.WorkflowRunActionsClient type WorkflowRunActionScopedRepetitionsClient = original.WorkflowRunActionScopedRepetitionsClient type WorkflowRunOperationsClient = original.WorkflowRunOperationsClient @@ -749,6 +755,18 @@ func NewWorkflowRunActionRepetitionsClient(subscriptionID string) WorkflowRunAct func NewWorkflowRunActionRepetitionsClientWithBaseURI(baseURI string, subscriptionID string) WorkflowRunActionRepetitionsClient { return original.NewWorkflowRunActionRepetitionsClientWithBaseURI(baseURI, subscriptionID) } +func NewWorkflowRunActionRepetitionsRequestHistoriesClient(subscriptionID string) WorkflowRunActionRepetitionsRequestHistoriesClient { + return original.NewWorkflowRunActionRepetitionsRequestHistoriesClient(subscriptionID) +} +func NewWorkflowRunActionRepetitionsRequestHistoriesClientWithBaseURI(baseURI string, subscriptionID string) WorkflowRunActionRepetitionsRequestHistoriesClient { + return original.NewWorkflowRunActionRepetitionsRequestHistoriesClientWithBaseURI(baseURI, subscriptionID) +} +func NewWorkflowRunActionRequestHistoriesClient(subscriptionID string) WorkflowRunActionRequestHistoriesClient { + return original.NewWorkflowRunActionRequestHistoriesClient(subscriptionID) +} +func NewWorkflowRunActionRequestHistoriesClientWithBaseURI(baseURI string, subscriptionID string) WorkflowRunActionRequestHistoriesClient { + return original.NewWorkflowRunActionRequestHistoriesClientWithBaseURI(baseURI, subscriptionID) +} func NewWorkflowRunActionsClient(subscriptionID string) WorkflowRunActionsClient { return original.NewWorkflowRunActionsClient(subscriptionID) } diff --git a/profiles/preview/preview/logic/mgmt/logic/models.go b/profiles/preview/preview/logic/mgmt/logic/models.go index 1efdd05a6c9d..e58a2abc7f27 100644 --- a/profiles/preview/preview/logic/mgmt/logic/models.go +++ b/profiles/preview/preview/logic/mgmt/logic/models.go @@ -497,8 +497,12 @@ type RecurrenceSchedule = original.RecurrenceSchedule type RecurrenceScheduleOccurrence = original.RecurrenceScheduleOccurrence type RegenerateActionParameter = original.RegenerateActionParameter type RepetitionIndex = original.RepetitionIndex +type Request = original.Request +type RequestHistory = original.RequestHistory +type RequestHistoryListResult = original.RequestHistoryListResult type Resource = original.Resource type ResourceReference = original.ResourceReference +type Response = original.Response type RetryHistory = original.RetryHistory type RunActionCorrelation = original.RunActionCorrelation type RunCorrelation = original.RunCorrelation @@ -570,6 +574,8 @@ type X12ValidationOverride = original.X12ValidationOverride type X12ValidationSettings = original.X12ValidationSettings type OperationsClient = original.OperationsClient type WorkflowRunActionRepetitionsClient = original.WorkflowRunActionRepetitionsClient +type WorkflowRunActionRepetitionsRequestHistoriesClient = original.WorkflowRunActionRepetitionsRequestHistoriesClient +type WorkflowRunActionRequestHistoriesClient = original.WorkflowRunActionRequestHistoriesClient type WorkflowRunActionsClient = original.WorkflowRunActionsClient type WorkflowRunActionScopeRepetitionsClient = original.WorkflowRunActionScopeRepetitionsClient type WorkflowRunOperationsClient = original.WorkflowRunOperationsClient @@ -748,6 +754,18 @@ func NewWorkflowRunActionRepetitionsClient(subscriptionID string) WorkflowRunAct func NewWorkflowRunActionRepetitionsClientWithBaseURI(baseURI string, subscriptionID string) WorkflowRunActionRepetitionsClient { return original.NewWorkflowRunActionRepetitionsClientWithBaseURI(baseURI, subscriptionID) } +func NewWorkflowRunActionRepetitionsRequestHistoriesClient(subscriptionID string) WorkflowRunActionRepetitionsRequestHistoriesClient { + return original.NewWorkflowRunActionRepetitionsRequestHistoriesClient(subscriptionID) +} +func NewWorkflowRunActionRepetitionsRequestHistoriesClientWithBaseURI(baseURI string, subscriptionID string) WorkflowRunActionRepetitionsRequestHistoriesClient { + return original.NewWorkflowRunActionRepetitionsRequestHistoriesClientWithBaseURI(baseURI, subscriptionID) +} +func NewWorkflowRunActionRequestHistoriesClient(subscriptionID string) WorkflowRunActionRequestHistoriesClient { + return original.NewWorkflowRunActionRequestHistoriesClient(subscriptionID) +} +func NewWorkflowRunActionRequestHistoriesClientWithBaseURI(baseURI string, subscriptionID string) WorkflowRunActionRequestHistoriesClient { + return original.NewWorkflowRunActionRequestHistoriesClientWithBaseURI(baseURI, subscriptionID) +} func NewWorkflowRunActionsClient(subscriptionID string) WorkflowRunActionsClient { return original.NewWorkflowRunActionsClient(subscriptionID) } diff --git a/services/logic/mgmt/2016-06-01/logic/models.go b/services/logic/mgmt/2016-06-01/logic/models.go index 5e545c016415..5193f0204cbe 100644 --- a/services/logic/mgmt/2016-06-01/logic/models.go +++ b/services/logic/mgmt/2016-06-01/logic/models.go @@ -3398,6 +3398,81 @@ type RepetitionIndex struct { ItemIndex *int32 `json:"itemIndex,omitempty"` } +// Request a request. +type Request struct { + // Headers - A list of all the headers attached to the request. + Headers interface{} `json:"headers,omitempty"` + // URI - The destination for the request. + URI *string `json:"uri,omitempty"` + // Method - The HTTP method used for the request. + Method *string `json:"method,omitempty"` +} + +// RequestHistory the request history. +type RequestHistory struct { + autorest.Response `json:"-"` + // StartTime - The time the request started. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The time the request ended. + EndTime *date.Time `json:"endTime,omitempty"` + // Request - The request. + Request *Request `json:"request,omitempty"` + // Response - The response. + Response *Response `json:"response,omitempty"` + // ID - The resource id. + ID *string `json:"id,omitempty"` + // Name - Gets the resource name. + Name *string `json:"name,omitempty"` + // Type - Gets the resource type. + Type *string `json:"type,omitempty"` + // Location - The resource location. + Location *string `json:"location,omitempty"` + // Tags - The resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for RequestHistory. +func (rh RequestHistory) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rh.StartTime != nil { + objectMap["startTime"] = rh.StartTime + } + if rh.EndTime != nil { + objectMap["endTime"] = rh.EndTime + } + if rh.Request != nil { + objectMap["request"] = rh.Request + } + if rh.Response != nil { + objectMap["response"] = rh.Response + } + if rh.ID != nil { + objectMap["id"] = rh.ID + } + if rh.Name != nil { + objectMap["name"] = rh.Name + } + if rh.Type != nil { + objectMap["type"] = rh.Type + } + if rh.Location != nil { + objectMap["location"] = rh.Location + } + if rh.Tags != nil { + objectMap["tags"] = rh.Tags + } + return json.Marshal(objectMap) +} + +// RequestHistoryListResult the list of workflow request histories. +type RequestHistoryListResult struct { + autorest.Response `json:"-"` + // Value - A list of workflow request histories. + Value *[]RequestHistory `json:"value,omitempty"` + // NextLink - The URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + // Resource the base resource type. type Resource struct { // ID - The resource id. @@ -3443,6 +3518,16 @@ type ResourceReference struct { Type *string `json:"type,omitempty"` } +// Response a response. +type Response struct { + // Headers - A list of all the headers attached to the response. + Headers interface{} `json:"headers,omitempty"` + // StatusCode - The status code of the response. + StatusCode *int32 `json:"statusCode,omitempty"` + // BodyLink - Details on the location of the body content. + BodyLink *ContentLink `json:"bodyLink,omitempty"` +} + // RetryHistory the retry history. type RetryHistory struct { // StartTime - Gets the start time. diff --git a/services/logic/mgmt/2016-06-01/logic/workflowrunactionrepetitionsrequesthistories.go b/services/logic/mgmt/2016-06-01/logic/workflowrunactionrepetitionsrequesthistories.go new file mode 100644 index 000000000000..e1aae04bf6b5 --- /dev/null +++ b/services/logic/mgmt/2016-06-01/logic/workflowrunactionrepetitionsrequesthistories.go @@ -0,0 +1,190 @@ +package logic + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// WorkflowRunActionRepetitionsRequestHistoriesClient is the REST API for Azure Logic Apps. +type WorkflowRunActionRepetitionsRequestHistoriesClient struct { + BaseClient +} + +// NewWorkflowRunActionRepetitionsRequestHistoriesClient creates an instance of the +// WorkflowRunActionRepetitionsRequestHistoriesClient client. +func NewWorkflowRunActionRepetitionsRequestHistoriesClient(subscriptionID string) WorkflowRunActionRepetitionsRequestHistoriesClient { + return NewWorkflowRunActionRepetitionsRequestHistoriesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkflowRunActionRepetitionsRequestHistoriesClientWithBaseURI creates an instance of the +// WorkflowRunActionRepetitionsRequestHistoriesClient client. +func NewWorkflowRunActionRepetitionsRequestHistoriesClientWithBaseURI(baseURI string, subscriptionID string) WorkflowRunActionRepetitionsRequestHistoriesClient { + return WorkflowRunActionRepetitionsRequestHistoriesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets a workflow run repetition request history. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// runName - the workflow run name. +// actionName - the workflow action name. +// repetitionName - the workflow repetition. +// requestHistoryName - the request history name. +func (client WorkflowRunActionRepetitionsRequestHistoriesClient) Get(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string, repetitionName string, requestHistoryName string) (result RequestHistory, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, workflowName, runName, actionName, repetitionName, requestHistoryName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRepetitionsRequestHistoriesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRepetitionsRequestHistoriesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRepetitionsRequestHistoriesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client WorkflowRunActionRepetitionsRequestHistoriesClient) GetPreparer(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string, repetitionName string, requestHistoryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "actionName": autorest.Encode("path", actionName), + "repetitionName": autorest.Encode("path", repetitionName), + "requestHistoryName": autorest.Encode("path", requestHistoryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runName": autorest.Encode("path", runName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2016-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions/{repetitionName}/requestHistories/{requestHistoryName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client WorkflowRunActionRepetitionsRequestHistoriesClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client WorkflowRunActionRepetitionsRequestHistoriesClient) GetResponder(resp *http.Response) (result RequestHistory, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list a workflow run repetition request history. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// runName - the workflow run name. +// actionName - the workflow action name. +// repetitionName - the workflow repetition. +func (client WorkflowRunActionRepetitionsRequestHistoriesClient) List(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string, repetitionName string) (result RequestHistoryListResult, err error) { + req, err := client.ListPreparer(ctx, resourceGroupName, workflowName, runName, actionName, repetitionName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRepetitionsRequestHistoriesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRepetitionsRequestHistoriesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRepetitionsRequestHistoriesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client WorkflowRunActionRepetitionsRequestHistoriesClient) ListPreparer(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string, repetitionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "actionName": autorest.Encode("path", actionName), + "repetitionName": autorest.Encode("path", repetitionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runName": autorest.Encode("path", runName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2016-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions/{repetitionName}/requestHistories", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client WorkflowRunActionRepetitionsRequestHistoriesClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client WorkflowRunActionRepetitionsRequestHistoriesClient) ListResponder(resp *http.Response) (result RequestHistoryListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/logic/mgmt/2016-06-01/logic/workflowrunactionrequesthistories.go b/services/logic/mgmt/2016-06-01/logic/workflowrunactionrequesthistories.go new file mode 100644 index 000000000000..b61f3f6e687f --- /dev/null +++ b/services/logic/mgmt/2016-06-01/logic/workflowrunactionrequesthistories.go @@ -0,0 +1,186 @@ +package logic + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// WorkflowRunActionRequestHistoriesClient is the REST API for Azure Logic Apps. +type WorkflowRunActionRequestHistoriesClient struct { + BaseClient +} + +// NewWorkflowRunActionRequestHistoriesClient creates an instance of the WorkflowRunActionRequestHistoriesClient +// client. +func NewWorkflowRunActionRequestHistoriesClient(subscriptionID string) WorkflowRunActionRequestHistoriesClient { + return NewWorkflowRunActionRequestHistoriesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkflowRunActionRequestHistoriesClientWithBaseURI creates an instance of the +// WorkflowRunActionRequestHistoriesClient client. +func NewWorkflowRunActionRequestHistoriesClientWithBaseURI(baseURI string, subscriptionID string) WorkflowRunActionRequestHistoriesClient { + return WorkflowRunActionRequestHistoriesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets a workflow run request history. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// runName - the workflow run name. +// actionName - the workflow action name. +// requestHistoryName - the request history name. +func (client WorkflowRunActionRequestHistoriesClient) Get(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string, requestHistoryName string) (result RequestHistory, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, workflowName, runName, actionName, requestHistoryName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRequestHistoriesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRequestHistoriesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRequestHistoriesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client WorkflowRunActionRequestHistoriesClient) GetPreparer(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string, requestHistoryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "actionName": autorest.Encode("path", actionName), + "requestHistoryName": autorest.Encode("path", requestHistoryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runName": autorest.Encode("path", runName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2016-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/requestHistories/{requestHistoryName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client WorkflowRunActionRequestHistoriesClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client WorkflowRunActionRequestHistoriesClient) GetResponder(resp *http.Response) (result RequestHistory, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list a workflow run request history. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// runName - the workflow run name. +// actionName - the workflow action name. +func (client WorkflowRunActionRequestHistoriesClient) List(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string) (result RequestHistoryListResult, err error) { + req, err := client.ListPreparer(ctx, resourceGroupName, workflowName, runName, actionName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRequestHistoriesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRequestHistoriesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRequestHistoriesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client WorkflowRunActionRequestHistoriesClient) ListPreparer(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "actionName": autorest.Encode("path", actionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runName": autorest.Encode("path", runName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2016-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/requestHistories", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client WorkflowRunActionRequestHistoriesClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client WorkflowRunActionRequestHistoriesClient) ListResponder(resp *http.Response) (result RequestHistoryListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/logic/mgmt/2015-02-01-preview/logic/workflows.go b/services/preview/logic/mgmt/2015-02-01-preview/logic/workflows.go index 338a7ec89970..2f28248bf6a0 100644 --- a/services/preview/logic/mgmt/2015-02-01-preview/logic/workflows.go +++ b/services/preview/logic/mgmt/2015-02-01-preview/logic/workflows.go @@ -627,10 +627,6 @@ func (client WorkflowsClient) RunSender(req *http.Request) (future WorkflowsRunF if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } diff --git a/services/preview/logic/mgmt/2018-07-01-preview/logic/models.go b/services/preview/logic/mgmt/2018-07-01-preview/logic/models.go index c607fca6d6ea..a037ba42f546 100644 --- a/services/preview/logic/mgmt/2018-07-01-preview/logic/models.go +++ b/services/preview/logic/mgmt/2018-07-01-preview/logic/models.go @@ -3383,6 +3383,81 @@ type RepetitionIndex struct { ItemIndex *int32 `json:"itemIndex,omitempty"` } +// Request a request. +type Request struct { + // Headers - A list of all the headers attached to the request. + Headers interface{} `json:"headers,omitempty"` + // URI - The destination for the request. + URI *string `json:"uri,omitempty"` + // Method - The HTTP method used for the request. + Method *string `json:"method,omitempty"` +} + +// RequestHistory the request history. +type RequestHistory struct { + autorest.Response `json:"-"` + // StartTime - The time the request started. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The time the request ended. + EndTime *date.Time `json:"endTime,omitempty"` + // Request - The request. + Request *Request `json:"request,omitempty"` + // Response - The response. + Response *Response `json:"response,omitempty"` + // ID - The resource id. + ID *string `json:"id,omitempty"` + // Name - Gets the resource name. + Name *string `json:"name,omitempty"` + // Type - Gets the resource type. + Type *string `json:"type,omitempty"` + // Location - The resource location. + Location *string `json:"location,omitempty"` + // Tags - The resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for RequestHistory. +func (rh RequestHistory) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rh.StartTime != nil { + objectMap["startTime"] = rh.StartTime + } + if rh.EndTime != nil { + objectMap["endTime"] = rh.EndTime + } + if rh.Request != nil { + objectMap["request"] = rh.Request + } + if rh.Response != nil { + objectMap["response"] = rh.Response + } + if rh.ID != nil { + objectMap["id"] = rh.ID + } + if rh.Name != nil { + objectMap["name"] = rh.Name + } + if rh.Type != nil { + objectMap["type"] = rh.Type + } + if rh.Location != nil { + objectMap["location"] = rh.Location + } + if rh.Tags != nil { + objectMap["tags"] = rh.Tags + } + return json.Marshal(objectMap) +} + +// RequestHistoryListResult the list of workflow request histories. +type RequestHistoryListResult struct { + autorest.Response `json:"-"` + // Value - A list of workflow request histories. + Value *[]RequestHistory `json:"value,omitempty"` + // NextLink - The URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + // Resource the base resource type. type Resource struct { // ID - The resource id. @@ -3428,6 +3503,16 @@ type ResourceReference struct { Type *string `json:"type,omitempty"` } +// Response a response. +type Response struct { + // Headers - A list of all the headers attached to the response. + Headers interface{} `json:"headers,omitempty"` + // StatusCode - The status code of the response. + StatusCode *int32 `json:"statusCode,omitempty"` + // BodyLink - Details on the location of the body content. + BodyLink *ContentLink `json:"bodyLink,omitempty"` +} + // RetryHistory the retry history. type RetryHistory struct { // StartTime - Gets the start time. diff --git a/services/preview/logic/mgmt/2018-07-01-preview/logic/workflowrunactionrepetitionsrequesthistories.go b/services/preview/logic/mgmt/2018-07-01-preview/logic/workflowrunactionrepetitionsrequesthistories.go new file mode 100644 index 000000000000..74fca376aade --- /dev/null +++ b/services/preview/logic/mgmt/2018-07-01-preview/logic/workflowrunactionrepetitionsrequesthistories.go @@ -0,0 +1,190 @@ +package logic + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// WorkflowRunActionRepetitionsRequestHistoriesClient is the REST API for Azure Logic Apps. +type WorkflowRunActionRepetitionsRequestHistoriesClient struct { + BaseClient +} + +// NewWorkflowRunActionRepetitionsRequestHistoriesClient creates an instance of the +// WorkflowRunActionRepetitionsRequestHistoriesClient client. +func NewWorkflowRunActionRepetitionsRequestHistoriesClient(subscriptionID string) WorkflowRunActionRepetitionsRequestHistoriesClient { + return NewWorkflowRunActionRepetitionsRequestHistoriesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkflowRunActionRepetitionsRequestHistoriesClientWithBaseURI creates an instance of the +// WorkflowRunActionRepetitionsRequestHistoriesClient client. +func NewWorkflowRunActionRepetitionsRequestHistoriesClientWithBaseURI(baseURI string, subscriptionID string) WorkflowRunActionRepetitionsRequestHistoriesClient { + return WorkflowRunActionRepetitionsRequestHistoriesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets a workflow run repetition request history. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// runName - the workflow run name. +// actionName - the workflow action name. +// repetitionName - the workflow repetition. +// requestHistoryName - the request history name. +func (client WorkflowRunActionRepetitionsRequestHistoriesClient) Get(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string, repetitionName string, requestHistoryName string) (result RequestHistory, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, workflowName, runName, actionName, repetitionName, requestHistoryName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRepetitionsRequestHistoriesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRepetitionsRequestHistoriesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRepetitionsRequestHistoriesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client WorkflowRunActionRepetitionsRequestHistoriesClient) GetPreparer(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string, repetitionName string, requestHistoryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "actionName": autorest.Encode("path", actionName), + "repetitionName": autorest.Encode("path", repetitionName), + "requestHistoryName": autorest.Encode("path", requestHistoryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runName": autorest.Encode("path", runName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2018-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions/{repetitionName}/requestHistories/{requestHistoryName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client WorkflowRunActionRepetitionsRequestHistoriesClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client WorkflowRunActionRepetitionsRequestHistoriesClient) GetResponder(resp *http.Response) (result RequestHistory, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list a workflow run repetition request history. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// runName - the workflow run name. +// actionName - the workflow action name. +// repetitionName - the workflow repetition. +func (client WorkflowRunActionRepetitionsRequestHistoriesClient) List(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string, repetitionName string) (result RequestHistoryListResult, err error) { + req, err := client.ListPreparer(ctx, resourceGroupName, workflowName, runName, actionName, repetitionName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRepetitionsRequestHistoriesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRepetitionsRequestHistoriesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRepetitionsRequestHistoriesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client WorkflowRunActionRepetitionsRequestHistoriesClient) ListPreparer(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string, repetitionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "actionName": autorest.Encode("path", actionName), + "repetitionName": autorest.Encode("path", repetitionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runName": autorest.Encode("path", runName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2018-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions/{repetitionName}/requestHistories", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client WorkflowRunActionRepetitionsRequestHistoriesClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client WorkflowRunActionRepetitionsRequestHistoriesClient) ListResponder(resp *http.Response) (result RequestHistoryListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/logic/mgmt/2018-07-01-preview/logic/workflowrunactionrequesthistories.go b/services/preview/logic/mgmt/2018-07-01-preview/logic/workflowrunactionrequesthistories.go new file mode 100644 index 000000000000..c12c6a7b1cef --- /dev/null +++ b/services/preview/logic/mgmt/2018-07-01-preview/logic/workflowrunactionrequesthistories.go @@ -0,0 +1,186 @@ +package logic + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// WorkflowRunActionRequestHistoriesClient is the REST API for Azure Logic Apps. +type WorkflowRunActionRequestHistoriesClient struct { + BaseClient +} + +// NewWorkflowRunActionRequestHistoriesClient creates an instance of the WorkflowRunActionRequestHistoriesClient +// client. +func NewWorkflowRunActionRequestHistoriesClient(subscriptionID string) WorkflowRunActionRequestHistoriesClient { + return NewWorkflowRunActionRequestHistoriesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkflowRunActionRequestHistoriesClientWithBaseURI creates an instance of the +// WorkflowRunActionRequestHistoriesClient client. +func NewWorkflowRunActionRequestHistoriesClientWithBaseURI(baseURI string, subscriptionID string) WorkflowRunActionRequestHistoriesClient { + return WorkflowRunActionRequestHistoriesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets a workflow run request history. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// runName - the workflow run name. +// actionName - the workflow action name. +// requestHistoryName - the request history name. +func (client WorkflowRunActionRequestHistoriesClient) Get(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string, requestHistoryName string) (result RequestHistory, err error) { + req, err := client.GetPreparer(ctx, resourceGroupName, workflowName, runName, actionName, requestHistoryName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRequestHistoriesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRequestHistoriesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRequestHistoriesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client WorkflowRunActionRequestHistoriesClient) GetPreparer(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string, requestHistoryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "actionName": autorest.Encode("path", actionName), + "requestHistoryName": autorest.Encode("path", requestHistoryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runName": autorest.Encode("path", runName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2018-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/requestHistories/{requestHistoryName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client WorkflowRunActionRequestHistoriesClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client WorkflowRunActionRequestHistoriesClient) GetResponder(resp *http.Response) (result RequestHistory, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list a workflow run request history. +// Parameters: +// resourceGroupName - the resource group name. +// workflowName - the workflow name. +// runName - the workflow run name. +// actionName - the workflow action name. +func (client WorkflowRunActionRequestHistoriesClient) List(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string) (result RequestHistoryListResult, err error) { + req, err := client.ListPreparer(ctx, resourceGroupName, workflowName, runName, actionName) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRequestHistoriesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRequestHistoriesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "logic.WorkflowRunActionRequestHistoriesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client WorkflowRunActionRequestHistoriesClient) ListPreparer(ctx context.Context, resourceGroupName string, workflowName string, runName string, actionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "actionName": autorest.Encode("path", actionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runName": autorest.Encode("path", runName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workflowName": autorest.Encode("path", workflowName), + } + + const APIVersion = "2018-07-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/requestHistories", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client WorkflowRunActionRequestHistoriesClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client WorkflowRunActionRequestHistoriesClient) ListResponder(resp *http.Response) (result RequestHistoryListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +}