當前位置: 首頁>>代碼示例>>Golang>>正文


Golang autorest.DecoratePreparer函數代碼示例

本文整理匯總了Golang中github.com/Azure/go-autorest/autorest.DecoratePreparer函數的典型用法代碼示例。如果您正苦於以下問題:Golang DecoratePreparer函數的具體用法?Golang DecoratePreparer怎麽用?Golang DecoratePreparer使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了DecoratePreparer函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: DeletePreparer

// DeletePreparer prepares the Delete request.
func (client ZonesClient) DeletePreparer(resourceGroupName string, zoneName string, ifMatch string, ifNoneMatch string, cancel <-chan struct{}) (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"resourceGroupName": autorest.Encode("path", resourceGroupName),
		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
		"zoneName":          autorest.Encode("path", zoneName),
	}

	queryParameters := map[string]interface{}{
		"api-version": client.APIVersion,
	}

	preparer := autorest.CreatePreparer(
		autorest.AsDelete(),
		autorest.WithBaseURL(client.BaseURI),
		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnszones/{zoneName}", pathParameters),
		autorest.WithQueryParameters(queryParameters))
	if len(ifMatch) > 0 {
		preparer = autorest.DecoratePreparer(preparer,
			autorest.WithHeader("If-Match", autorest.String(ifMatch)))
	}
	if len(ifNoneMatch) > 0 {
		preparer = autorest.DecoratePreparer(preparer,
			autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
	}
	return preparer.Prepare(&http.Request{Cancel: cancel})
}
開發者ID:garimakhulbe,項目名稱:azure-sdk-for-go,代碼行數:27,代碼來源:zones.go

示例2: CreateOrUpdatePreparer

// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client RecordSetsClient) CreateOrUpdatePreparer(resourceGroupName string, zoneName string, relativeRecordSetName string, recordType RecordType, parameters RecordSet, ifMatch string, ifNoneMatch string) (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"recordType":            autorest.Encode("path", recordType),
		"relativeRecordSetName": relativeRecordSetName,
		"resourceGroupName":     autorest.Encode("path", resourceGroupName),
		"subscriptionId":        autorest.Encode("path", client.SubscriptionID),
		"zoneName":              autorest.Encode("path", zoneName),
	}

	queryParameters := map[string]interface{}{
		"api-version": client.APIVersion,
	}

	preparer := autorest.CreatePreparer(
		autorest.AsJSON(),
		autorest.AsPut(),
		autorest.WithBaseURL(client.BaseURI),
		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnszones/{zoneName}/{recordType}/{relativeRecordSetName}", pathParameters),
		autorest.WithJSON(parameters),
		autorest.WithQueryParameters(queryParameters))
	if len(ifMatch) > 0 {
		preparer = autorest.DecoratePreparer(preparer,
			autorest.WithHeader("If-Match", autorest.String(ifMatch)))
	}
	if len(ifNoneMatch) > 0 {
		preparer = autorest.DecoratePreparer(preparer,
			autorest.WithHeader("If-None-Match", autorest.String(ifNoneMatch)))
	}
	return preparer.Prepare(&http.Request{})
}
開發者ID:garimakhulbe,項目名稱:azure-sdk-for-go,代碼行數:31,代碼來源:recordsets.go

示例3: NewListNextRequest

// Create the ListNext request.
func (client ManagementLocksClient) NewListNextRequest(nextLink string) (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"nextLink":       nextLink,
		"subscriptionId": url.QueryEscape(client.SubscriptionId),
	}

	return autorest.DecoratePreparer(
		client.ListNextRequestPreparer(),
		autorest.WithPathParameters(pathParameters)).Prepare(&http.Request{})
}
開發者ID:Nepomuceno,項目名稱:azure-sdk-for-go,代碼行數:11,代碼來源:managementlocks.go

示例4: AddPetUsingByteArrayPreparer

