本文整理匯總了Golang中github.com/Azure/go-autorest/autorest.AsJSON函數的典型用法代碼示例。如果您正苦於以下問題:Golang AsJSON函數的具體用法?Golang AsJSON怎麽用?Golang AsJSON使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了AsJSON函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: CheckNameAvailabilityRequestPreparer
// Create a Preparer by which to prepare the CheckNameAvailability request.
func (client StorageAccountsClient) CheckNameAvailabilityRequestPreparer() autorest.Preparer {
return autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseUri),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability"))
}
示例2: ListAllPreparer
// ListAllPreparer prepares the ListAll request.
func (client RecordSetsClient) ListAllPreparer(resourceGroupName string, zoneName string, top string, filter string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"zoneName": url.QueryEscape(zoneName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
if len(top) > 0 {
queryParameters["$top"] = top
}
if len(filter) > 0 {
queryParameters["$filter"] = filter
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnszones/{zoneName}/recordsets"),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
}
示例3: RegenerateSecretKeyRequestPreparer
// Create a Preparer by which to prepare the RegenerateSecretKey request.
func (client WorkflowAccessKeysClient) RegenerateSecretKeyRequestPreparer() autorest.Preparer {
return autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseUri),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/accessKeys/{accessKeyName}/regenerate"))
}
示例4: ListRequestPreparer
// Create a Preparer by which to prepare the List request.
func (client LocalNetworkGatewaysClient) ListRequestPreparer() autorest.Preparer {
return autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(client.BaseUri),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways"))
}
示例5: ListJobHistoryRequestPreparer
// Create a Preparer by which to prepare the ListJobHistory request.
func (client JobsClient) ListJobHistoryRequestPreparer() autorest.Preparer {
return autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(client.BaseUri),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}/history"))
}
示例6: ListRequestPreparer
// Create a Preparer by which to prepare the List request.
func (client ResourceProviderOperationDetailsClient) ListRequestPreparer() autorest.Preparer {
return autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(client.BaseUri),
autorest.WithPath("/providers/{resourceProviderNamespace}/operations"))
}
示例7: CreateOrUpdateRequestPreparer
// Create a Preparer by which to prepare the CreateOrUpdate request.
func (client ResourceGroupsClient) CreateOrUpdateRequestPreparer() autorest.Preparer {
return autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseUri),
autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}"))
}
示例8: 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{})
}
示例9: GetRequestPreparer
// Create a Preparer by which to prepare the Get request.
func (client WorkflowTriggerHistoriesClient) GetRequestPreparer() autorest.Preparer {
return autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(client.BaseUri),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/histories/{historyName}"))
}
示例10: ListPreparer
// ListPreparer prepare the List request.
func (client VirtualMachineScaleSetVMsClient) ListPreparer(resourceGroupName string, virtualMachineScaleSetName string, filter *string, selectParameter *string, expand *string) (*http.Request, error) {
pathParameters := map[string]interface{}{}
pathParameters["resourceGroupName"] = url.QueryEscape(resourceGroupName)
pathParameters["virtualMachineScaleSetName"] = url.QueryEscape(virtualMachineScaleSetName)
pathParameters["subscriptionId"] = client.GetSubscriptionId()
queryParameters := map[string]interface{}{}
queryParameters["api-version"] = client.GetApiVersion()
if filter != nil {
queryParameters["$filter"] = filter
}
if selectParameter != nil {
queryParameters["$select"] = selectParameter
}
if expand != nil {
queryParameters["$expand"] = expand
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines"),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
}
示例11: ListPreparer
// ListPreparer prepares the List request.
func (client VirtualMachineScaleSetVMsClient) ListPreparer(resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"virtualMachineScaleSetName": url.QueryEscape(virtualMachineScaleSetName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
if len(filter) > 0 {
queryParameters["$filter"] = filter
}
if len(selectParameter) > 0 {
queryParameters["$select"] = selectParameter
}
if len(expand) > 0 {
queryParameters["$expand"] = expand
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines"),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
}
示例12: ListPreparer
// ListPreparer prepares the List request.
func (client VirtualMachineImagesClient) ListPreparer(location string, publisherName string, offer string, skus string, filter string, top *int, orderby string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"location": url.QueryEscape(location),
"offer": url.QueryEscape(offer),
"publisherName": url.QueryEscape(publisherName),
"skus": url.QueryEscape(skus),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
if len(filter) > 0 {
queryParameters["$filter"] = filter
}
if top != nil {
queryParameters["$top"] = top
}
if len(orderby) > 0 {
queryParameters["$orderby"] = orderby
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions"),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
}
示例13: RegenerateKeyRequestPreparer
// Create a Preparer by which to prepare the RegenerateKey request.
func (client StorageAccountsClient) RegenerateKeyRequestPreparer() autorest.Preparer {
return autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseUri),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey"))
}
示例14: ListRequestPreparer
// Create a Preparer by which to prepare the List request.
func (client StorageAccountsClient) ListRequestPreparer() autorest.Preparer {
return autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(client.BaseUri),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts"))
}
示例15: ListRequestPreparer
// Create a Preparer by which to prepare the List request.
func (client QueryKeysClient) ListRequestPreparer() autorest.Preparer {
return autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(client.BaseUri),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{serviceName}/listQueryKeys"))
}