sourcecontrols

package
v0.20240301.1091357 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: MPL-2.0 Imports: 13 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2023-11-01/sourcecontrols Documentation

The sourcecontrols SDK allows for interaction with the Azure Resource Manager Service securityinsights (API Version 2023-11-01).

This readme covers example usages, but further information on using this SDK can be found in the project root.

Import Path

import "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2023-11-01/sourcecontrols"

Client Initialization

client := sourcecontrols.NewSourceControlsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: SourceControlsClient.Create

ctx := context.TODO()
id := sourcecontrols.NewSourceControlID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "sourceControlIdValue")

payload := sourcecontrols.SourceControl{
	// ...
}


read, err := client.Create(ctx, id, payload)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: SourceControlsClient.Delete

ctx := context.TODO()
id := sourcecontrols.NewSourceControlID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "sourceControlIdValue")

payload := sourcecontrols.RepositoryAccessProperties{
	// ...
}


read, err := client.Delete(ctx, id, payload)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: SourceControlsClient.Get

ctx := context.TODO()
id := sourcecontrols.NewSourceControlID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "sourceControlIdValue")

read, err := client.Get(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: SourceControlsClient.List

ctx := context.TODO()
id := sourcecontrols.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue")

// alternatively `client.List(ctx, id)` can be used to do batched pagination
items, err := client.ListComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForContentType

func PossibleValuesForContentType() []string

func PossibleValuesForDeploymentFetchStatus

func PossibleValuesForDeploymentFetchStatus() []string

func PossibleValuesForDeploymentResult

func PossibleValuesForDeploymentResult() []string

func PossibleValuesForDeploymentState

func PossibleValuesForDeploymentState() []string

func PossibleValuesForRepoType

func PossibleValuesForRepoType() []string

func PossibleValuesForRepositoryAccessKind

func PossibleValuesForRepositoryAccessKind() []string

func PossibleValuesForState

func PossibleValuesForState() []string

func PossibleValuesForVersion

func PossibleValuesForVersion() []string

func PossibleValuesForWarningCode

func PossibleValuesForWarningCode() []string

func ValidateSourceControlID

func ValidateSourceControlID(input interface{}, key string) (warnings []string, errors []error)

ValidateSourceControlID checks that 'input' can be parsed as a Source Control ID

func ValidateWorkspaceID

func ValidateWorkspaceID(input interface{}, key string) (warnings []string, errors []error)

ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID

Types

type AzureDevOpsResourceInfo

type AzureDevOpsResourceInfo struct {
	PipelineId          *string `json:"pipelineId,omitempty"`
	ServiceConnectionId *string `json:"serviceConnectionId,omitempty"`
}

type ContentType

type ContentType string
const (
	ContentTypeAnalyticRule   ContentType = "AnalyticRule"
	ContentTypeAutomationRule ContentType = "AutomationRule"
	ContentTypeHuntingQuery   ContentType = "HuntingQuery"
	ContentTypeParser         ContentType = "Parser"
	ContentTypePlaybook       ContentType = "Playbook"
	ContentTypeWorkbook       ContentType = "Workbook"
)

func (*ContentType) UnmarshalJSON added in v0.20240221.1115631

func (s *ContentType) UnmarshalJSON(bytes []byte) error

type CreateOperationResponse

type CreateOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *SourceControl
}

type DeleteOperationResponse

type DeleteOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *Warning
}

type Deployment

type Deployment struct {
	DeploymentId      *string           `json:"deploymentId,omitempty"`
	DeploymentLogsUrl *string           `json:"deploymentLogsUrl,omitempty"`
	DeploymentResult  *DeploymentResult `json:"deploymentResult,omitempty"`
	DeploymentState   *DeploymentState  `json:"deploymentState,omitempty"`
	DeploymentTime    *string           `json:"deploymentTime,omitempty"`
}

func (*Deployment) GetDeploymentTimeAsTime

func (o *Deployment) GetDeploymentTimeAsTime() (*time.Time, error)

func (*Deployment) SetDeploymentTimeAsTime

