clients

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HeaderCorrelationRequestID is the Azure extension header to set a user-specified correlation request ID.
	HeaderCorrelationRequestID = "x-ms-correlation-request-id"
)
View Source
const (
	HeaderUserAgent = "User-Agent"
)

Variables

View Source
var DefaultRetryableReadAfterCreateStatusCodes = []int{
	http.StatusNotFound,
	http.StatusForbidden,
}

Functions

func CombineRetryOptions added in v0.2.0

func CombineRetryOptions(opts ...*policy.RetryOptions) *policy.RetryOptions

CombineRetryOptions combines multiple RequestOptions into a single policy.RetryOptions.

func NewLiveTrafficLogPolicy

func NewLiveTrafficLogPolicy() policy.Policy

func NewQueryParameters added in v0.2.0

func NewQueryParameters(queryParameters map[string][]string) map[string]string

func NewRetryOptions added in v0.2.0

func NewRetryOptions(rtry retry.Value) *policy.RetryOptions

NewRetryOptions creates a RetryOptions based on the provided retry.RetryValue.

func NewRetryOptionsForReadAfterCreate added in v0.2.0

func NewRetryOptionsForReadAfterCreate() *policy.RetryOptions

NewRetryOptionsForReadAfterCreate creates a RetryOptions for read-after-create operations.

Types

type Client

type Client struct {
	// StopContext is used for propagating control from Terraform Core (e.g. Ctrl/Cmd+C)
	StopContext context.Context

	MSGraphClient *MSGraphClient

	Option *Option
}

func (*Client) Build

func (client *Client) Build(ctx context.Context, o *Option) error

type CorrelationIDPolicy

type CorrelationIDPolicy struct {
	CorrelationRequestID string
}

func (CorrelationIDPolicy) Do

type MSGraphClient

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

func NewMSGraphClient

func NewMSGraphClient(credential azcore.TokenCredential, opt *policy.ClientOptions) (*MSGraphClient, error)

func (*MSGraphClient) Action added in v0.2.0

func (client *MSGraphClient) Action(ctx context.Context, method string, url string, apiVersion string, body interface{}, options RequestOptions) (interface{}, error)

func (*MSGraphClient) Create

func (client *MSGraphClient) Create(ctx context.Context, url string, apiVersion string, body interface{}, options RequestOptions) (interface{}, error)

func (*MSGraphClient) Delete

func (client *MSGraphClient) Delete(ctx context.Context, url string, apiVersion string, options RequestOptions) error

func (*MSGraphClient) GraphBaseUrl added in v0.2.0

func (client *MSGraphClient) GraphBaseUrl() string

func (*MSGraphClient) List

func (client *MSGraphClient) List(ctx context.Context, url string, apiVersion string, options RequestOptions) (interface{}, error)

func (*MSGraphClient) ListRefIDs added in v0.3.0

func (client *MSGraphClient) ListRefIDs(ctx context.Context, url string, apiVersion string, options RequestOptions) ([]string, error)

func (*MSGraphClient) Read

func (client *MSGraphClient) Read(ctx context.Context, url string, apiVersion string, options RequestOptions) (interface{}, error)

func (*MSGraphClient) Update

func (client *MSGraphClient) Update(ctx context.Context, url string, apiVersion string, body interface{}, options RequestOptions) (interface{}, error)

type Option

type Option struct {
	Cred                        azcore.TokenCredential
	ApplicationUserAgent        string
	DisableCorrelationRequestID bool
	CloudCfg                    cloud.Configuration
	CustomCorrelationRequestID  string
	TenantId                    string
}

type RequestOptions

type RequestOptions struct {
	Headers         map[string]string
	QueryParameters map[string]string
	RetryOptions    *policy.RetryOptions
}

func DefaultRequestOptions

func DefaultRequestOptions() RequestOptions

func NewRequestOptions

func NewRequestOptions(headers map[string]string, queryParameters map[string][]string) RequestOptions

type UserAgentPolicy

type UserAgentPolicy struct {
	UserAgent string
}

func (UserAgentPolicy) Do

Jump to

Keyboard shortcuts

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