// AddPetUsingByteArrayPreparer prepares the AddPetUsingByteArray request.
func (client ManagementClient) AddPetUsingByteArrayPreparer(body string) (*http.Request, error) {
	preparer := autorest.CreatePreparer(
		autorest.AsJSON(),
		autorest.AsPost(),
		autorest.WithBaseURL(client.BaseURI),
		autorest.WithPath("/pet"))
	if len(body) > 0 {
		preparer = autorest.DecoratePreparer(preparer,
			autorest.WithJSON(body))
	}
	return preparer.Prepare(&http.Request{})
}
開發者ID:garimakhulbe,項目名稱:autorest,代碼行數:13,代碼來源:client.go

示例5: CreateUsersWithListInputPreparer

// CreateUsersWithListInputPreparer prepares the CreateUsersWithListInput request.
func (client ManagementClient) CreateUsersWithListInputPreparer(body []User) (*http.Request, error) {
	preparer := autorest.CreatePreparer(
		autorest.AsJSON(),
		autorest.AsPost(),
		autorest.WithBaseURL(client.BaseURI),
		autorest.WithPath("/user/createWithList"))
	if body != nil && len(body) > 0 {
		preparer = autorest.DecoratePreparer(preparer,
			autorest.WithJSON(body))
	}
	return preparer.Prepare(&http.Request{})
}
開發者ID:garimakhulbe,項目名稱:autorest,代碼行數:13,代碼來源:client.go

示例6: AddPetPreparer

// AddPetPreparer prepares the AddPet request.
func (client ManagementClient) AddPetPreparer(body *Pet) (*http.Request, error) {
	preparer := autorest.CreatePreparer(
		autorest.AsJSON(),
		autorest.AsPost(),
		autorest.WithBaseURL(client.BaseURI),
		autorest.WithPath("/pet"))
	if body != nil {
		preparer = autorest.DecoratePreparer(preparer,
			autorest.WithJSON(body))
	}
	return preparer.Prepare(&http.Request{})
}
開發者ID:garimakhulbe,項目名稱:autorest,代碼行數:13,代碼來源:client.go

示例7: NewListAllRequest

// Create the ListAll request.
func (client ApplicationGatewaysClient) NewListAllRequest() (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"subscriptionId": url.QueryEscape(client.SubscriptionId),
	}

	queryParameters := map[string]interface{}{
		"api-version": ApiVersion,
	}

	return autorest.DecoratePreparer(
		client.ListAllRequestPreparer(),
		autorest.WithPathParameters(pathParameters),
		autorest.WithQueryParameters(queryParameters)).Prepare(&http.Request{})
}
開發者ID:Nepomuceno,項目名稱:azure-sdk-for-go,代碼行數:15,代碼來源:applicationgateways.go

示例8: NewGetRequest

// Create the Get request.
func (client SubscriptionsClient) NewGetRequest(subscriptionId string) (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"subscriptionId": url.QueryEscape(subscriptionId),
	}

	queryParameters := map[string]interface{}{
		"api-version": ApiVersion,
	}

	return autorest.DecoratePreparer(
		client.GetRequestPreparer(),
		autorest.WithPathParameters(pathParameters),
		autorest.WithQueryParameters(queryParameters)).Prepare(&http.Request{})
}
開發者ID:Nepomuceno,項目名稱:azure-sdk-for-go,代碼行數:15,代碼來源:subscriptions.go

示例9: NewListPublishersRequest

// Create the ListPublishers request.
func (client VirtualMachineImagesClient) NewListPublishersRequest(location string) (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"location":       url.QueryEscape(location),
		"subscriptionId": url.QueryEscape(client.SubscriptionId),
	}

	queryParameters := map[string]interface{}{
		"api-version": ApiVersion,
	}

	return autorest.DecoratePreparer(
		client.ListPublishersRequestPreparer(),
		autorest.WithPathParameters(pathParameters),
		autorest.WithQueryParameters(queryParameters)).Prepare(&http.Request{})
}
開發者ID:Nepomuceno,項目名稱:azure-sdk-for-go,代碼行數:16,代碼來源:virtualmachineimages.go

示例10: NewCreateOrUpdateRequest

// Create the CreateOrUpdate request.
func (client TagsClient) NewCreateOrUpdateRequest(tagName string) (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"subscriptionId": url.QueryEscape(client.SubscriptionId),
		"tagName":        url.QueryEscape(tagName),
	}

	queryParameters := map[string]interface{}{
		"api-version": ApiVersion,
	}

	return autorest.DecoratePreparer(
		client.CreateOrUpdateRequestPreparer(),
		autorest.WithPathParameters(pathParameters),
		autorest.WithQueryParameters(queryParameters)).Prepare(&http.Request{})
}
開發者ID:ritazh,項目名稱:azure_storage_service_broker,代碼行數:16,代碼來源:tags.go

