Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientFactory ¶
type ClientFactory struct {
// contains filtered or unexported fields
}
ClientFactory is a client factory used to create any client in this module. Don't use this type directly, use NewClientFactory instead.
func NewClientFactory ¶
func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error)
NewClientFactory creates a new instance of ClientFactory with the specified values. The parameter values will be propagated to any client created from this factory.
- subscriptionID - The ID of the target subscription. The value must be an UUID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*ClientFactory) NewDecompileOperationGroupClient ¶
func (c *ClientFactory) NewDecompileOperationGroupClient() *DecompileOperationGroupClient
NewDecompileOperationGroupClient creates a new instance of DecompileOperationGroupClient.
type DecompileOperationGroupClient ¶
type DecompileOperationGroupClient struct {
// contains filtered or unexported fields
}
DecompileOperationGroupClient contains the methods for the DecompileOperationGroup group. Don't use this type directly, use NewDecompileOperationGroupClient() instead.
func NewDecompileOperationGroupClient ¶
func NewDecompileOperationGroupClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DecompileOperationGroupClient, error)
NewDecompileOperationGroupClient creates a new instance of DecompileOperationGroupClient with the specified values.
- subscriptionID - The ID of the target subscription. The value must be an UUID.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*DecompileOperationGroupClient) Bicep ¶
func (client *DecompileOperationGroupClient) Bicep(ctx context.Context, decompileOperationRequest DecompileOperationRequest, options *DecompileOperationGroupClientBicepOptions) (DecompileOperationGroupClientBicepResponse, error)
Bicep - Decompiles an ARM json template into a Bicep template If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2023-11-01
- decompileOperationRequest - The request body
- options - DecompileOperationGroupClientBicepOptions contains the optional parameters for the DecompileOperationGroupClient.Bicep method.
Example ¶
Generated from example definition: 2023-11-01/DecompileBicep.json
package main
import (
"context"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armbicep"
"log"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbicep.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewDecompileOperationGroupClient().Bicep(ctx, armbicep.DecompileOperationRequest{
Template: to.Ptr("{\r\n \"$schema\": \"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\",\r\n \"contentVersion\": \"1.0.0.0\",\r\n \"metadata\": {\r\n \"_generator\": {\r\n \"name\": \"bicep\",\r\n \"version\": \"0.15.31.15270\",\r\n \"templateHash\": \"9249505596133208719\"\r\n }\r\n },\r\n \"parameters\": {\r\n \"storageAccountName\": {\r\n \"type\": \"string\"\r\n }\r\n },\r\n \"resources\": []\r\n}"),
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armbicep.DecompileOperationGroupClientBicepResponse{
// DecompileOperationSuccessResponse: &armbicep.DecompileOperationSuccessResponse{
// EntryPoint: to.Ptr("main.bicep"),
// Files: []*armbicep.FileDefinition{
// {
// Path: to.Ptr("main.bicep"),
// Contents: to.Ptr("param storageAccountName string"),
// },
// },
// },
// }
}
Output:
type DecompileOperationGroupClientBicepOptions ¶
type DecompileOperationGroupClientBicepOptions struct {
}
DecompileOperationGroupClientBicepOptions contains the optional parameters for the DecompileOperationGroupClient.Bicep method.
type DecompileOperationGroupClientBicepResponse ¶
type DecompileOperationGroupClientBicepResponse struct {
// The response of the decompileBicep operation
DecompileOperationSuccessResponse
}
DecompileOperationGroupClientBicepResponse contains the response from method DecompileOperationGroupClient.Bicep.
type DecompileOperationRequest ¶
type DecompileOperationRequest struct {
// REQUIRED; The ARM json template to be decompiled into a Bicep file
Template *string
}
DecompileOperationRequest - The body of the request for the decompileBicep operation
func (DecompileOperationRequest) MarshalJSON ¶
func (d DecompileOperationRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DecompileOperationRequest.
func (*DecompileOperationRequest) UnmarshalJSON ¶
func (d *DecompileOperationRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DecompileOperationRequest.
type DecompileOperationSuccessResponse ¶
type DecompileOperationSuccessResponse struct {
// REQUIRED; The file path to the main Bicep file generated from the decompiled ARM json template.
EntryPoint *string
// REQUIRED; An array of key-value pairs containing the entryPoint string as the key for the Bicep file decompiled from the
// ARM json template
Files []*FileDefinition
}
DecompileOperationSuccessResponse - The response of the decompileBicep operation
func (DecompileOperationSuccessResponse) MarshalJSON ¶
func (d DecompileOperationSuccessResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DecompileOperationSuccessResponse.
func (*DecompileOperationSuccessResponse) UnmarshalJSON ¶
func (d *DecompileOperationSuccessResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DecompileOperationSuccessResponse.
type FileDefinition ¶
type FileDefinition struct {
// The contents of the Bicep file.
Contents *string
// The file path of the Bicep file.
Path *string
}
FileDefinition - The definition of a file along with its contents
func (FileDefinition) MarshalJSON ¶
func (f FileDefinition) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type FileDefinition.
func (*FileDefinition) UnmarshalJSON ¶
func (f *FileDefinition) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type FileDefinition.