armdevhub

package module
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2023 License: MIT Imports: 14 Imported by: 2

README

Azure Devhub Module for Go

PkgGoDev

The armdevhub module provides operations for working with Azure Devhub.

Source code

Getting started

Prerequisites

Install the package

This project uses Go modules for versioning and dependency management.

Install the Azure Devhub module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devhub/armdevhub

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure Devhub. The azidentity module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more.

cred, err := azidentity.NewDefaultAzureCredential(nil)

For more information on authentication, please see the documentation for azidentity at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity.

Client Factory

Azure Devhub module consists of one or more clients. We provide a client factory which could be used to create any client in this module.

clientFactory, err := armdevhub.NewClientFactory(<subscription ID>, cred, nil)

You can use ClientOptions in package github.com/Azure/azure-sdk-for-go/sdk/azcore/arm to set endpoint to connect with public and sovereign clouds as well as Azure Stack. For more information, please see the documentation for azcore at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore.

options := arm.ClientOptions {
    ClientOptions: azcore.ClientOptions {
        Cloud: cloud.AzureChina,
    },
}
clientFactory, err := armdevhub.NewClientFactory(<subscription ID>, cred, &options)

Clients

A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory.

client := clientFactory.NewWorkflowClient()

Fakes

The fake package contains types used for constructing in-memory fake servers used in unit tests. This allows writing tests to cover various success/error conditions without the need for connecting to a live service.

Please see https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/samples/fakes for details and examples on how to use fakes.

Provide Feedback

If you encounter bugs or have suggestions, please open an issue and assign the Devhub label.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ACR

type ACR struct {
	// ACR registry
	AcrRegistryName *string

	// ACR repository
	AcrRepositoryName *string

	// ACR resource group
	AcrResourceGroup *string

	// ACR subscription id
	AcrSubscriptionID *string
}

ACR - Information on the azure container registry

func (ACR) MarshalJSON

func (a ACR) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ACR.

func (*ACR) UnmarshalJSON

func (a *ACR) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ACR.

type ActionType

type ActionType string

ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.

const (
	ActionTypeInternal ActionType = "Internal"
)

func PossibleActionTypeValues

func PossibleActionTypeValues() []ActionType

PossibleActionTypeValues returns the possible values for the ActionType const type.

type ArtifactGenerationProperties added in v0.4.0

type ArtifactGenerationProperties struct {
	// The name of the app.
	AppName *string

	// The version of the language image used for building the code in the generated dockerfile.
	BuilderVersion *string

	// The mode of generation to be used for generating Dockerfiles.
	DockerfileGenerationMode *DockerfileGenerationMode

	// The directory to output the generated Dockerfile to.
	DockerfileOutputDirectory *string

	// The programming language used.
	GenerationLanguage *GenerationLanguage

	// The name of the image to be generated.
	ImageName *string

	// The tag to apply to the generated image.
	ImageTag *string

	// The version of the language image used for execution in the generated dockerfile.
	LanguageVersion *string

	// The mode of generation to be used for generating Manifest.
	ManifestGenerationMode *ManifestGenerationMode

	// The directory to output the generated manifests to.
	ManifestOutputDirectory *string

	// Determines the type of manifests to be generated.
	ManifestType *GenerationManifestType

	// The namespace to deploy the application to.
	Namespace *string

	// The port the application is exposed on.
	Port *string
}

ArtifactGenerationProperties - Properties used for generating artifacts such as Dockerfiles and manifests.

func (ArtifactGenerationProperties) MarshalJSON added in v0.4.0