func (o *Deployment) SetDeploymentTimeAsTime(input time.Time)

type DeploymentFetchStatus

type DeploymentFetchStatus string
const (
	DeploymentFetchStatusNotFound     DeploymentFetchStatus = "NotFound"
	DeploymentFetchStatusSuccess      DeploymentFetchStatus = "Success"
	DeploymentFetchStatusUnauthorized DeploymentFetchStatus = "Unauthorized"
)

func (*DeploymentFetchStatus) UnmarshalJSON added in v0.20240221.1115631

func (s *DeploymentFetchStatus) UnmarshalJSON(bytes []byte) error

type DeploymentInfo

type DeploymentInfo struct {
	Deployment            *Deployment            `json:"deployment,omitempty"`
	DeploymentFetchStatus *DeploymentFetchStatus `json:"deploymentFetchStatus,omitempty"`
	Message               *string                `json:"message,omitempty"`
}

type DeploymentResult

type DeploymentResult string
const (
	DeploymentResultCanceled DeploymentResult = "Canceled"
	DeploymentResultFailed   DeploymentResult = "Failed"
	DeploymentResultSuccess  DeploymentResult = "Success"
)

func (*DeploymentResult) UnmarshalJSON added in v0.20240221.1115631

func (s *DeploymentResult) UnmarshalJSON(bytes []byte) error

type DeploymentState

type DeploymentState string
const (
	DeploymentStateCanceling  DeploymentState = "Canceling"
	DeploymentStateCompleted  DeploymentState = "Completed"
	DeploymentStateInProgress DeploymentState = "In_Progress"
	DeploymentStateQueued     DeploymentState = "Queued"
)

func (*DeploymentState) UnmarshalJSON added in v0.20240221.1115631

func (s *DeploymentState) UnmarshalJSON(bytes []byte) error

type GetOperationResponse

type GetOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *SourceControl
}

type GitHubResourceInfo

type GitHubResourceInfo struct {
	AppInstallationId *string `json:"appInstallationId,omitempty"`
}

type ListCompleteResult

type ListCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []SourceControl
}

type ListOperationResponse

type ListOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]SourceControl
}

type PullRequest

type PullRequest struct {
	State *State  `json:"state,omitempty"`
	Url   *string `json:"url,omitempty"`
}

type RepoType

type RepoType string
const (
	RepoTypeAzureDevOps RepoType = "AzureDevOps"
	RepoTypeGithub      RepoType = "Github"
)

func (*RepoType) UnmarshalJSON added in v0.20240221.1115631

func (s *RepoType) UnmarshalJSON(bytes []byte) error

type Repository

type Repository struct {
	Branch            string  `json:"branch"`
	DeploymentLogsUrl *string `json:"deploymentLogsUrl,omitempty"`
	DisplayUrl        *string `json:"displayUrl,omitempty"`
	Url               string  `json:"url"`
}

type RepositoryAccess

type RepositoryAccess struct {
	ClientId       *string              `json:"clientId,omitempty"`
	Code           *string              `json:"code,omitempty"`
	InstallationId *string              `json:"installationId,omitempty"`
	Kind           RepositoryAccessKind `json:"kind"`
	State          *string              `json:"state,omitempty"`
	Token          *string              `json:"token,omitempty"`
}

type RepositoryAccessKind

type RepositoryAccessKind string
const (
	RepositoryAccessKindApp   RepositoryAccessKind = "App"
	RepositoryAccessKindOAuth RepositoryAccessKind = "OAuth"
	RepositoryAccessKindPAT   RepositoryAccessKind = "PAT"
)

func (*RepositoryAccessKind) UnmarshalJSON added in v0.20240221.1115631

func (s *RepositoryAccessKind) UnmarshalJSON(bytes []byte) error

type RepositoryAccessObject

type RepositoryAccessObject struct {
	RepositoryAccess RepositoryAccess `json:"repositoryAccess"`
}

type RepositoryAccessProperties

type RepositoryAccessProperties struct {
	Properties RepositoryAccessObject `json:"properties"`
}