示例11: NewListRequest

// Create the List request.
func (client LocalNetworkGatewaysClient) NewListRequest(resourceGroupName string) (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"resourceGroupName": url.QueryEscape(resourceGroupName),
		"subscriptionId":    url.QueryEscape(client.SubscriptionId),
	}

	queryParameters := map[string]interface{}{
		"api-version": ApiVersion,
	}

	return autorest.DecoratePreparer(
		client.ListRequestPreparer(),
		autorest.WithPathParameters(pathParameters),
		autorest.WithQueryParameters(queryParameters)).Prepare(&http.Request{})
}
開發者ID:Nepomuceno,項目名稱:azure-sdk-for-go,代碼行數:16,代碼來源:localnetworkgateways.go

示例12: NewListRequest

// Create the List request.
func (client ResourceProviderOperationDetailsClient) NewListRequest(resourceProviderNamespace string, apiVersion string) (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
		"subscriptionId":            url.QueryEscape(client.SubscriptionId),
	}

	queryParameters := map[string]interface{}{
		"api-version": ApiVersion,
	}

	return autorest.DecoratePreparer(
		client.ListRequestPreparer(),
		autorest.WithPathParameters(pathParameters),
		autorest.WithQueryParameters(queryParameters)).Prepare(&http.Request{})
}
開發者ID:ritazh,項目名稱:azure_storage_service_broker,代碼行數:16,代碼來源:resourceprovideroperationdetails.go

示例13: NewCheckNameAvailabilityRequest

// Create the CheckNameAvailability request.
func (client StorageAccountsClient) NewCheckNameAvailabilityRequest(accountName StorageAccountCheckNameAvailabilityParameters) (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"subscriptionId": url.QueryEscape(client.SubscriptionId),
	}

	queryParameters := map[string]interface{}{
		"api-version": ApiVersion,
	}

	return autorest.DecoratePreparer(
		client.CheckNameAvailabilityRequestPreparer(),
		autorest.WithJSON(accountName),
		autorest.WithPathParameters(pathParameters),
		autorest.WithQueryParameters(queryParameters)).Prepare(&http.Request{})
}
開發者ID:ritazh,項目名稱:azure_storage_service_broker,代碼行數:16,代碼來源:storageaccounts.go

示例14: NewListAtSubscriptionLevelRequest

// Create the ListAtSubscriptionLevel request.
func (client ManagementLocksClient) NewListAtSubscriptionLevelRequest(filter string) (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"subscriptionId": url.QueryEscape(client.SubscriptionId),
	}

	queryParameters := map[string]interface{}{
		"$filter":     filter,
		"api-version": ApiVersion,
	}

	return autorest.DecoratePreparer(
		client.ListAtSubscriptionLevelRequestPreparer(),
		autorest.WithPathParameters(pathParameters),
		autorest.WithQueryParameters(queryParameters)).Prepare(&http.Request{})
}
開發者ID:Nepomuceno,項目名稱:azure-sdk-for-go,代碼行數:16,代碼來源:managementlocks.go

示例15: DeletePetPreparer

// DeletePetPreparer prepares the DeletePet request.
func (client ManagementClient) DeletePetPreparer(petID int64, apiKey string) (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"petId": autorest.Encode("path", petID),
	}

	preparer := autorest.CreatePreparer(
		autorest.AsDelete(),
		autorest.WithBaseURL(client.BaseURI),
		autorest.WithPathParameters("/pet/{petId}", pathParameters))
	if len(apiKey) > 0 {
		preparer = autorest.DecoratePreparer(preparer,
			autorest.WithHeader("api_key", autorest.String(apiKey)))
	}
	return preparer.Prepare(&http.Request{})
}
開發者ID:garimakhulbe,項目名稱:autorest,代碼行數:16,代碼來源:client.go


注:本文中的github.com/Azure/go-autorest/autorest.DecoratePreparer函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。