azuredevops

package module
v7.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderKeyContinuationToken = "X-MS-ContinuationToken"

	// media types
	MediaTypeTextPlain       = "text/plain"
	MediaTypeApplicationJson = "application/json"
)

Variables

View Source
var SessionId = uuid.New().String()

Unique session id to be used by all requests of this session.

Functions

func CreateBasicAuthHeaderValue

func CreateBasicAuthHeaderValue(username, password string) string

func CreateBearerAuthHeaderValue

func CreateBearerAuthHeaderValue(token string) string

Types

type ApiResourceLocation

type ApiResourceLocation struct {
	// Area name for this resource
	Area *string `json:"area,omitempty"`
	// Unique Identifier for this location
	Id *uuid.UUID `json:"id,omitempty"`
	// Maximum api version that this resource supports (current server version for this resource)
	MaxVersion *string `json:"maxVersion,omitempty"`
	// Minimum api version that this resource supports
	MinVersion *string `json:"minVersion,omitempty"`
	// The latest version of this resource location that is in "Release" (non-preview) mode
	ReleasedVersion *string `json:"releasedVersion,omitempty"`
	// Resource name
	ResourceName *string `json:"resourceName,omitempty"`
	// The current resource version supported by this resource location
	ResourceVersion *int `json:"resourceVersion,omitempty"`
	// This location's route template (templated relative path)
	RouteTemplate *string `json:"routeTemplate,omitempty"`
}

ApiResourceLocation Information about the location of a REST API resource

type ArgumentNilError

type ArgumentNilError struct {
	ArgumentName string
}

func (ArgumentNilError) Error

func (e ArgumentNilError) Error() string

type ArgumentNilOrEmptyError

type ArgumentNilOrEmptyError struct {
	ArgumentName string
}

func (ArgumentNilOrEmptyError) Error

func (e ArgumentNilOrEmptyError) Error() string

type Client

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

func NewClient

func NewClient(connection *Connection, baseUrl string) *Client

NewClient provides an Azure DevOps client and copies the TLS config and timeout from the supplied connection

func NewClientWithOptions

func NewClientWithOptions(connection *Connection, baseUrl string, options ...ClientOptionFunc) *Client

NewClientWithOptions returns an Azure DevOps client modified by the options

func (*Client) CreateRequestMessage

func (client *Client) CreateRequestMessage(ctx context.Context,
	httpMethod string,
	url string,
	apiVersion string,
	body io.Reader,
	mediaType string,
	acceptMediaType string,
	additionalHeaders map[string]string) (request *http.Request, err error)

func (*Client) GenerateUrl

func (client *Client) GenerateUrl(apiResourceLocation *ApiResourceLocation, routeValues map[string]string, queryParameters url.Values) (request string)

func (*Client) GetResourceAreas

func (client *Client) GetResourceAreas(ctx context.Context) (*[]ResourceAreaInfo, error)

func (*Client) Send

func (client *Client) Send(ctx context.Context,
	httpMethod string,
	locationId uuid.UUID,
	apiVersion string,
	routeValues map[string]string,
	queryParameters url.Values,
	body io.Reader,
	mediaType string,
	acceptMediaType string,
	additionalHeaders map[string]string) (response *http.Response, err error)

func (*Client) SendRequest

func (client *Client) SendRequest(request *http.Request) (response *http.Response, err error)

func (*Client) UnmarshalBody

func (client *Client) UnmarshalBody(response *http.Response, v interface{}) (err error)

func (*Client) UnmarshalCollectionBody

func (client *Client) UnmarshalCollectionBody(response *http.Response, v interface{}) (err error)

func (*Client) UnmarshalCollectionJson

func (client *Client) UnmarshalCollectionJson(jsonValue []byte, v interface{}) (err error)

func (*Client) UnwrapError

func (client *Client) UnwrapError(response *http.Response) (err error)

type ClientOptionFunc

type ClientOptionFunc func(*Client)

ClientOptionFunc can be used customize a new AzureDevops API client.

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) ClientOptionFunc

WithHTTPClient can be used to configure a custom HTTP client.

type Connection