type RepositoryResourceInfo

type RepositoryResourceInfo struct {
	AzureDevOpsResourceInfo *AzureDevOpsResourceInfo `json:"azureDevOpsResourceInfo,omitempty"`
	GitHubResourceInfo      *GitHubResourceInfo      `json:"gitHubResourceInfo,omitempty"`
	Webhook                 *Webhook                 `json:"webhook,omitempty"`
}

type ServicePrincipal

type ServicePrincipal struct {
	AppId               *string `json:"appId,omitempty"`
	CredentialsExpireOn *string `json:"credentialsExpireOn,omitempty"`
	Id                  *string `json:"id,omitempty"`
	TenantId            *string `json:"tenantId,omitempty"`
}

func (*ServicePrincipal) GetCredentialsExpireOnAsTime

func (o *ServicePrincipal) GetCredentialsExpireOnAsTime() (*time.Time, error)

func (*ServicePrincipal) SetCredentialsExpireOnAsTime

func (o *ServicePrincipal) SetCredentialsExpireOnAsTime(input time.Time)

type SourceControl

type SourceControl struct {
	Etag       *string                 `json:"etag,omitempty"`
	Id         *string                 `json:"id,omitempty"`
	Name       *string                 `json:"name,omitempty"`
	Properties SourceControlProperties `json:"properties"`
	SystemData *systemdata.SystemData  `json:"systemData,omitempty"`
	Type       *string                 `json:"type,omitempty"`
}

type SourceControlId

type SourceControlId struct {
	SubscriptionId    string
	ResourceGroupName string
	WorkspaceName     string
	SourceControlId   string
}

SourceControlId is a struct representing the Resource ID for a Source Control

func NewSourceControlID

func NewSourceControlID(subscriptionId string, resourceGroupName string, workspaceName string, sourceControlId string) SourceControlId

NewSourceControlID returns a new SourceControlId struct

func ParseSourceControlID

func ParseSourceControlID(input string) (*SourceControlId, error)

ParseSourceControlID parses 'input' into a SourceControlId

func ParseSourceControlIDInsensitively

func ParseSourceControlIDInsensitively(input string) (*SourceControlId, error)

ParseSourceControlIDInsensitively parses 'input' case-insensitively into a SourceControlId note: this method should only be used for API response data and not user input

func (*SourceControlId) FromParseResult

func (id *SourceControlId) FromParseResult(input resourceids.ParseResult) error

func (SourceControlId) ID

func (id SourceControlId) ID() string

ID returns the formatted Source Control ID

func (SourceControlId) Segments

