本文整理汇总了Golang中github.com/Azure/go-autorest/autorest.DecoratePreparer函数的典型用法代码示例。如果您正苦于以下问题:Golang DecoratePreparer函数的具体用法?Golang DecoratePreparer怎么用?Golang DecoratePreparer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DecoratePreparer函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: NewListRequest
// Create the List request.
func (client ResourceGroupsClient) NewListRequest(filter string, top int) (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": url.QueryEscape(client.SubscriptionId),
}
queryParameters := map[string]interface{}{
"$filter": filter,
"$top": top,
"api-version": ApiVersion,
}
return autorest.DecoratePreparer(
client.ListRequestPreparer(),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters)).Prepare(&http.Request{})
}
开发者ID:ritazh,项目名称:azure_storage_service_broker,代码行数:17,代码来源:resourcegroups.go
示例17: NewCreateOrUpdateAtSubscriptionLevelRequest
// Create the CreateOrUpdateAtSubscriptionLevel request.
func (client ManagementLocksClient) NewCreateOrUpdateAtSubscriptionLevelRequest(lockName string, parameters ManagementLock) (*http.Request, error) {
pathParameters := map[string]interface{}{
"lockName": url.QueryEscape(lockName),
"subscriptionId": url.QueryEscape(client.SubscriptionId),
}
queryParameters := map[string]interface{}{
"api-version": ApiVersion,
}
return autorest.DecoratePreparer(
client.CreateOrUpdateAtSubscriptionLevelRequestPreparer(),
autorest.WithJSON(parameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters)).Prepare(&http.Request{})
}
开发者ID:Nepomuceno,项目名称:azure-sdk-for-go,代码行数:17,代码来源:managementlocks.go
示例18: NewStartRequest
// Create the Start request.
func (client VirtualMachinesClient) NewStartRequest(resourceGroupName string, vmName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionId),
"vmName": url.QueryEscape(vmName),
}
queryParameters := map[string]interface{}{
"api-version": ApiVersion,
}
return autorest.DecoratePreparer(
client.StartRequestPreparer(),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters)).Prepare(&http.Request{})
}
开发者ID:Nepomuceno,项目名称:azure-sdk-for-go,代码行数:17,代码来源:virtualmachines.go
示例19: NewCancelRequest
// Create the Cancel request.
func (client DeploymentsClient) NewCancelRequest(resourceGroupName string, deploymentName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"deploymentName": url.QueryEscape(deploymentName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionId),
}
queryParameters := map[string]interface{}{
"api-version": ApiVersion,
}
return autorest.DecoratePreparer(
client.CancelRequestPreparer(),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters)).Prepare(&http.Request{})
}
开发者ID:ritazh,项目名称:azure_storage_service_broker,代码行数:17,代码来源:deployments.go
示例20: NewListAvailableSizesRequest
// Create the ListAvailableSizes request.
func (client AvailabilitySetsClient) NewListAvailableSizesRequest(resourceGroupName string, availabilitySetName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"availabilitySetName": url.QueryEscape(availabilitySetName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionId),
}
queryParameters := map[string]interface{}{
"api-version": ApiVersion,
}
return autorest.DecoratePreparer(
client.ListAvailableSizesRequestPreparer(),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters)).Prepare(&http.Request{})
}
开发者ID:Nepomuceno,项目名称:azure-sdk-for-go,代码行数:17,代码来源:availabilitysets.go
注:本文中的github.com/Azure/go-autorest/autorest.DecoratePreparer函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论