type Connection struct {
	AuthorizationString     string
	BaseUrl                 string
	UserAgent               string
	SuppressFedAuthRedirect bool
	ForceMsaPassThrough     bool
	Timeout                 *time.Duration
	TlsConfig               *tls.Config
	// contains filtered or unexported fields
}

func NewAnonymousConnection

func NewAnonymousConnection(organizationUrl string) *Connection

func NewAtConnection

func NewAtConnection(organizationUrl string, accessToken string) *Connection

func NewPatConnection

func NewPatConnection(organizationUrl string, personalAccessToken string) *Connection

Creates a new Azure DevOps connection instance using a personal access token.

func (*Connection) GetClientByResourceAreaId

func (connection *Connection) GetClientByResourceAreaId(ctx context.Context, resourceAreaID uuid.UUID) (*Client, error)

func (*Connection) GetClientByUrl

func (connection *Connection) GetClientByUrl(baseUrl string) *Client

type ImproperError

type ImproperError struct {
	Message *string `json:"Message,omitempty"`
}

ImproperError

type InvalidApiVersion

type InvalidApiVersion struct {
	ApiVersion string
}

func (InvalidApiVersion) Error

func (e InvalidApiVersion) Error() string

type InvalidVersionStringError

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

func (*InvalidVersionStringError) Error

func (e *InvalidVersionStringError) Error() string

type KeyValuePair

type KeyValuePair struct {
	Key   *interface{} `json:"key,omitempty"`
	Value *interface{} `json:"value,omitempty"`
}

KeyValuePair

type LocationIdNotRegisteredError

type LocationIdNotRegisteredError struct {
	LocationId uuid.UUID
	Url        string
}

func (LocationIdNotRegisteredError) Error

type ResourceAreaIdNotRegisteredError

type ResourceAreaIdNotRegisteredError struct {
	ResourceAreaId uuid.UUID
	Url            string
}

func (ResourceAreaIdNotRegisteredError) Error

type ResourceAreaInfo

type ResourceAreaInfo struct {
	Id          *uuid.UUID `json:"id,omitempty"`
	LocationUrl *string    `json:"locationUrl,omitempty"`
	Name        *string    `json:"name,omitempty"`
}

ResourceAreaInfo

type ServerSystemError

type ServerSystemError struct {
	ClassName      *string            `json:"className,omitempty"`
	InnerException *ServerSystemError `json:"innerException,omitempty"`
	Message        *string            `json:"message,omitempty"`
}

ServerSystemError

func (ServerSystemError) Error

func (e ServerSystemError) Error() string

type Time

type Time struct {
	Time time.Time
}

func (Time) AsQueryParameter

func (t Time) AsQueryParameter() string

AsQueryParameter formats time value for query parameter usage.

func (Time) Equal

func (t Time) Equal(u Time) bool

func (*Time) MarshalJSON

func (t *Time) MarshalJSON() ([]byte, error)

func (Time) String

func (t Time) String() string

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(b []byte) error

type Version

type Version struct {
	Major int
	Minor int
}

func NewVersion

func NewVersion(version string) (*Version, error)

func (Version) CompareTo

func (version Version) CompareTo(compareToVersion Version) int

func (Version) String

func (version Version) String() string

type VssJsonCollectionWrapper

type VssJsonCollectionWrapper struct {
	Count *int           `json:"count"`
	Value *[]interface{} `json:"value"`
}

VssJsonCollectionWrapper -

type WrappedError

type WrappedError struct {
	ExceptionId      *string                 `json:"$id,omitempty"`
	InnerError       *WrappedError           `json:"innerException,omitempty"`
	Message          *string                 `json:"message,omitempty"`
	TypeName         *string                 `json:"typeName,omitempty"`
	TypeKey          *string                 `json:"typeKey,omitempty"`
	ErrorCode        *int                    `json:"errorCode,omitempty"`
	EventId          *int                    `json:"eventId,omitempty"`
	CustomProperties *map[string]interface{} `json:"customProperties,omitempty"`
	StatusCode       *int
}

WrappedError

func (WrappedError) Error

func (e WrappedError) Error() string

type WrappedImproperError

type WrappedImproperError struct {
	Count *int           `json:"count,omitempty"`
	Value *ImproperError `json:"value,omitempty"`
}

WrappedImproperError

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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