func (id SourceControlId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Source Control ID

func (SourceControlId) String

func (id SourceControlId) String() string

String returns a human-readable description of this Source Control ID

type SourceControlOperationPredicate

type SourceControlOperationPredicate struct {
	Etag *string
	Id   *string
	Name *string
	Type *string
}

func (SourceControlOperationPredicate) Matches

type SourceControlProperties

type SourceControlProperties struct {
	ContentTypes           []ContentType           `json:"contentTypes"`
	Description            *string                 `json:"description,omitempty"`
	DisplayName            string                  `json:"displayName"`
	Id                     *string                 `json:"id,omitempty"`
	LastDeploymentInfo     *DeploymentInfo         `json:"lastDeploymentInfo,omitempty"`
	PullRequest            *PullRequest            `json:"pullRequest,omitempty"`
	RepoType               RepoType                `json:"repoType"`
	Repository             Repository              `json:"repository"`
	RepositoryAccess       *RepositoryAccess       `json:"repositoryAccess,omitempty"`
	RepositoryResourceInfo *RepositoryResourceInfo `json:"repositoryResourceInfo,omitempty"`
	ServicePrincipal       *ServicePrincipal       `json:"servicePrincipal,omitempty"`
	Version                *Version                `json:"version,omitempty"`
}

type SourceControlsClient

type SourceControlsClient struct {
	Client *resourcemanager.Client
}

func NewSourceControlsClientWithBaseURI

func NewSourceControlsClientWithBaseURI(sdkApi sdkEnv.Api) (*SourceControlsClient, error)

func (SourceControlsClient) Create

Create ...

func (SourceControlsClient) Delete

Delete ...

func (SourceControlsClient) Get

Get ...

func (SourceControlsClient) List

List ...

func (SourceControlsClient) ListComplete

ListComplete retrieves all the results into a single object

func (SourceControlsClient) ListCompleteMatchingPredicate

func (c SourceControlsClient) ListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, predicate SourceControlOperationPredicate) (result ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

type State

type State string
const (
	StateClosed State = "Closed"
	StateOpen   State = "Open"
)

func (*State) UnmarshalJSON added in v0.20240221.1115631

func (s *State) UnmarshalJSON(bytes []byte) error

type Version

type Version string
const (
	VersionVOne Version = "V1"
	VersionVTwo Version = "V2"
)

func (*Version) UnmarshalJSON added in v0.20240221.1115631

func (s *Version) UnmarshalJSON(bytes []byte) error

type Warning

type Warning struct {
	Warning *WarningBody `json:"warning,omitempty"`
}

type WarningBody

type WarningBody struct {
	Code    *WarningCode   `json:"code,omitempty"`
	Details *[]WarningBody `json:"details,omitempty"`
	Message *string        `json:"message,omitempty"`
}

type WarningCode

type WarningCode string
const (
	WarningCodeSourceControlDeletedWithWarnings                      WarningCode = "SourceControl_DeletedWithWarnings"
	WarningCodeSourceControlWarningDeletePipelineFromAzureDevOps     WarningCode = "SourceControlWarning_DeletePipelineFromAzureDevOps"
	WarningCodeSourceControlWarningDeleteRoleAssignment              WarningCode = "SourceControlWarning_DeleteRoleAssignment"
	WarningCodeSourceControlWarningDeleteServicePrincipal            WarningCode = "SourceControlWarning_DeleteServicePrincipal"
	WarningCodeSourceControlWarningDeleteWorkflowAndSecretFromGitHub WarningCode = "SourceControlWarning_DeleteWorkflowAndSecretFromGitHub"
)

func (*WarningCode) UnmarshalJSON added in v0.20240221.1115631

func (s *WarningCode) UnmarshalJSON(bytes []byte) error

type Webhook

type Webhook struct {
	RotateWebhookSecret     *bool   `json:"rotateWebhookSecret,omitempty"`
	WebhookId               *string `json:"webhookId,omitempty"`
	WebhookSecretUpdateTime *string `json:"webhookSecretUpdateTime,omitempty"`
	WebhookUrl              *string `json:"webhookUrl,omitempty"`
}

func (*Webhook) GetWebhookSecretUpdateTimeAsTime

func (o *Webhook) GetWebhookSecretUpdateTimeAsTime() (*time.Time, error)

func (*Webhook) SetWebhookSecretUpdateTimeAsTime

func (o *Webhook) SetWebhookSecretUpdateTimeAsTime(input time.Time)

type WorkspaceId

type WorkspaceId struct {
	SubscriptionId    string
	ResourceGroupName string
	WorkspaceName     string
}

WorkspaceId is a struct representing the Resource ID for a Workspace

func NewWorkspaceID

func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId

NewWorkspaceID returns a new WorkspaceId struct

func ParseWorkspaceID

func ParseWorkspaceID(input string) (*WorkspaceId, error)

ParseWorkspaceID parses 'input' into a WorkspaceId

func ParseWorkspaceIDInsensitively

func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error)

ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId note: this method should only be used for API response data and not user input

func (*WorkspaceId) FromParseResult

func (id *WorkspaceId) FromParseResult(input resourceids.ParseResult) error

func (WorkspaceId) ID

func (id WorkspaceId) ID() string

ID returns the formatted Workspace ID

func (WorkspaceId) Segments

func (id WorkspaceId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Workspace ID

func (WorkspaceId) String

func (id WorkspaceId) String() string

String returns a human-readable description of this Workspace ID

Jump to

Keyboard shortcuts

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