本文整理匯總了Golang中github.com/Azure/go-autorest/autorest.WithBaseURL函數的典型用法代碼示例。如果您正苦於以下問題:Golang WithBaseURL函數的具體用法?Golang WithBaseURL怎麽用?Golang WithBaseURL使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了WithBaseURL函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: UnregisterRequestPreparer
// Create a Preparer by which to prepare the Unregister request.
func (client ProvidersClient) UnregisterRequestPreparer() autorest.Preparer {
return autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseUri),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/unregister"))
}
示例2: ListVersionsPreparer
// ListVersionsPreparer prepare the ListVersions request.
func (client VirtualMachineExtensionImagesClient) ListVersionsPreparer(location string, publisherName string, typeParameter string, filter *string, top *int32, orderBy *string) (*http.Request, error) {
pathParameters := map[string]interface{}{}
pathParameters["location"] = url.QueryEscape(location)
pathParameters["publisherName"] = url.QueryEscape(publisherName)
pathParameters["type"] = url.QueryEscape(typeParameter)
pathParameters["subscriptionId"] = client.GetSubscriptionId()
queryParameters := map[string]interface{}{}
queryParameters["api-version"] = client.GetApiVersion()
if filter != nil {
queryParameters["$filter"] = filter
}
if top != nil {
queryParameters["$top"] = top
}
if orderBy != nil {
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/vmextension/types/{type}/versions"),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
}
示例3: ListPreparer
// ListPreparer prepares the List request.
func (client WorkflowRunActionsClient) ListPreparer(resourceGroupName string, workflowName string, runName string, top *int32, filter string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"runName": url.QueryEscape(runName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"workflowName": url.QueryEscape(workflowName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
if top != nil {
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.Logic/workflows/{workflowName}/runs/{runName}/actions"),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
}
示例4: ListForResourcePreparer
// ListForResourcePreparer prepares the ListForResource request.
func (client PolicyAssignmentsClient) ListForResourcePreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, filter string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"parentResourcePath": url.QueryEscape(parentResourcePath),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"resourceName": url.QueryEscape(resourceName),
"resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
"resourceType": url.QueryEscape(resourceType),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
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/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}providers/Microsoft.Authorization/policyAssignments"),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
}
示例5: ListPreparer
// ListPreparer prepares the List request.
func (client ImportTasksClient) ListPreparer(skip *int32, top *int32, orderby string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"appCollection": autorest.Encode("path", client.AppCollection),
"appName": autorest.Encode("path", client.AppName),
"resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": client.APIVersion,
}
if skip != nil {
queryParameters["$skip"] = autorest.Encode("query", *skip)
}
if top != nil {
queryParameters["$top"] = autorest.Encode("query", *top)
}
if len(orderby) > 0 {
queryParameters["$orderby"] = autorest.Encode("query", orderby)
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MobileEngagement/appcollections/{appCollection}/apps/{appName}/devices/importTasks", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
示例6: LogoutUserPreparer
// LogoutUserPreparer prepares the LogoutUser request.
func (client ManagementClient) LogoutUserPreparer() (*http.Request, error) {
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/user/logout"))
return preparer.Prepare(&http.Request{})
}
示例7: GetMAMPoliciesPreparer
// GetMAMPoliciesPreparer prepares the GetMAMPolicies request.
func (client AndroidClient) GetMAMPoliciesPreparer(hostName string, filter string, top *int32, selectParameter string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"hostName": url.QueryEscape(hostName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
if len(filter) > 0 {
queryParameters["$filter"] = filter
}
if top != nil {
queryParameters["$top"] = top
}
if len(selectParameter) > 0 {
queryParameters["$select"] = selectParameter
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/providers/Microsoft.Intune/locations/{hostName}/androidPolicies"),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
}
示例8: 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"))
}
示例9: InitiateDeviceAuth
// InitiateDeviceAuth initiates a device auth flow. It returns a DeviceCode
// that can be used with CheckForUserCompletion or WaitForUserCompletion.
func InitiateDeviceAuth(client *autorest.Client, oauthConfig OAuthConfig, clientID, resource string) (*DeviceCode, error) {
req, _ := autorest.Prepare(
&http.Request{},
autorest.AsPost(),
autorest.AsFormURLEncoded(),
autorest.WithBaseURL(oauthConfig.DeviceCodeEndpoint.String()),
autorest.WithFormData(url.Values{
"client_id": []string{clientID},
"resource": []string{resource},
}),
)
resp, err := client.Send(req)
if err != nil {
return nil, fmt.Errorf("%s %s: %s", logPrefix, errCodeSendingFails, err)
}
var code DeviceCode
err = autorest.Respond(
resp,
autorest.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&code),
autorest.ByClosing())
if err != nil {
return nil, fmt.Errorf("%s %s: %s", logPrefix, errCodeHandlingFails, err)
}
code.ClientID = clientID
code.Resource = resource
code.OAuthConfig = oauthConfig
return &code, nil
}
示例10: GetRequestPreparer
// Create a Preparer by which to prepare the Get request.
func (client ResourcesClient) GetRequestPreparer() autorest.Preparer {
return autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(client.BaseUri),
autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}"))
}
示例11: CreateOrUpdateRequestPreparer
// Create a Preparer by which to prepare the CreateOrUpdate request.
func (client ServicesClient) CreateOrUpdateRequestPreparer() autorest.Preparer {
return autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseUri),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{serviceName}"))
}
示例12: MoveResourcesRequestPreparer
// Create a Preparer by which to prepare the MoveResources request.
func (client ResourcesClient) MoveResourcesRequestPreparer() autorest.Preparer {
return autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseUri),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/moveResources"))
}
示例13: GetRequestPreparer
// Create a Preparer by which to prepare the Get request.
func (client DeploymentsClient) GetRequestPreparer() autorest.Preparer {
return autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(client.BaseUri),
autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}"))
}
示例14: ValidateRequestPreparer
// Create a Preparer by which to prepare the Validate request.
func (client DeploymentsClient) ValidateRequestPreparer() autorest.Preparer {
return autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseUri),
autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.resources/deployments/{deploymentName}/validate"))
}
示例15: GetAppsPreparer
// GetAppsPreparer prepares the GetApps request.
func (client ManagementClient) GetAppsPreparer(hostName string, filter string, top *int32, selectParameter string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"hostName": autorest.Encode("path", hostName),
}
queryParameters := map[string]interface{}{
"api-version": client.APIVersion,
}
if len(filter) > 0 {
queryParameters["$filter"] = autorest.Encode("query", filter)
}
if top != nil {
queryParameters["$top"] = autorest.Encode("query", *top)
}
if len(selectParameter) > 0 {
queryParameters["$select"] = autorest.Encode("query", selectParameter)
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/providers/Microsoft.Intune/locations/{hostName}/apps", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}