func (a ArtifactGenerationProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ArtifactGenerationProperties.

func (*ArtifactGenerationProperties) UnmarshalJSON added in v0.4.0

func (a *ArtifactGenerationProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ArtifactGenerationProperties.

type AuthorizationStatus added in v0.4.0

type AuthorizationStatus string

AuthorizationStatus - Determines the authorization status of requests.

const (
	// AuthorizationStatusAuthorized - Requests authorized successfully
	AuthorizationStatusAuthorized AuthorizationStatus = "Authorized"
	// AuthorizationStatusError - Requests returned other error response
	AuthorizationStatusError AuthorizationStatus = "Error"
	// AuthorizationStatusNotFound - Requests returned NotFound response
	AuthorizationStatusNotFound AuthorizationStatus = "NotFound"
)

func PossibleAuthorizationStatusValues added in v0.4.0

func PossibleAuthorizationStatusValues() []AuthorizationStatus

PossibleAuthorizationStatusValues returns the possible values for the AuthorizationStatus const type.

type ClientFactory added in v0.3.0

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 added in v0.3.0

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.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ClientFactory) NewDeveloperHubServiceClient added in v0.3.0

func (c *ClientFactory) NewDeveloperHubServiceClient() *DeveloperHubServiceClient

NewDeveloperHubServiceClient creates a new instance of DeveloperHubServiceClient.

func (*ClientFactory) NewOperationsClient added in v0.3.0

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

func (*ClientFactory) NewWorkflowClient added in v0.3.0

func (c *ClientFactory) NewWorkflowClient() *WorkflowClient

NewWorkflowClient creates a new instance of WorkflowClient.

type CreatedByType

type CreatedByType string

CreatedByType - The type of identity that created the resource.

const (
	CreatedByTypeApplication     CreatedByType = "Application"
	CreatedByTypeKey             CreatedByType = "Key"
	CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity"
	CreatedByTypeUser            CreatedByType = "User"
)

func PossibleCreatedByTypeValues

func PossibleCreatedByTypeValues() []CreatedByType

PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.

type DeleteWorkflowResponse

type DeleteWorkflowResponse struct {
	// delete status message
	Status *string
}

DeleteWorkflowResponse - delete response if content must be provided on delete operation

func (DeleteWorkflowResponse) MarshalJSON

func (d DeleteWorkflowResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DeleteWorkflowResponse.

func (*DeleteWorkflowResponse) UnmarshalJSON

func (d *DeleteWorkflowResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DeleteWorkflowResponse.

type DeploymentProperties

type DeploymentProperties struct {
	// Helm chart directory path in repository.
	HelmChartPath *string

	// Helm Values.yaml file location in repository.
	HelmValues            *string
	KubeManifestLocations []*string

	// Determines the type of manifests within the repository.
	ManifestType *ManifestType

	// Manifest override values.
	Overrides map[string]*string
}

func (DeploymentProperties) MarshalJSON

func (d DeploymentProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DeploymentProperties.

func (*DeploymentProperties) UnmarshalJSON

func (d *DeploymentProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentProperties.

type DeveloperHubServiceClient

type DeveloperHubServiceClient struct {
	// contains filtered or unexported fields
}

DeveloperHubServiceClient contains the methods for the DeveloperHubServiceClient group. Don't use this type directly, use NewDeveloperHubServiceClient() instead.

func NewDeveloperHubServiceClient

func NewDeveloperHubServiceClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DeveloperHubServiceClient, error)

NewDeveloperHubServiceClient creates a new instance of DeveloperHubServiceClient with the specified values.

  • subscriptionID - The ID of the target subscription.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*DeveloperHubServiceClient) GeneratePreviewArtifacts added in v0.4.0

GeneratePreviewArtifacts - Generate preview dockerfile and manifests. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-11-preview

  • location - The name of Azure region.
  • options - DeveloperHubServiceClientGeneratePreviewArtifactsOptions contains the optional parameters for the DeveloperHubServiceClient.GeneratePreviewArtifacts method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-10-11-preview/examples/GeneratePreviewArtifacts.json

package main

import (
	"context"
	"log"

	"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/devhub/armdevhub"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevhub.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDeveloperHubServiceClient().GeneratePreviewArtifacts(ctx, "location1", armdevhub.ArtifactGenerationProperties{
		AppName:                   to.Ptr("my-app"),
		DockerfileGenerationMode:  to.Ptr(armdevhub.DockerfileGenerationModeEnabled),
		DockerfileOutputDirectory: to.Ptr("./"),
		GenerationLanguage:        to.Ptr(armdevhub.GenerationLanguageJavascript),
		ImageName:                 to.Ptr("myimage"),
		ImageTag:                  to.Ptr("latest"),
		LanguageVersion:           to.Ptr("14"),
		ManifestGenerationMode:    to.Ptr(armdevhub.ManifestGenerationModeEnabled),
		ManifestOutputDirectory:   to.Ptr("./"),
		ManifestType:              to.Ptr(armdevhub.GenerationManifestTypeKube),
		Namespace:                 to.Ptr("my-namespace"),
		Port:                      to.Ptr("80"),
	}, 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.Value = map[string]*string{
	// 	"dockerfiles/example-dockerfile": to.Ptr("dockerfile-content \n including newlines"),
	// 	"manifests/example-manifest-file-1": to.Ptr("manifest file 1 content \n including newlines"),
	// 	"manifests/example-manifest-file-2": to.Ptr("manifest file 2 content \n including newlines"),
	// }
}
Output:

func (*DeveloperHubServiceClient) GitHubOAuth

GitHubOAuth - Gets GitHubOAuth info used to authenticate users with the Developer Hub GitHub App. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-11-preview

  • location - The name of Azure region.
  • options - DeveloperHubServiceClientGitHubOAuthOptions contains the optional parameters for the DeveloperHubServiceClient.GitHubOAuth method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-10-11-preview/examples/GitHubOAuth.json

package main

import (
	"context"
	"log"

	"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/devhub/armdevhub"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevhub.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDeveloperHubServiceClient().GitHubOAuth(ctx, "eastus2euap", &armdevhub.DeveloperHubServiceClientGitHubOAuthOptions{Parameters: &armdevhub.GitHubOAuthCallRequest{
		RedirectURL: to.Ptr("https://ms.portal.azure.com/aks"),
	},
	})
	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.GitHubOAuthInfoResponse = armdevhub.GitHubOAuthInfoResponse{
	// 	AuthURL: to.Ptr("https://github.com/login/oauth/authorize?client_id=11111111&redirect_uri=https://management.azure.com/subscriptions/subscriptionId1/providers/Microsoft.DevHub/locations/eastus2euap/githuboauth&state=2345678-3456-7890-5678-012345678901&scope=repo,user:email,workflow"),
	// 	Token: to.Ptr(""),
	// }
}
Output:

func (*DeveloperHubServiceClient) GitHubOAuthCallback

GitHubOAuthCallback - Callback URL to hit once authenticated with GitHub App to have the service store the OAuth token. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-11-preview

  • location - The name of Azure region.
  • code - The code response from authenticating the GitHub App.
  • state - The state response from authenticating the GitHub App.
  • options - DeveloperHubServiceClientGitHubOAuthCallbackOptions contains the optional parameters for the DeveloperHubServiceClient.GitHubOAuthCallback method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-10-11-preview/examples/GitHubOAuthCallback.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devhub/armdevhub"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevhub.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDeveloperHubServiceClient().GitHubOAuthCallback(ctx, "eastus2euap", "3584d83530557fdd1f46af8289938c8ef79f9dc5", "12345678-3456-7890-5678-012345678901", 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.GitHubOAuthResponse = armdevhub.GitHubOAuthResponse{
	// 	Name: to.Ptr("default"),
	// 	Type: to.Ptr("Microsoft.DevHub/locations/githuboauth"),
	// 	ID: to.Ptr("/subscriptions/subscriptionId1/providers/Microsoft.DevHub/locations/eastus2euap/githuboauth/default"),
	// 	Properties: &armdevhub.GitHubOAuthProperties{
	// 		Username: to.Ptr("user"),
	// 	},
	// }
}
Output:

func (*DeveloperHubServiceClient) ListGitHubOAuth

ListGitHubOAuth - Callback URL to hit once authenticated with GitHub App to have the service store the OAuth token. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-11-preview

  • location - The name of Azure region.
  • options - DeveloperHubServiceClientListGitHubOAuthOptions contains the optional parameters for the DeveloperHubServiceClient.ListGitHubOAuth method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-10-11-preview/examples/GitHubOAuth_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devhub/armdevhub"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevhub.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewDeveloperHubServiceClient().ListGitHubOAuth(ctx, "eastus2euap", 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.GitHubOAuthListResponse = armdevhub.GitHubOAuthListResponse{
	// 	Value: []*armdevhub.GitHubOAuthResponse{
	// 		{
	// 			Name: to.Ptr("default"),
	// 			Type: to.Ptr("Microsoft.DevHub/locations/githuboauth"),
	// 			ID: to.Ptr("/subscriptions/subscriptionId1/providers/Microsoft.DevHub/locations/eastus2euap/githuboauth/default"),
	// 			Properties: &armdevhub.GitHubOAuthProperties{
	// 				Username: to.Ptr("user"),
	// 			},
	// 	}},
	// }
}
Output:

type DeveloperHubServiceClientGeneratePreviewArtifactsOptions added in v0.4.0

type DeveloperHubServiceClientGeneratePreviewArtifactsOptions struct {
}

DeveloperHubServiceClientGeneratePreviewArtifactsOptions contains the optional parameters for the DeveloperHubServiceClient.GeneratePreviewArtifacts method.

type DeveloperHubServiceClientGeneratePreviewArtifactsResponse added in v0.4.0

type DeveloperHubServiceClientGeneratePreviewArtifactsResponse struct {
	// Dockerfile and manifest artifacts generated as a preview are returned as a map<path string,content string>
	Value map[string]*string
}

DeveloperHubServiceClientGeneratePreviewArtifactsResponse contains the response from method DeveloperHubServiceClient.GeneratePreviewArtifacts.

type DeveloperHubServiceClientGitHubOAuthCallbackOptions

type DeveloperHubServiceClientGitHubOAuthCallbackOptions struct {
}

DeveloperHubServiceClientGitHubOAuthCallbackOptions contains the optional parameters for the DeveloperHubServiceClient.GitHubOAuthCallback method.

type DeveloperHubServiceClientGitHubOAuthCallbackResponse

type DeveloperHubServiceClientGitHubOAuthCallbackResponse struct {
	// Singleton response of GitHubOAuth containing
	GitHubOAuthResponse
}

DeveloperHubServiceClientGitHubOAuthCallbackResponse contains the response from method DeveloperHubServiceClient.GitHubOAuthCallback.

type DeveloperHubServiceClientGitHubOAuthOptions

type DeveloperHubServiceClientGitHubOAuthOptions struct {
	Parameters *GitHubOAuthCallRequest
}

DeveloperHubServiceClientGitHubOAuthOptions contains the optional parameters for the DeveloperHubServiceClient.GitHubOAuth method.

type DeveloperHubServiceClientGitHubOAuthResponse

type DeveloperHubServiceClientGitHubOAuthResponse struct {
	// URL used to authorize the Developer Hub GitHub App
	GitHubOAuthInfoResponse
}

DeveloperHubServiceClientGitHubOAuthResponse contains the response from method DeveloperHubServiceClient.GitHubOAuth.

type DeveloperHubServiceClientListGitHubOAuthOptions

type DeveloperHubServiceClientListGitHubOAuthOptions struct {
}

DeveloperHubServiceClientListGitHubOAuthOptions contains the optional parameters for the DeveloperHubServiceClient.ListGitHubOAuth method.

type DeveloperHubServiceClientListGitHubOAuthResponse

type DeveloperHubServiceClientListGitHubOAuthResponse struct {
	// The response from List GitHubOAuth operation.
	GitHubOAuthListResponse
}

DeveloperHubServiceClientListGitHubOAuthResponse contains the response from method DeveloperHubServiceClient.ListGitHubOAuth.

type DockerfileGenerationMode added in v0.4.0

type DockerfileGenerationMode string

DockerfileGenerationMode - The mode of generation to be used for generating Dockerfiles.

const (
	// DockerfileGenerationModeDisabled - Dockerfiles will not be generated
	DockerfileGenerationModeDisabled DockerfileGenerationMode = "disabled"
	// DockerfileGenerationModeEnabled - Dockerfiles will be generated
	DockerfileGenerationModeEnabled DockerfileGenerationMode = "enabled"
)

func PossibleDockerfileGenerationModeValues added in v0.4.0

func PossibleDockerfileGenerationModeValues() []DockerfileGenerationMode

PossibleDockerfileGenerationModeValues returns the possible values for the DockerfileGenerationMode const type.

type GenerationLanguage added in v0.4.0

type GenerationLanguage string

GenerationLanguage - The programming language used.

const (
	// GenerationLanguageClojure - clojure language
	GenerationLanguageClojure GenerationLanguage = "clojure"
	// GenerationLanguageCsharp - csharp language
	GenerationLanguageCsharp GenerationLanguage = "csharp"
	// GenerationLanguageErlang - erlang language
	GenerationLanguageErlang GenerationLanguage = "erlang"
	// GenerationLanguageGo - go language
	GenerationLanguageGo GenerationLanguage = "go"
	// GenerationLanguageGomodule - gomodule language
	GenerationLanguageGomodule GenerationLanguage = "gomodule"
	// GenerationLanguageGradle - gradle language
	GenerationLanguageGradle GenerationLanguage = "gradle"
	// GenerationLanguageJava - java language
	GenerationLanguageJava GenerationLanguage = "java"
	// GenerationLanguageJavascript - javascript language
	GenerationLanguageJavascript GenerationLanguage = "javascript"
	// GenerationLanguagePhp - php language
	GenerationLanguagePhp GenerationLanguage = "php"
	// GenerationLanguagePython - python language
	GenerationLanguagePython GenerationLanguage = "python"
	// GenerationLanguageRuby - ruby language
	GenerationLanguageRuby GenerationLanguage = "ruby"
	// GenerationLanguageRust - rust language
	GenerationLanguageRust GenerationLanguage = "rust"
	// GenerationLanguageSwift - swift language
	GenerationLanguageSwift GenerationLanguage = "swift"
)

func PossibleGenerationLanguageValues added in v0.4.0

func PossibleGenerationLanguageValues() []GenerationLanguage

PossibleGenerationLanguageValues returns the possible values for the GenerationLanguage const type.

type GenerationManifestType added in v0.4.0

type GenerationManifestType string

GenerationManifestType - Determines the type of manifests to be generated.

const (
	// GenerationManifestTypeHelm - Helm manifests
	GenerationManifestTypeHelm GenerationManifestType = "helm"
	// GenerationManifestTypeKube - Kubernetes manifests
	GenerationManifestTypeKube GenerationManifestType = "kube"
)

func PossibleGenerationManifestTypeValues added in v0.4.0

func PossibleGenerationManifestTypeValues() []GenerationManifestType

PossibleGenerationManifestTypeValues returns the possible values for the GenerationManifestType const type.

type GitHubOAuthCallRequest

type GitHubOAuthCallRequest struct {
	// The URL the client will redirect to on successful authentication. If empty, no redirect will occur.
	RedirectURL *string
}

GitHubOAuthCallRequest - GitHubOAuth request object

func (GitHubOAuthCallRequest) MarshalJSON

func (g GitHubOAuthCallRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GitHubOAuthCallRequest.

func (*GitHubOAuthCallRequest) UnmarshalJSON

func (g *GitHubOAuthCallRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GitHubOAuthCallRequest.

type GitHubOAuthInfoResponse

type GitHubOAuthInfoResponse struct {
	// URL for authorizing the Developer Hub GitHub App
	AuthURL *string

	// OAuth token used to make calls to GitHub
	Token *string
}

GitHubOAuthInfoResponse - URL used to authorize the Developer Hub GitHub App

func (GitHubOAuthInfoResponse) MarshalJSON

func (g GitHubOAuthInfoResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GitHubOAuthInfoResponse.

func (*GitHubOAuthInfoResponse) UnmarshalJSON

func (g *GitHubOAuthInfoResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GitHubOAuthInfoResponse.

type GitHubOAuthListResponse

type GitHubOAuthListResponse struct {
	// Singleton list response containing one GitHubOAuthResponse response
	Value []*GitHubOAuthResponse
}

GitHubOAuthListResponse - The response from List GitHubOAuth operation.

func (GitHubOAuthListResponse) MarshalJSON

func (g GitHubOAuthListResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GitHubOAuthListResponse.

func (*GitHubOAuthListResponse) UnmarshalJSON

func (g *GitHubOAuthListResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GitHubOAuthListResponse.

type GitHubOAuthProperties

type GitHubOAuthProperties struct {
	// user making request
	Username *string
}

GitHubOAuthProperties - The response from List GitHubOAuth operation.

func (GitHubOAuthProperties) MarshalJSON

func (g GitHubOAuthProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GitHubOAuthProperties.

func (*GitHubOAuthProperties) UnmarshalJSON

func (g *GitHubOAuthProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GitHubOAuthProperties.

type GitHubOAuthResponse

type GitHubOAuthResponse struct {
	// Properties of a workflow.
	Properties *GitHubOAuthProperties

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

GitHubOAuthResponse - Singleton response of GitHubOAuth containing

func (GitHubOAuthResponse) MarshalJSON

func (g GitHubOAuthResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GitHubOAuthResponse.

func (*GitHubOAuthResponse) UnmarshalJSON

func (g *GitHubOAuthResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GitHubOAuthResponse.

type GitHubWorkflowProfile

type GitHubWorkflowProfile struct {
	// Information on the azure container registry
	Acr *ACR

	// The Azure Kubernetes Cluster Resource the application will be deployed to.
	AksResourceID *string

	// Repository Branch Name
	BranchName           *string
	DeploymentProperties *DeploymentProperties

	// Path to Dockerfile Build Context within the repository.
	DockerBuildContext *string

	// Path to the Dockerfile within the repository.
	Dockerfile      *string
	LastWorkflowRun *WorkflowRun

	// Kubernetes namespace the application is deployed to.
	Namespace *string

	// The fields needed for OIDC with GitHub.
	OidcCredentials *GitHubWorkflowProfileOidcCredentials

	// Repository Name
	RepositoryName *string

	// Repository Owner
	RepositoryOwner *string

	// READ-ONLY; Determines the authorization status of requests.
	AuthStatus *AuthorizationStatus

	// READ-ONLY; The status of the Pull Request submitted against the users repository.
	PrStatus *PullRequestStatus

	// READ-ONLY; The URL to the Pull Request submitted against the users repository.
	PrURL *string

	// READ-ONLY; The number associated with the submitted pull request.
	PullNumber *int32
}

GitHubWorkflowProfile - GitHub Workflow Profile

func (GitHubWorkflowProfile) MarshalJSON

func (g GitHubWorkflowProfile) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GitHubWorkflowProfile.

func (*GitHubWorkflowProfile) UnmarshalJSON

func (g *GitHubWorkflowProfile) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GitHubWorkflowProfile.

type GitHubWorkflowProfileOidcCredentials

type GitHubWorkflowProfileOidcCredentials struct {
	// Azure Application Client ID
	AzureClientID *string

	// Azure Directory (tenant) ID
	AzureTenantID *string
}

GitHubWorkflowProfileOidcCredentials - The fields needed for OIDC with GitHub.

func (GitHubWorkflowProfileOidcCredentials) MarshalJSON

func (g GitHubWorkflowProfileOidcCredentials) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GitHubWorkflowProfileOidcCredentials.

func (*GitHubWorkflowProfileOidcCredentials) UnmarshalJSON

func (g *GitHubWorkflowProfileOidcCredentials) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GitHubWorkflowProfileOidcCredentials.

type ManifestGenerationMode added in v0.4.0

type ManifestGenerationMode string

ManifestGenerationMode - The mode of generation to be used for generating Manifest.

const (
	// ManifestGenerationModeDisabled - Manifests will not be generated
	ManifestGenerationModeDisabled ManifestGenerationMode = "disabled"
	// ManifestGenerationModeEnabled - Manifests will be generated
	ManifestGenerationModeEnabled ManifestGenerationMode = "enabled"
)

func PossibleManifestGenerationModeValues added in v0.4.0

func PossibleManifestGenerationModeValues() []ManifestGenerationMode

PossibleManifestGenerationModeValues returns the possible values for the ManifestGenerationMode const type.

type ManifestType

type ManifestType string

ManifestType - Determines the type of manifests within the repository.

const (
	// ManifestTypeHelm - Repositories using helm
	ManifestTypeHelm ManifestType = "helm"
	// ManifestTypeKube - Repositories using kubernetes manifests
	ManifestTypeKube ManifestType = "kube"
)

func PossibleManifestTypeValues

func PossibleManifestTypeValues() []ManifestType

PossibleManifestTypeValues returns the possible values for the ManifestType const type.

type Operation

type Operation struct {
	// Localized display information for this particular operation.
	Display *OperationDisplay

	// READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
	ActionType *ActionType

	// READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane
	// operations.
	IsDataAction *bool

	// READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write",
	// "Microsoft.Compute/virtualMachines/capture/action"
	Name *string

	// READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default
	// value is "user,system"
	Origin *Origin
}

Operation - Details of a REST API operation, returned from the Resource Provider Operations API

func (Operation) MarshalJSON

func (o Operation) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Operation.

func (*Operation) UnmarshalJSON

func (o *Operation) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Operation.

type OperationDisplay

type OperationDisplay struct {
	// READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views.
	Description *string

	// READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual
	// Machine", "Restart Virtual Machine".
	Operation *string

	// READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft
	// Compute".
	Provider *string

	// READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job
	// Schedule Collections".
	Resource *string
}

OperationDisplay - Localized display information for this particular operation.

func (OperationDisplay) MarshalJSON

func (o OperationDisplay) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationDisplay.

func (*OperationDisplay) UnmarshalJSON

func (o *OperationDisplay) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.

type OperationListResult

type OperationListResult struct {
	// READ-ONLY; URL to get the next set of operation list results (if there are any).
	NextLink *string

	// READ-ONLY; List of operations supported by the resource provider
	Value []*Operation
}

OperationListResult - A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.

func (OperationListResult) MarshalJSON

func (o OperationListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationListResult.

func (*OperationListResult) UnmarshalJSON

func (o *OperationListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.

type OperationsClient

type OperationsClient struct {
	// contains filtered or unexported fields
}

OperationsClient contains the methods for the Operations group. Don't use this type directly, use NewOperationsClient() instead.

func NewOperationsClient

func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error)

NewOperationsClient creates a new instance of OperationsClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*OperationsClient) List

List - Returns list of operations. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-11-preview

  • options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-10-11-preview/examples/Operation_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devhub/armdevhub"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevhub.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewOperationsClient().List(ctx, 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.OperationListResult = armdevhub.OperationListResult{
	// 	Value: []*armdevhub.Operation{
	// 		{
	// 			Name: to.Ptr("Microsoft.DevHub/workflows/read"),
	// 			Display: &armdevhub.OperationDisplay{
	// 				Description: to.Ptr("Gets workflow"),
	// 				Operation: to.Ptr("Get workflow"),
	// 				Provider: to.Ptr("Microsoft Developer Hub"),
	// 				Resource: to.Ptr("Workflows"),
	// 			},
	// 	}},
	// }
}
Output:

type OperationsClientListOptions

type OperationsClientListOptions struct {
}

OperationsClientListOptions contains the optional parameters for the OperationsClient.List method.

type OperationsClientListResponse

type OperationsClientListResponse struct {
	// A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.
	OperationListResult
}

OperationsClientListResponse contains the response from method OperationsClient.List.

type Origin

type Origin string

Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system"

const (
	OriginSystem     Origin = "system"
	OriginUser       Origin = "user"
	OriginUserSystem Origin = "user,system"
)

func PossibleOriginValues

func PossibleOriginValues() []Origin

PossibleOriginValues returns the possible values for the Origin const type.

type PullRequestStatus

type PullRequestStatus string

PullRequestStatus - The status of the Pull Request submitted against the users repository.

const (
	// PullRequestStatusMerged - Pull Request merged into repository.
	PullRequestStatusMerged PullRequestStatus = "merged"
	// PullRequestStatusRemoved - Workflow no longer found within repository.
	PullRequestStatusRemoved PullRequestStatus = "removed"
	// PullRequestStatusSubmitted - Pull Request submitted to repository.
	PullRequestStatusSubmitted PullRequestStatus = "submitted"
	// PullRequestStatusUnknown - Pull Request state unknown.
	PullRequestStatusUnknown PullRequestStatus = "unknown"
)

func PossiblePullRequestStatusValues

func PossiblePullRequestStatusValues() []PullRequestStatus

PossiblePullRequestStatusValues returns the possible values for the PullRequestStatus const type.

type SystemData

type SystemData struct {
	// The timestamp of resource creation (UTC).
	CreatedAt *time.Time

	// The identity that created the resource.
	CreatedBy *string

	// The type of identity that created the resource.
	CreatedByType *CreatedByType

	// The timestamp of resource last modification (UTC)
	LastModifiedAt *time.Time

	// The identity that last modified the resource.
	LastModifiedBy *string

	// The type of identity that last modified the resource.
	LastModifiedByType *CreatedByType
}

SystemData - Metadata pertaining to creation and last modification of the resource.

func (SystemData) MarshalJSON

func (s SystemData) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SystemData.

func (*SystemData) UnmarshalJSON

func (s *SystemData) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.

type TagsObject

type TagsObject struct {
	// Dictionary of
	Tags map[string]*string
}

TagsObject - Resource tags.

func (TagsObject) MarshalJSON

func (t TagsObject) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TagsObject.

func (*TagsObject) UnmarshalJSON

func (t *TagsObject) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TagsObject.

type Workflow

type Workflow struct {
	// REQUIRED; The geo-location where the resource lives
	Location *string

	// Properties of a workflow.
	Properties *WorkflowProperties

	// Resource tags.
	Tags map[string]*string

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

Workflow - Resource representation of a workflow

func (Workflow) MarshalJSON

func (w Workflow) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Workflow.

func (*Workflow) UnmarshalJSON

func (w *Workflow) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Workflow.

type WorkflowClient

type WorkflowClient struct {
	// contains filtered or unexported fields
}

WorkflowClient contains the methods for the Workflow group. Don't use this type directly, use NewWorkflowClient() instead.

func NewWorkflowClient

func NewWorkflowClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WorkflowClient, error)

NewWorkflowClient creates a new instance of WorkflowClient with the specified values.

  • subscriptionID - The ID of the target subscription.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*WorkflowClient) CreateOrUpdate

func (client *WorkflowClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workflowName string, parameters Workflow, options *WorkflowClientCreateOrUpdateOptions) (WorkflowClientCreateOrUpdateResponse, error)

CreateOrUpdate - Creates or updates a workflow If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-11-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • workflowName - The name of the workflow resource.
  • options - WorkflowClientCreateOrUpdateOptions contains the optional parameters for the WorkflowClient.CreateOrUpdate method.
Example (CreateWorkflow)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-10-11-preview/examples/Workflow_CreateOrUpdate.json

package main

import (
	"context"
	"log"

	"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/devhub/armdevhub"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevhub.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewWorkflowClient().CreateOrUpdate(ctx, "resourceGroup1", "workflow1", armdevhub.Workflow{
		Location: to.Ptr("location1"),
		Tags: map[string]*string{
			"appname": to.Ptr("testApp"),
		},
		Properties: &armdevhub.WorkflowProperties{
			GithubWorkflowProfile: &armdevhub.GitHubWorkflowProfile{
				Acr: &armdevhub.ACR{
					AcrRegistryName:   to.Ptr("registry1"),
					AcrRepositoryName: to.Ptr("repo1"),
					AcrResourceGroup:  to.Ptr("resourceGroup1"),
					AcrSubscriptionID: to.Ptr("subscriptionId1"),
				},
				AksResourceID: to.Ptr("/subscriptions/subscriptionId1/resourcegroups/resourceGroup1/providers/Microsoft.ContainerService/managedClusters/cluster1"),
				BranchName:    to.Ptr("branch1"),
				DeploymentProperties: &armdevhub.DeploymentProperties{
					KubeManifestLocations: []*string{
						to.Ptr("/src/manifests/")},
					ManifestType: to.Ptr(armdevhub.ManifestTypeKube),
					Overrides: map[string]*string{
						"key1": to.Ptr("value1"),
					},
				},
				DockerBuildContext: to.Ptr("repo1/src/"),
				Dockerfile:         to.Ptr("repo1/images/Dockerfile"),
				Namespace:          to.Ptr("namespace1"),
				OidcCredentials: &armdevhub.GitHubWorkflowProfileOidcCredentials{
					AzureClientID: to.Ptr("12345678-3456-7890-5678-012345678901"),
					AzureTenantID: to.Ptr("66666666-3456-7890-5678-012345678901"),
				},
				RepositoryName:  to.Ptr("repo1"),
				RepositoryOwner: to.Ptr("owner1"),
			},
		},
	}, 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.Workflow = armdevhub.Workflow{
	// 	Name: to.Ptr("workflow1"),
	// 	Type: to.Ptr("Micfosoft.DevHub/Workflow"),
	// 	ID: to.Ptr("/subscription/subscriptionId1/resourceGroups/resourceGroup1/providers/Microsoft.DevHub/workflow/workflow1"),
	// 	SystemData: &armdevhub.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55.000Z"); return t}()),
	// 		CreatedBy: to.Ptr("foo@contoso.com"),
	// 		CreatedByType: to.Ptr(armdevhub.CreatedByTypeUser),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55.000Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("foo@contoso.com"),
	// 		LastModifiedByType: to.Ptr(armdevhub.CreatedByTypeUser),
	// 	},
	// 	Location: to.Ptr("location1"),
	// 	Tags: map[string]*string{
	// 		"appname": to.Ptr("testapp"),
	// 	},
	// 	Properties: &armdevhub.WorkflowProperties{
	// 		GithubWorkflowProfile: &armdevhub.GitHubWorkflowProfile{
	// 			Acr: &armdevhub.ACR{
	// 				AcrRegistryName: to.Ptr("registry1"),
	// 				AcrRepositoryName: to.Ptr("repo1"),
	// 				AcrResourceGroup: to.Ptr("resourceGroup1"),
	// 				AcrSubscriptionID: to.Ptr("subscriptionId1"),
	// 			},
	// 			AksResourceID: to.Ptr("/subscriptions/subscriptionId1/resourcegroups/resourceGroup1/providers/Microsoft.ContainerService/managedClusters/cluster1"),
	// 			AuthStatus: to.Ptr(armdevhub.AuthorizationStatusAuthorized),
	// 			BranchName: to.Ptr("branch2"),
	// 			DeploymentProperties: &armdevhub.DeploymentProperties{
	// 				HelmChartPath: to.Ptr("/src/charts"),
	// 				HelmValues: to.Ptr("/src/chars/values.yaml"),
	// 				ManifestType: to.Ptr(armdevhub.ManifestTypeHelm),
	// 				Overrides: map[string]*string{
	// 					"key1": to.Ptr("value1"),
	// 				},
	// 			},
	// 			DockerBuildContext: to.Ptr("repo2/src/"),
	// 			Dockerfile: to.Ptr("repo2/images/Dockerfile"),
	// 			OidcCredentials: &armdevhub.GitHubWorkflowProfileOidcCredentials{
	// 				AzureClientID: to.Ptr("12345678-3456-7890-5678-012345678901"),
	// 				AzureTenantID: to.Ptr("66666666-3456-7890-5678-012345678901"),
	// 			},
	// 			PrStatus: to.Ptr(armdevhub.PullRequestStatusSubmitted),
	// 			PrURL: to.Ptr("https://github.com/User/repo2/pull/6567"),
	// 			PullNumber: to.Ptr[int32](6567),
	// 			RepositoryName: to.Ptr("repo2"),
	// 			RepositoryOwner: to.Ptr("owner1"),
	// 		},
	// 	},
	// }
}
Output:

Example (CreateWorkflowWithArtifactGeneration)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-10-11-preview/examples/Workflow_CreateOrUpdate_WithArtifactGen.json

package main

import (
	"context"
	"log"

	"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/devhub/armdevhub"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevhub.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewWorkflowClient().CreateOrUpdate(ctx, "resourceGroup1", "workflow1", armdevhub.Workflow{
		Location: to.Ptr("location1"),
		Tags: map[string]*string{
			"appname": to.Ptr("testApp"),
		},
		Properties: &armdevhub.WorkflowProperties{
			ArtifactGenerationProperties: &armdevhub.ArtifactGenerationProperties{
				AppName:                   to.Ptr("my-app"),
				DockerfileGenerationMode:  to.Ptr(armdevhub.DockerfileGenerationModeEnabled),
				DockerfileOutputDirectory: to.Ptr("./"),
				GenerationLanguage:        to.Ptr(armdevhub.GenerationLanguageJavascript),
				ImageName:                 to.Ptr("myimage"),
				ImageTag:                  to.Ptr("latest"),
				LanguageVersion:           to.Ptr("14"),
				ManifestGenerationMode:    to.Ptr(armdevhub.ManifestGenerationModeEnabled),
				ManifestOutputDirectory:   to.Ptr("./"),
				ManifestType:              to.Ptr(armdevhub.GenerationManifestTypeKube),
				Namespace:                 to.Ptr("my-namespace"),
				Port:                      to.Ptr("80"),
			},
			GithubWorkflowProfile: &armdevhub.GitHubWorkflowProfile{
				Acr: &armdevhub.ACR{
					AcrRegistryName:   to.Ptr("registry1"),
					AcrRepositoryName: to.Ptr("repo1"),
					AcrResourceGroup:  to.Ptr("resourceGroup1"),
					AcrSubscriptionID: to.Ptr("subscriptionId1"),
				},
				AksResourceID: to.Ptr("/subscriptions/subscriptionId1/resourcegroups/resourceGroup1/providers/Microsoft.ContainerService/managedClusters/cluster1"),
				BranchName:    to.Ptr("branch1"),
				DeploymentProperties: &armdevhub.DeploymentProperties{
					KubeManifestLocations: []*string{
						to.Ptr("/src/manifests/")},
					ManifestType: to.Ptr(armdevhub.ManifestTypeKube),
					Overrides: map[string]*string{
						"key1": to.Ptr("value1"),
					},
				},
				DockerBuildContext: to.Ptr("repo1/src/"),
				Dockerfile:         to.Ptr("repo1/images/Dockerfile"),
				OidcCredentials: &armdevhub.GitHubWorkflowProfileOidcCredentials{
					AzureClientID: to.Ptr("12345678-3456-7890-5678-012345678901"),
					AzureTenantID: to.Ptr("66666666-3456-7890-5678-012345678901"),
				},
				RepositoryName:  to.Ptr("repo1"),
				RepositoryOwner: to.Ptr("owner1"),
			},
		},
	}, 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.Workflow = armdevhub.Workflow{
	// 	Name: to.Ptr("workflow1"),
	// 	Type: to.Ptr("Micfosoft.DevHub/Workflow"),
	// 	ID: to.Ptr("/subscription/subscriptionId1/resourceGroups/resourceGroup1/providers/Microsoft.DevHub/workflow/workflow1"),
	// 	SystemData: &armdevhub.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55.000Z"); return t}()),
	// 		CreatedBy: to.Ptr("foo@contoso.com"),
	// 		CreatedByType: to.Ptr(armdevhub.CreatedByTypeUser),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55.000Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("foo@contoso.com"),
	// 		LastModifiedByType: to.Ptr(armdevhub.CreatedByTypeUser),
	// 	},
	// 	Location: to.Ptr("location1"),
	// 	Tags: map[string]*string{
	// 		"appname": to.Ptr("testapp"),
	// 	},
	// 	Properties: &armdevhub.WorkflowProperties{
	// 		GithubWorkflowProfile: &armdevhub.GitHubWorkflowProfile{
	// 			Acr: &armdevhub.ACR{
	// 				AcrRegistryName: to.Ptr("registry1"),
	// 				AcrRepositoryName: to.Ptr("repo1"),
	// 				AcrResourceGroup: to.Ptr("resourceGroup1"),
	// 				AcrSubscriptionID: to.Ptr("subscriptionId1"),
	// 			},
	// 			AksResourceID: to.Ptr("/subscriptions/subscriptionId1/resourcegroups/resourceGroup1/providers/Microsoft.ContainerService/managedClusters/cluster1"),
	// 			AuthStatus: to.Ptr(armdevhub.AuthorizationStatusAuthorized),
	// 			BranchName: to.Ptr("branch2"),
	// 			DeploymentProperties: &armdevhub.DeploymentProperties{
	// 				HelmChartPath: to.Ptr("/src/charts"),
	// 				HelmValues: to.Ptr("/src/chars/values.yaml"),
	// 				ManifestType: to.Ptr(armdevhub.ManifestTypeHelm),
	// 				Overrides: map[string]*string{
	// 					"key1": to.Ptr("value1"),
	// 				},
	// 			},
	// 			DockerBuildContext: to.Ptr("repo2/src/"),
	// 			Dockerfile: to.Ptr("repo2/images/Dockerfile"),
	// 			OidcCredentials: &armdevhub.GitHubWorkflowProfileOidcCredentials{
	// 				AzureClientID: to.Ptr("12345678-3456-7890-5678-012345678901"),
	// 				AzureTenantID: to.Ptr("66666666-3456-7890-5678-012345678901"),
	// 			},
	// 			PrStatus: to.Ptr(armdevhub.PullRequestStatusSubmitted),
	// 			PrURL: to.Ptr("https://github.com/User/repo2/pull/6567"),
	// 			PullNumber: to.Ptr[int32](6567),
	// 			RepositoryName: to.Ptr("repo2"),
	// 			RepositoryOwner: to.Ptr("owner1"),
	// 		},
	// 	},
	// }
}
Output:

func (*WorkflowClient) Delete

func (client *WorkflowClient) Delete(ctx context.Context, resourceGroupName string, workflowName string, options *WorkflowClientDeleteOptions) (WorkflowClientDeleteResponse, error)

Delete - Deletes a workflow If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-11-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • workflowName - The name of the workflow resource.
  • options - WorkflowClientDeleteOptions contains the optional parameters for the WorkflowClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-10-11-preview/examples/Workflow_Delete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devhub/armdevhub"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevhub.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewWorkflowClient().Delete(ctx, "resourceGroup1", "workflow1", 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.DeleteWorkflowResponse = armdevhub.DeleteWorkflowResponse{
	// 	Status: to.Ptr("workflow deleted successfully"),
	// }
}
Output:

func (*WorkflowClient) Get

func (client *WorkflowClient) Get(ctx context.Context, resourceGroupName string, workflowName string, options *WorkflowClientGetOptions) (WorkflowClientGetResponse, error)

Get - Gets a workflow. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-11-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • workflowName - The name of the workflow resource.
  • options - WorkflowClientGetOptions contains the optional parameters for the WorkflowClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-10-11-preview/examples/Workflow_Get.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devhub/armdevhub"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevhub.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewWorkflowClient().Get(ctx, "resourceGroup1", "workflow1", 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.Workflow = armdevhub.Workflow{
	// 	Name: to.Ptr("workflow1"),
	// 	Type: to.Ptr("Micfosoft.DevHub/Workflow"),
	// 	ID: to.Ptr("/subscription/subscriptionId1/resourceGroups/resourceGroup1/providers/Microsoft.DevHub/workflow/workflow1"),
	// 	SystemData: &armdevhub.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55.000Z"); return t}()),
	// 		CreatedBy: to.Ptr("foo@contoso.com"),
	// 		CreatedByType: to.Ptr(armdevhub.CreatedByTypeUser),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55.000Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("foo@contoso.com"),
	// 		LastModifiedByType: to.Ptr(armdevhub.CreatedByTypeUser),
	// 	},
	// 	Location: to.Ptr("location1"),
	// 	Tags: map[string]*string{
	// 		"appname": to.Ptr("testapp"),
	// 	},
	// 	Properties: &armdevhub.WorkflowProperties{
	// 		GithubWorkflowProfile: &armdevhub.GitHubWorkflowProfile{
	// 			Acr: &armdevhub.ACR{
	// 				AcrRegistryName: to.Ptr("registry1"),
	// 				AcrRepositoryName: to.Ptr("repo1"),
	// 				AcrResourceGroup: to.Ptr("resourceGroup1"),
	// 				AcrSubscriptionID: to.Ptr("subscriptionId1"),
	// 			},
	// 			AksResourceID: to.Ptr("/subscriptions/subscriptionId1/resourcegroups/resourceGroup1/providers/Microsoft.ContainerService/managedClusters/cluster1"),
	// 			AuthStatus: to.Ptr(armdevhub.AuthorizationStatusAuthorized),
	// 			BranchName: to.Ptr("branch1"),
	// 			DeploymentProperties: &armdevhub.DeploymentProperties{
	// 				ManifestType: to.Ptr(armdevhub.ManifestTypeKube),
	// 				Overrides: map[string]*string{
	// 					"key1": to.Ptr("value1"),
	// 				},
	// 			},
	// 			DockerBuildContext: to.Ptr("repo1/src/"),
	// 			Dockerfile: to.Ptr("repo1/images/Dockerfile"),
	// 			LastWorkflowRun: &armdevhub.WorkflowRun{
	// 				LastRunAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-01-01T12:34:56.000Z"); return t}()),
	// 				Succeeded: to.Ptr(true),
	// 				WorkflowRunStatus: to.Ptr(armdevhub.WorkflowRunStatusCompleted),
	// 				WorkflowRunURL: to.Ptr("https://github.com/User/repo1/actions/runs/1820640230"),
	// 			},
	// 			OidcCredentials: &armdevhub.GitHubWorkflowProfileOidcCredentials{
	// 				AzureClientID: to.Ptr("12345678-3456-7890-5678-012345678901"),
	// 				AzureTenantID: to.Ptr("66666666-3456-7890-5678-012345678901"),
	// 			},
	// 			PrStatus: to.Ptr(armdevhub.PullRequestStatusMerged),
	// 			PrURL: to.Ptr("https://github.com/User/repo1/pull/6567"),
	// 			PullNumber: to.Ptr[int32](6567),
	// 			RepositoryName: to.Ptr("repo1"),
	// 			RepositoryOwner: to.Ptr("owner1"),
	// 		},
	// 	},
	// }
}
Output:

func (*WorkflowClient) NewListByResourceGroupPager

func (client *WorkflowClient) NewListByResourceGroupPager(resourceGroupName string, options *WorkflowClientListByResourceGroupOptions) *runtime.Pager[WorkflowClientListByResourceGroupResponse]

NewListByResourceGroupPager - Gets a list of workflows within a resource group.

Generated from API version 2022-10-11-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • options - WorkflowClientListByResourceGroupOptions contains the optional parameters for the WorkflowClient.NewListByResourceGroupPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-10-11-preview/examples/Workflow_ListByResourceGroup.json

package main

import (
	"context"
	"log"

	"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/devhub/armdevhub"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevhub.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewWorkflowClient().NewListByResourceGroupPager("resourceGroup1", &armdevhub.WorkflowClientListByResourceGroupOptions{ManagedClusterResource: to.Ptr("/subscriptions/subscriptionId1/resourcegroups/resourceGroup1/providers/Microsoft.ContainerService/managedClusters/cluster1")})
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.WorkflowListResult = armdevhub.WorkflowListResult{
		// 	Value: []*armdevhub.Workflow{
		// 		{
		// 			Name: to.Ptr("workflow1"),
		// 			Type: to.Ptr("Micfosoft.DevHub/Workflow"),
		// 			ID: to.Ptr("/subscription/subscriptionId1/resourceGroups/resourceGroup1/providers/Microsoft.DevHub/workflow/workflow1"),
		// 			SystemData: &armdevhub.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55.000Z"); return t}()),
		// 				CreatedBy: to.Ptr("foo@contoso.com"),
		// 				CreatedByType: to.Ptr(armdevhub.CreatedByTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55.000Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("foo@contoso.com"),
		// 				LastModifiedByType: to.Ptr(armdevhub.CreatedByTypeUser),
		// 			},
		// 			Location: to.Ptr("location1"),
		// 			Tags: map[string]*string{
		// 				"appname": to.Ptr("testapp"),
		// 			},
		// 			Properties: &armdevhub.WorkflowProperties{
		// 				GithubWorkflowProfile: &armdevhub.GitHubWorkflowProfile{
		// 					Acr: &armdevhub.ACR{
		// 						AcrRegistryName: to.Ptr("registry1"),
		// 						AcrRepositoryName: to.Ptr("repo1"),
		// 						AcrResourceGroup: to.Ptr("resourceGroup1"),
		// 						AcrSubscriptionID: to.Ptr("subscriptionId1"),
		// 					},
		// 					AksResourceID: to.Ptr("/subscriptions/subscriptionId1/resourcegroups/resourceGroup1/providers/Microsoft.ContainerService/managedClusters/cluster1"),
		// 					AuthStatus: to.Ptr(armdevhub.AuthorizationStatusAuthorized),
		// 					BranchName: to.Ptr("branch1"),
		// 					DeploymentProperties: &armdevhub.DeploymentProperties{
		// 						ManifestType: to.Ptr(armdevhub.ManifestTypeKube),
		// 						Overrides: map[string]*string{
		// 							"key1": to.Ptr("value1"),
		// 						},
		// 					},
		// 					DockerBuildContext: to.Ptr("repo1/src/"),
		// 					Dockerfile: to.Ptr("repo1/images/Dockerfile"),
		// 					LastWorkflowRun: &armdevhub.WorkflowRun{
		// 						LastRunAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-01-01T12:34:56.000Z"); return t}()),
		// 						Succeeded: to.Ptr(true),
		// 						WorkflowRunStatus: to.Ptr(armdevhub.WorkflowRunStatusCompleted),
		// 						WorkflowRunURL: to.Ptr("https://github.com/User/repo1/actions/runs/1820640230"),
		// 					},
		// 					OidcCredentials: &armdevhub.GitHubWorkflowProfileOidcCredentials{
		// 						AzureClientID: to.Ptr("12345678-3456-7890-5678-012345678901"),
		// 						AzureTenantID: to.Ptr("66666666-3456-7890-5678-012345678901"),
		// 					},
		// 					PrStatus: to.Ptr(armdevhub.PullRequestStatusMerged),
		// 					PrURL: to.Ptr("https://github.com/User/repo1/pull/6567"),
		// 					PullNumber: to.Ptr[int32](6567),
		// 					RepositoryName: to.Ptr("repo1"),
		// 					RepositoryOwner: to.Ptr("owner1"),
		// 				},
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*WorkflowClient) NewListPager

NewListPager - Gets a list of workflows associated with the specified subscription.

Generated from API version 2022-10-11-preview

  • options - WorkflowClientListOptions contains the optional parameters for the WorkflowClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-10-11-preview/examples/Workflow_List.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devhub/armdevhub"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevhub.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewWorkflowClient().NewListPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.WorkflowListResult = armdevhub.WorkflowListResult{
		// 	Value: []*armdevhub.Workflow{
		// 		{
		// 			Name: to.Ptr("workflow1"),
		// 			Type: to.Ptr("Micfosoft.DevHub/Workflow"),
		// 			ID: to.Ptr("/subscription/subscriptionId1/resourceGroups/resourceGroup1/providers/Microsoft.DevHub/workflow/workflow1"),
		// 			SystemData: &armdevhub.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55.000Z"); return t}()),
		// 				CreatedBy: to.Ptr("foo@contoso.com"),
		// 				CreatedByType: to.Ptr(armdevhub.CreatedByTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55.000Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("foo@contoso.com"),
		// 				LastModifiedByType: to.Ptr(armdevhub.CreatedByTypeUser),
		// 			},
		// 			Location: to.Ptr("location1"),
		// 			Tags: map[string]*string{
		// 				"appname": to.Ptr("testapp"),
		// 			},
		// 			Properties: &armdevhub.WorkflowProperties{
		// 				GithubWorkflowProfile: &armdevhub.GitHubWorkflowProfile{
		// 					Acr: &armdevhub.ACR{
		// 						AcrRegistryName: to.Ptr("registry1"),
		// 						AcrRepositoryName: to.Ptr("repo1"),
		// 						AcrResourceGroup: to.Ptr("resourceGroup1"),
		// 						AcrSubscriptionID: to.Ptr("subscriptionId1"),
		// 					},
		// 					AksResourceID: to.Ptr("/subscriptions/subscriptionId1/resourcegroups/resourceGroup1/providers/Microsoft.ContainerService/managedClusters/cluster1"),
		// 					AuthStatus: to.Ptr(armdevhub.AuthorizationStatusAuthorized),
		// 					BranchName: to.Ptr("branch1"),
		// 					DeploymentProperties: &armdevhub.DeploymentProperties{
		// 						ManifestType: to.Ptr(armdevhub.ManifestTypeKube),
		// 						Overrides: map[string]*string{
		// 							"key1": to.Ptr("value1"),
		// 						},
		// 					},
		// 					DockerBuildContext: to.Ptr("repo1/src/"),
		// 					Dockerfile: to.Ptr("repo1/images/Dockerfile"),
		// 					OidcCredentials: &armdevhub.GitHubWorkflowProfileOidcCredentials{
		// 						AzureClientID: to.Ptr("12345678-3456-7890-5678-012345678901"),
		// 						AzureTenantID: to.Ptr("66666666-3456-7890-5678-012345678901"),
		// 					},
		// 					PrStatus: to.Ptr(armdevhub.PullRequestStatusSubmitted),
		// 					PrURL: to.Ptr("https://github.com/User/repo1/pull/6567"),
		// 					PullNumber: to.Ptr[int32](6567),
		// 					RepositoryName: to.Ptr("repo1"),
		// 					RepositoryOwner: to.Ptr("owner1"),
		// 				},
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*WorkflowClient) UpdateTags

func (client *WorkflowClient) UpdateTags(ctx context.Context, resourceGroupName string, workflowName string, parameters TagsObject, options *WorkflowClientUpdateTagsOptions) (WorkflowClientUpdateTagsResponse, error)

UpdateTags - Updates tags on a workflow. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2022-10-11-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • workflowName - The name of the workflow resource.
  • parameters - Parameters supplied to the Update Workflow Tags operation.
  • options - WorkflowClientUpdateTagsOptions contains the optional parameters for the WorkflowClient.UpdateTags method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/17aa6a1314de5aafef059d9aa2229901df506e75/specification/developerhub/resource-manager/Microsoft.DevHub/preview/2022-10-11-preview/examples/Workflow_UpdateTags.json

package main

import (
	"context"
	"log"

	"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/devhub/armdevhub"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevhub.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewWorkflowClient().UpdateTags(ctx, "resourceGroup1", "workflow1", armdevhub.TagsObject{
		Tags: map[string]*string{
			"promote":     to.Ptr("false"),
			"resourceEnv": to.Ptr("testing"),
		},
	}, 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.Workflow = armdevhub.Workflow{
	// 	Name: to.Ptr("workflow1"),
	// 	Type: to.Ptr("Micfosoft.DevHub/Workflow"),
	// 	ID: to.Ptr("/subscription/subscriptionId1/resourceGroups/resourceGroup1/providers/Microsoft.DevHub/workflow/workflow1"),
	// 	SystemData: &armdevhub.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55.000Z"); return t}()),
	// 		CreatedBy: to.Ptr("foo@contoso.com"),
	// 		CreatedByType: to.Ptr(armdevhub.CreatedByTypeUser),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55.000Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("foo@contoso.com"),
	// 		LastModifiedByType: to.Ptr(armdevhub.CreatedByTypeUser),
	// 	},
	// 	Location: to.Ptr("location1"),
	// 	Tags: map[string]*string{
	// 		"previousValue": to.Ptr("stillExists"),
	// 		"promote": to.Ptr("false"),
	// 		"resourceEnv": to.Ptr("testing"),
	// 	},
	// 	Properties: &armdevhub.WorkflowProperties{
	// 		GithubWorkflowProfile: &armdevhub.GitHubWorkflowProfile{
	// 			Acr: &armdevhub.ACR{
	// 				AcrRegistryName: to.Ptr("registry1"),
	// 				AcrRepositoryName: to.Ptr("repo1"),
	// 				AcrResourceGroup: to.Ptr("resourceGroup1"),
	// 				AcrSubscriptionID: to.Ptr("subscriptionId1"),
	// 			},
	// 			AksResourceID: to.Ptr("/subscriptions/subscriptionId1/resourcegroups/resourceGroup1/providers/Microsoft.ContainerService/managedClusters/cluster1"),
	// 			AuthStatus: to.Ptr(armdevhub.AuthorizationStatusAuthorized),
	// 			BranchName: to.Ptr("branch1"),
	// 			DeploymentProperties: &armdevhub.DeploymentProperties{
	// 				ManifestType: to.Ptr(armdevhub.ManifestTypeKube),
	// 				Overrides: map[string]*string{
	// 					"key1": to.Ptr("value1"),
	// 				},
	// 			},
	// 			DockerBuildContext: to.Ptr("repo1/src/"),
	// 			Dockerfile: to.Ptr("repo1/images/Dockerfile"),
	// 			LastWorkflowRun: &armdevhub.WorkflowRun{
	// 				LastRunAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-01-01T12:34:56.000Z"); return t}()),
	// 				Succeeded: to.Ptr(true),
	// 				WorkflowRunStatus: to.Ptr(armdevhub.WorkflowRunStatusCompleted),
	// 				WorkflowRunURL: to.Ptr("https://github.com/User/repo1/actions/runs/1820640230"),
	// 			},
	// 			OidcCredentials: &armdevhub.GitHubWorkflowProfileOidcCredentials{
	// 				AzureClientID: to.Ptr("12345678-3456-7890-5678-012345678901"),
	// 				AzureTenantID: to.Ptr("66666666-3456-7890-5678-012345678901"),
	// 			},
	// 			PrStatus: to.Ptr(armdevhub.PullRequestStatusMerged),
	// 			PrURL: to.Ptr("https://github.com/owner1/repo1/pull/6567"),
	// 			PullNumber: to.Ptr[int32](6567),
	// 			RepositoryName: to.Ptr("repo1"),
	// 			RepositoryOwner: to.Ptr("owner1"),
	// 		},
	// 	},
	// }
}
Output:

type WorkflowClientCreateOrUpdateOptions

type WorkflowClientCreateOrUpdateOptions struct {
}

WorkflowClientCreateOrUpdateOptions contains the optional parameters for the WorkflowClient.CreateOrUpdate method.

type WorkflowClientCreateOrUpdateResponse

type WorkflowClientCreateOrUpdateResponse struct {
	// Resource representation of a workflow
	Workflow
}

WorkflowClientCreateOrUpdateResponse contains the response from method WorkflowClient.CreateOrUpdate.

type WorkflowClientDeleteOptions

type WorkflowClientDeleteOptions struct {
}

WorkflowClientDeleteOptions contains the optional parameters for the WorkflowClient.Delete method.

type WorkflowClientDeleteResponse

type WorkflowClientDeleteResponse struct {
	// delete response if content must be provided on delete operation
	DeleteWorkflowResponse
}

WorkflowClientDeleteResponse contains the response from method WorkflowClient.Delete.

type WorkflowClientGetOptions

type WorkflowClientGetOptions struct {
}

WorkflowClientGetOptions contains the optional parameters for the WorkflowClient.Get method.

type WorkflowClientGetResponse

type WorkflowClientGetResponse struct {
	// Resource representation of a workflow
	Workflow
}

WorkflowClientGetResponse contains the response from method WorkflowClient.Get.

type WorkflowClientListByResourceGroupOptions

type WorkflowClientListByResourceGroupOptions struct {
	// The ManagedCluster resource associated with the workflows.
	ManagedClusterResource *string
}

WorkflowClientListByResourceGroupOptions contains the optional parameters for the WorkflowClient.NewListByResourceGroupPager method.

type WorkflowClientListByResourceGroupResponse

type WorkflowClientListByResourceGroupResponse struct {
	// The response from List Workflows operation.
	WorkflowListResult
}

WorkflowClientListByResourceGroupResponse contains the response from method WorkflowClient.NewListByResourceGroupPager.

type WorkflowClientListOptions

type WorkflowClientListOptions struct {
}

WorkflowClientListOptions contains the optional parameters for the WorkflowClient.NewListPager method.

type WorkflowClientListResponse

type WorkflowClientListResponse struct {
	// The response from List Workflows operation.
	WorkflowListResult
}

WorkflowClientListResponse contains the response from method WorkflowClient.NewListPager.

type WorkflowClientUpdateTagsOptions

type WorkflowClientUpdateTagsOptions struct {
}

WorkflowClientUpdateTagsOptions contains the optional parameters for the WorkflowClient.UpdateTags method.

type WorkflowClientUpdateTagsResponse

type WorkflowClientUpdateTagsResponse struct {
	// Resource representation of a workflow
	Workflow
}

WorkflowClientUpdateTagsResponse contains the response from method WorkflowClient.UpdateTags.

type WorkflowListResult

type WorkflowListResult struct {
	// The list of workflows.
	Value []*Workflow

	// READ-ONLY; The URL to the next set of workflow results.
	NextLink *string
}

WorkflowListResult - The response from List Workflows operation.

func (WorkflowListResult) MarshalJSON

func (w WorkflowListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type WorkflowListResult.

func (*WorkflowListResult) UnmarshalJSON

func (w *WorkflowListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type WorkflowListResult.

type WorkflowProperties

type WorkflowProperties struct {
	// Properties for generating artifacts like dockerfile and manifests.
	ArtifactGenerationProperties *ArtifactGenerationProperties

	// Profile of a github workflow.
	GithubWorkflowProfile *GitHubWorkflowProfile
}

WorkflowProperties - Workflow properties

func (WorkflowProperties) MarshalJSON

func (w WorkflowProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type WorkflowProperties.

func (*WorkflowProperties) UnmarshalJSON

func (w *WorkflowProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type WorkflowProperties.

type WorkflowRun

type WorkflowRun struct {
	// Describes the status of the workflow run
	WorkflowRunStatus *WorkflowRunStatus

	// READ-ONLY; The timestamp of the last workflow run.
	LastRunAt *time.Time

	// READ-ONLY; Describes if the workflow run succeeded.
	Succeeded *bool

	// READ-ONLY; URL to the run of the workflow.
	WorkflowRunURL *string
}

func (WorkflowRun) MarshalJSON

func (w WorkflowRun) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type WorkflowRun.

func (*WorkflowRun) UnmarshalJSON

func (w *WorkflowRun) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type WorkflowRun.

type WorkflowRunStatus added in v0.4.0

type WorkflowRunStatus string

WorkflowRunStatus - Describes the status of the workflow run

const (
	// WorkflowRunStatusCompleted - Workflow run is completed
	WorkflowRunStatusCompleted WorkflowRunStatus = "completed"
	// WorkflowRunStatusInprogress - Workflow run is inprogress
	WorkflowRunStatusInprogress WorkflowRunStatus = "inprogress"
	// WorkflowRunStatusQueued - Workflow run is queued
	WorkflowRunStatusQueued WorkflowRunStatus = "queued"
)

func PossibleWorkflowRunStatusValues added in v0.4.0

func PossibleWorkflowRunStatusValues() []WorkflowRunStatus

PossibleWorkflowRunStatusValues returns the possible values for the WorkflowRunStatus const type.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL