本文整理汇总了Golang中github.com/Azure/go-autorest/autorest.WithJSON函数的典型用法代码示例。如果您正苦于以下问题:Golang WithJSON函数的具体用法?Golang WithJSON怎么用?Golang WithJSON使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了WithJSON函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: 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
示例2: 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
示例3: 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
示例4: 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
示例5: UpdatePublishingUserPreparer
// UpdatePublishingUserPreparer prepares the UpdatePublishingUser request.
func (client ProviderClient) UpdatePublishingUserPreparer(requestMessage User) (*http.Request, error) {
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/providers/Microsoft.Web/publishingUsers/web"),
autorest.WithJSON(requestMessage),
autorest.WithQueryParameters(queryParameters))
}
开发者ID:containerx,项目名称:machine,代码行数:14,代码来源:provider.go
示例6: CheckNameAvailabilityPreparer
// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request.
func (client NameAvailabilityClient) CheckNameAvailabilityPreparer(checkNameAvailabilityInput CheckNameAvailabilityInput) (*http.Request, error) {
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/providers/Microsoft.Cdn/checkNameAvailability"),
autorest.WithJSON(checkNameAvailabilityInput),
autorest.WithQueryParameters(queryParameters))
}
开发者ID:kjnsn,项目名称:azure-sdk-for-go,代码行数:14,代码来源:nameavailability.go
示例7: CreatePreparer
func (client ServicePrincipalsClient) CreatePreparer(parameters ServicePrincipalCreateParameters, cancel <-chan struct{}) (*http.Request, error) {
queryParameters := map[string]interface{}{
"api-version": client.APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/servicePrincipals"),
autorest.WithJSON(parameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
开发者ID:bac,项目名称:juju,代码行数:14,代码来源:serviceprincipals.go
示例8: 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
示例9: 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
示例10: UpdateUserPreparer
// UpdateUserPreparer prepares the UpdateUser request.
func (client ManagementClient) UpdateUserPreparer(username string, body *User) (*http.Request, error) {
pathParameters := map[string]interface{}{
"username": autorest.Encode("path", username),
}
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/user/{username}", pathParameters))
if body != nil {
preparer = autorest.DecoratePreparer(preparer,
autorest.WithJSON(body))
}
return preparer.Prepare(&http.Request{})
}
开发者ID:garimakhulbe,项目名称:autorest,代码行数:17,代码来源:client.go
示例11: NewPatchRequest
// Create the Patch request.
func (client ResourceGroupsClient) NewPatchRequest(resourceGroupName string, parameters ResourceGroup) (*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.PatchRequestPreparer(),
autorest.WithJSON(parameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters)).Prepare(&http.Request{})
}
开发者ID:ritazh,项目名称:azure_storage_service_broker,代码行数:17,代码来源:resourcegroups.go
示例12: NewRegenerateKeyRequest
// Create the RegenerateKey request.
func (client StorageAccountsClient) NewRegenerateKeyRequest(resourceGroupName string, accountName string, regenerateKey StorageAccountRegenerateKeyParameters) (*http.Request, error) {
pathParameters := map[string]interface{}{
"accountName": url.QueryEscape(accountName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionId),
}
queryParameters := map[string]interface{}{
"api-version": ApiVersion,
}
return autorest.DecoratePreparer(
client.RegenerateKeyRequestPreparer(),
autorest.WithJSON(regenerateKey),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters)).Prepare(&http.Request{})
}
开发者ID:ritazh,项目名称:azure_storage_service_broker,代码行数:18,代码来源:storageaccounts.go
示例13: NewCreateOrUpdateRequest
// Create the CreateOrUpdate request.
func (client LocalNetworkGatewaysClient) NewCreateOrUpdateRequest(resourceGroupName string, localNetworkGatewayName string, parameters LocalNetworkGateway) (*http.Request, error) {
pathParameters := map[string]interface{}{
"localNetworkGatewayName": url.QueryEscape(localNetworkGatewayName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionId),
}
queryParameters := map[string]interface{}{
"api-version": ApiVersion,
}
return autorest.DecoratePreparer(
client.CreateOrUpdateRequestPreparer(),
autorest.WithJSON(parameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters)).Prepare(&http.Request{})
}
开发者ID:Nepomuceno,项目名称:azure-sdk-for-go,代码行数:18,代码来源:localnetworkgateways.go
示例14: NewCreateOrUpdateRequest
// Create the CreateOrUpdate request.
func (client ServicesClient) NewCreateOrUpdateRequest(resourceGroupName string, serviceName string, parameters SearchServiceCreateOrUpdateParameters) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"serviceName": url.QueryEscape(serviceName),
"subscriptionId": url.QueryEscape(client.SubscriptionId),
}
queryParameters := map[string]interface{}{
"api-version": ApiVersion,
}
return autorest.DecoratePreparer(
client.CreateOrUpdateRequestPreparer(),
autorest.WithJSON(parameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters)).Prepare(&http.Request{})
}
开发者ID:Nepomuceno,项目名称:azure-sdk-for-go,代码行数:18,代码来源:services.go
示例15: NewCreateOrUpdateRequest
// Create the CreateOrUpdate request.
func (client JobCollectionsClient) NewCreateOrUpdateRequest(resourceGroupName string, jobCollectionName string, jobCollection JobCollectionDefinition) (*http.Request, error) {
pathParameters := map[string]interface{}{
"jobCollectionName": url.QueryEscape(jobCollectionName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionId),
}
queryParameters := map[string]interface{}{
"api-version": ApiVersion,
}
return autorest.DecoratePreparer(
client.CreateOrUpdateRequestPreparer(),
autorest.WithJSON(jobCollection),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters)).Prepare(&http.Request{})
}
开发者ID:Nepomuceno,项目名称:azure-sdk-for-go,代码行数:18,代码来源:jobcollections.go
示例16: CheckNameAvailabilityPreparer
// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request.
func (client AccountsClient) CheckNameAvailabilityPreparer(accountName AccountCheckNameAvailabilityParameters) (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": url.QueryEscape(client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability"),
autorest.WithJSON(accountName),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
}
开发者ID:RaulKite,项目名称:machine,代码行数:19,代码来源:accounts.go
示例17: CreateOrUpdateByIDPreparer
// CreateOrUpdateByIDPreparer prepares the CreateOrUpdateByID request.
func (client Client) CreateOrUpdateByIDPreparer(resourceID string, parameters GenericResource, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceId": resourceID,
}
queryParameters := map[string]interface{}{
"api-version": client.APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/{resourceId}", pathParameters),
autorest.WithJSON(parameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
开发者ID:paultyng,项目名称:terraform,代码行数:19,代码来源:resources.go
示例18: CheckNameAvailabilityPreparer
// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request.
func (client AppCollectionsClient) CheckNameAvailabilityPreparer(parameters AppCollectionNameAvailability) (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": client.APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.MobileEngagement/checkAppCollectionNameAvailability", pathParameters),
autorest.WithJSON(parameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
开发者ID:garimakhulbe,项目名称:azure-sdk-for-go,代码行数:19,代码来源:appcollections.go
示例19: CheckNameAvailabilityPreparer
// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request.
func (client RegistriesClient) CheckNameAvailabilityPreparer(registryNameCheckRequest RegistryNameCheckRequest) (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": client.APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/checkNameAvailability", pathParameters),
autorest.WithJSON(registryNameCheckRequest),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
开发者ID:jbeda,项目名称:kubernetes,代码行数:19,代码来源:registries.go
示例20: UpdateSubscriptionPublishingCredentialsPreparer
// UpdateSubscriptionPublishingCredentialsPreparer prepares the UpdateSubscriptionPublishingCredentials request.
func (client GlobalClient) UpdateSubscriptionPublishingCredentialsPreparer(requestMessage User) (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": url.QueryEscape(client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Web/publishingCredentials"),
autorest.WithJSON(requestMessage),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
}
开发者ID:daemonfire300,项目名称:azure-sdk-for-go,代码行数:19,代码来源:global.go
注:本文中的github.com/Azure/go-autorest/autorest.WithJSON函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论