governance

package
v0.15.14 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

Package governance provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.11.0 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSwagger

func GetSwagger() (swagger *openapi3.T, err error)

GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.

func Handler

func Handler(si ServerInterface) http.Handler

Handler creates http.Handler with routing matching OpenAPI spec.

func HandlerFromMux

func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler

HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.

func HandlerFromMuxWithBaseURL

func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler

func HandlerWithOptions

func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler

HandlerWithOptions creates http.Handler with additional options

func NewGovArchiveAccessRuleRequest

func NewGovArchiveAccessRuleRequest(server string, ruleId string) (*http.Request, error)

NewGovArchiveAccessRuleRequest generates requests for GovArchiveAccessRule

func NewGovCreateAccessRuleRequest

func NewGovCreateAccessRuleRequest(server string, body GovCreateAccessRuleJSONRequestBody) (*http.Request, error)

NewGovCreateAccessRuleRequest calls the generic GovCreateAccessRule builder with application/json body

func NewGovCreateAccessRuleRequestWithBody

func NewGovCreateAccessRuleRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewGovCreateAccessRuleRequestWithBody generates requests for GovCreateAccessRule with any type of body

func NewGovGetAccessRuleRequest

func NewGovGetAccessRuleRequest(server string, ruleId string) (*http.Request, error)

NewGovGetAccessRuleRequest generates requests for GovGetAccessRule

func NewGovListAccessRulesRequest

func NewGovListAccessRulesRequest(server string, params *GovListAccessRulesParams) (*http.Request, error)

NewGovListAccessRulesRequest generates requests for GovListAccessRules

func NewGovUpdateAccessRuleRequest

func NewGovUpdateAccessRuleRequest(server string, ruleId string, body GovUpdateAccessRuleJSONRequestBody) (*http.Request, error)

NewGovUpdateAccessRuleRequest calls the generic GovUpdateAccessRule builder with application/json body

func NewGovUpdateAccessRuleRequestWithBody

func NewGovUpdateAccessRuleRequestWithBody(server string, ruleId string, contentType string, body io.Reader) (*http.Request, error)

NewGovUpdateAccessRuleRequestWithBody generates requests for GovUpdateAccessRule with any type of body

func PathToRawSpec

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

Constructs a synthetic filesystem for resolving external references when loading openapi specifications.

Types

type ChiServerOptions

type ChiServerOptions struct {
	BaseURL          string
	BaseRouter       chi.Router
	Middlewares      []MiddlewareFunc
	ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) GovArchiveAccessRule

func (c *Client) GovArchiveAccessRule(ctx context.Context, ruleId string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GovCreateAccessRule

func (c *Client) GovCreateAccessRule(ctx context.Context, body GovCreateAccessRuleJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GovCreateAccessRuleWithBody

func (c *Client) GovCreateAccessRuleWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GovGetAccessRule

func (c *Client) GovGetAccessRule(ctx context.Context, ruleId string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GovListAccessRules

func (c *Client) GovListAccessRules(ctx context.Context, params *GovListAccessRulesParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GovUpdateAccessRule

func (c *Client) GovUpdateAccessRule(ctx context.Context, ruleId string, body GovUpdateAccessRuleJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GovUpdateAccessRuleWithBody

func (c *Client) GovUpdateAccessRuleWithBody(ctx context.Context, ruleId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// GovListAccessRules request
	GovListAccessRules(ctx context.Context, params *GovListAccessRulesParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GovCreateAccessRule request with any body
	GovCreateAccessRuleWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	GovCreateAccessRule(ctx context.Context, body GovCreateAccessRuleJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GovGetAccessRule request
	GovGetAccessRule(ctx context.Context, ruleId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GovUpdateAccessRule request with any body
	GovUpdateAccessRuleWithBody(ctx context.Context, ruleId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	GovUpdateAccessRule(ctx context.Context, ruleId string, body GovUpdateAccessRuleJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GovArchiveAccessRule request
	GovArchiveAccessRule(ctx context.Context, ruleId string, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithRequestEditorFn

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) GovArchiveAccessRuleWithResponse

func (c *ClientWithResponses) GovArchiveAccessRuleWithResponse(ctx context.Context, ruleId string, reqEditors ...RequestEditorFn) (*GovArchiveAccessRuleResponse, error)

GovArchiveAccessRuleWithResponse request returning *GovArchiveAccessRuleResponse

func (*ClientWithResponses) GovCreateAccessRuleWithBodyWithResponse

func (c *ClientWithResponses) GovCreateAccessRuleWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GovCreateAccessRuleResponse, error)

GovCreateAccessRuleWithBodyWithResponse request with arbitrary body returning *GovCreateAccessRuleResponse

func (*ClientWithResponses) GovCreateAccessRuleWithResponse

func (c *ClientWithResponses) GovCreateAccessRuleWithResponse(ctx context.Context, body GovCreateAccessRuleJSONRequestBody, reqEditors ...RequestEditorFn) (*GovCreateAccessRuleResponse, error)

func (*ClientWithResponses) GovGetAccessRuleWithResponse

func (c *ClientWithResponses) GovGetAccessRuleWithResponse(ctx context.Context, ruleId string, reqEditors ...RequestEditorFn) (*GovGetAccessRuleResponse, error)

GovGetAccessRuleWithResponse request returning *GovGetAccessRuleResponse

func (*ClientWithResponses) GovListAccessRulesWithResponse

func (c *ClientWithResponses) GovListAccessRulesWithResponse(ctx context.Context, params *GovListAccessRulesParams, reqEditors ...RequestEditorFn) (*GovListAccessRulesResponse, error)

GovListAccessRulesWithResponse request returning *GovListAccessRulesResponse

func (*ClientWithResponses) GovUpdateAccessRuleWithBodyWithResponse

func (c *ClientWithResponses) GovUpdateAccessRuleWithBodyWithResponse(ctx context.Context, ruleId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GovUpdateAccessRuleResponse, error)

GovUpdateAccessRuleWithBodyWithResponse request with arbitrary body returning *GovUpdateAccessRuleResponse

func (*ClientWithResponses) GovUpdateAccessRuleWithResponse

func (c *ClientWithResponses) GovUpdateAccessRuleWithResponse(ctx context.Context, ruleId string, body GovUpdateAccessRuleJSONRequestBody, reqEditors ...RequestEditorFn) (*GovUpdateAccessRuleResponse, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// GovListAccessRules request
	GovListAccessRulesWithResponse(ctx context.Context, params *GovListAccessRulesParams, reqEditors ...RequestEditorFn) (*GovListAccessRulesResponse, error)

	// GovCreateAccessRule request with any body
	GovCreateAccessRuleWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GovCreateAccessRuleResponse, error)

	GovCreateAccessRuleWithResponse(ctx context.Context, body GovCreateAccessRuleJSONRequestBody, reqEditors ...RequestEditorFn) (*GovCreateAccessRuleResponse, error)

	// GovGetAccessRule request
	GovGetAccessRuleWithResponse(ctx context.Context, ruleId string, reqEditors ...RequestEditorFn) (*GovGetAccessRuleResponse, error)

	// GovUpdateAccessRule request with any body
	GovUpdateAccessRuleWithBodyWithResponse(ctx context.Context, ruleId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*GovUpdateAccessRuleResponse, error)

	GovUpdateAccessRuleWithResponse(ctx context.Context, ruleId string, body GovUpdateAccessRuleJSONRequestBody, reqEditors ...RequestEditorFn) (*GovUpdateAccessRuleResponse, error)

	// GovArchiveAccessRule request
	GovArchiveAccessRuleWithResponse(ctx context.Context, ruleId string, reqEditors ...RequestEditorFn) (*GovArchiveAccessRuleResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type CreateAccessRuleRequest

type CreateAccessRuleRequest struct {
	// Approver config for access rules
	Approval    externalRef1.ApproverConfig `json:"approval"`
	Description string                      `json:"description"`

	// The group IDs that the access rule applies to.
	Groups []string `json:"groups"`
	Name   string   `json:"name"`

	// a request body for creating a Access Rule Target
	Target externalRef1.CreateAccessRuleTarget `json:"target"`

	// Time configuration for an Access Rule.
	TimeConstraints externalRef1.TimeConstraints `json:"timeConstraints"`
}

CreateAccessRuleRequest defines model for CreateAccessRuleRequest.

type ErrorResponse

type ErrorResponse struct {
	Error string `json:"error"`
}

ErrorResponse defines model for ErrorResponse.

type GovArchiveAccessRuleResponse

type GovArchiveAccessRuleResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *externalRef1.AccessRuleDetail
	JSON401      *struct {
		Error string `json:"error"`
	}
	JSON404 *struct {
		Error string `json:"error"`
	}
	JSON500 *struct {
		Error string `json:"error"`
	}
}

func ParseGovArchiveAccessRuleResponse

func ParseGovArchiveAccessRuleResponse(rsp *http.Response) (*GovArchiveAccessRuleResponse, error)

ParseGovArchiveAccessRuleResponse parses an HTTP response from a GovArchiveAccessRuleWithResponse call

func (GovArchiveAccessRuleResponse) Status

Status returns HTTPResponse.Status

func (GovArchiveAccessRuleResponse) StatusCode

func (r GovArchiveAccessRuleResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GovCreateAccessRuleJSONRequestBody

type GovCreateAccessRuleJSONRequestBody externalRef1.CreateAccessRuleRequest

GovCreateAccessRuleJSONRequestBody defines body for GovCreateAccessRule for application/json ContentType.

type GovCreateAccessRuleResponse

type GovCreateAccessRuleResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON201      *externalRef1.AccessRuleDetail
	JSON400      *struct {
		Error string `json:"error"`
	}
	JSON401 *struct {
		Error string `json:"error"`
	}
	JSON404 *struct {
		Error string `json:"error"`
	}
	JSON500 *struct {
		Error string `json:"error"`
	}
}

func ParseGovCreateAccessRuleResponse

func ParseGovCreateAccessRuleResponse(rsp *http.Response) (*GovCreateAccessRuleResponse, error)

ParseGovCreateAccessRuleResponse parses an HTTP response from a GovCreateAccessRuleWithResponse call

func (GovCreateAccessRuleResponse) Status

Status returns HTTPResponse.Status

func (GovCreateAccessRuleResponse) StatusCode

func (r GovCreateAccessRuleResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GovGetAccessRuleResponse

type GovGetAccessRuleResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *externalRef1.AccessRuleDetail
	JSON401      *struct {
		Error string `json:"error"`
	}
	JSON404 *struct {
		Error string `json:"error"`
	}
}

func ParseGovGetAccessRuleResponse

func ParseGovGetAccessRuleResponse(rsp *http.Response) (*GovGetAccessRuleResponse, error)

ParseGovGetAccessRuleResponse parses an HTTP response from a GovGetAccessRuleWithResponse call

func (GovGetAccessRuleResponse) Status

func (r GovGetAccessRuleResponse) Status() string

Status returns HTTPResponse.Status

func (GovGetAccessRuleResponse) StatusCode

func (r GovGetAccessRuleResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GovListAccessRulesParams

type GovListAccessRulesParams struct {
	// Filter Access Rules by a particular status.
	Status *GovListAccessRulesParamsStatus `form:"status,omitempty" json:"status,omitempty"`

	// encrypted token containing pagination info
	NextToken *string `form:"nextToken,omitempty" json:"nextToken,omitempty"`
}

GovListAccessRulesParams defines parameters for GovListAccessRules.

type GovListAccessRulesParamsStatus

type GovListAccessRulesParamsStatus string

GovListAccessRulesParamsStatus defines parameters for GovListAccessRules.

type GovListAccessRulesResponse

type GovListAccessRulesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *struct {
		AccessRules []externalRef1.AccessRuleDetail `json:"accessRules"`
		Next        *string                         `json:"next"`
	}
}

func ParseGovListAccessRulesResponse

func ParseGovListAccessRulesResponse(rsp *http.Response) (*GovListAccessRulesResponse, error)

ParseGovListAccessRulesResponse parses an HTTP response from a GovListAccessRulesWithResponse call

func (GovListAccessRulesResponse) Status

Status returns HTTPResponse.Status

func (GovListAccessRulesResponse) StatusCode

func (r GovListAccessRulesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GovUpdateAccessRuleJSONRequestBody

type GovUpdateAccessRuleJSONRequestBody externalRef1.CreateAccessRuleRequest

GovUpdateAccessRuleJSONRequestBody defines body for GovUpdateAccessRule for application/json ContentType.

type GovUpdateAccessRuleResponse

type GovUpdateAccessRuleResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *externalRef1.AccessRuleDetail
	JSON400      *struct {
		Error string `json:"error"`
	}
	JSON401 *struct {
		Error string `json:"error"`
	}
	JSON404 *struct {
		Error string `json:"error"`
	}
	JSON500 *struct {
		Error string `json:"error"`
	}
}

func ParseGovUpdateAccessRuleResponse

func ParseGovUpdateAccessRuleResponse(rsp *http.Response) (*GovUpdateAccessRuleResponse, error)

ParseGovUpdateAccessRuleResponse parses an HTTP response from a GovUpdateAccessRuleWithResponse call

func (GovUpdateAccessRuleResponse) Status

Status returns HTTPResponse.Status

func (GovUpdateAccessRuleResponse) StatusCode

func (r GovUpdateAccessRuleResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type InvalidParamFormatError

type InvalidParamFormatError struct {
	ParamName string
	Err       error
}

func (*InvalidParamFormatError) Error

func (e *InvalidParamFormatError) Error() string

func (*InvalidParamFormatError) Unwrap

func (e *InvalidParamFormatError) Unwrap() error

type ListAccessRulesDetailResponse

type ListAccessRulesDetailResponse struct {
	AccessRules []externalRef1.AccessRuleDetail `json:"accessRules"`
	Next        *string                         `json:"next"`
}

ListAccessRulesDetailResponse defines model for ListAccessRulesDetailResponse.

type ListAccessRulesResponse

type ListAccessRulesResponse struct {
	AccessRules []externalRef1.AccessRule `json:"accessRules"`
	Next        *string                   `json:"next"`
}

ListAccessRulesResponse defines model for ListAccessRulesResponse.

type MiddlewareFunc

type MiddlewareFunc func(http.HandlerFunc) http.HandlerFunc

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type RequiredHeaderError

type RequiredHeaderError struct {
	ParamName string
	Err       error
}

func (*RequiredHeaderError) Error

func (e *RequiredHeaderError) Error() string

func (*RequiredHeaderError) Unwrap

func (e *RequiredHeaderError) Unwrap() error

type RequiredParamError

type RequiredParamError struct {
	ParamName string
}

func (*RequiredParamError) Error

func (e *RequiredParamError) Error() string

type ServerInterface

type ServerInterface interface {
	// List Access Rules
	// (GET /gov/v1/access-rules)
	GovListAccessRules(w http.ResponseWriter, r *http.Request, params GovListAccessRulesParams)
	// Create Access Rule
	// (POST /gov/v1/access-rules)
	GovCreateAccessRule(w http.ResponseWriter, r *http.Request)
	// Get Access Rule
	// (GET /gov/v1/access-rules/{ruleId})
	GovGetAccessRule(w http.ResponseWriter, r *http.Request, ruleId string)
	// Update Access Rule
	// (PUT /gov/v1/access-rules/{ruleId})
	GovUpdateAccessRule(w http.ResponseWriter, r *http.Request, ruleId string)
	// Archive Access Rule
	// (POST /gov/v1/access-rules/{ruleId}/archive)
	GovArchiveAccessRule(w http.ResponseWriter, r *http.Request, ruleId string)
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
	ErrorHandlerFunc   func(w http.ResponseWriter, r *http.Request, err error)
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) GovArchiveAccessRule

func (siw *ServerInterfaceWrapper) GovArchiveAccessRule(w http.ResponseWriter, r *http.Request)

GovArchiveAccessRule operation middleware

func (*ServerInterfaceWrapper) GovCreateAccessRule

func (siw *ServerInterfaceWrapper) GovCreateAccessRule(w http.ResponseWriter, r *http.Request)

GovCreateAccessRule operation middleware

func (*ServerInterfaceWrapper) GovGetAccessRule

func (siw *ServerInterfaceWrapper) GovGetAccessRule(w http.ResponseWriter, r *http.Request)

GovGetAccessRule operation middleware

func (*ServerInterfaceWrapper) GovListAccessRules

func (siw *ServerInterfaceWrapper) GovListAccessRules(w http.ResponseWriter, r *http.Request)

GovListAccessRules operation middleware

func (*ServerInterfaceWrapper) GovUpdateAccessRule

func (siw *ServerInterfaceWrapper) GovUpdateAccessRule(w http.ResponseWriter, r *http.Request)

GovUpdateAccessRule operation middleware

type TooManyValuesForParamError

type TooManyValuesForParamError struct {
	ParamName string
	Count     int
}

func (*TooManyValuesForParamError) Error

type UnescapedCookieParamError

type UnescapedCookieParamError struct {
	ParamName string
	Err       error
}

func (*UnescapedCookieParamError) Error

func (e *UnescapedCookieParamError) Error() string

func (*UnescapedCookieParamError) Unwrap

func (e *UnescapedCookieParamError) Unwrap() error

type UnmarshalingParamError

type UnmarshalingParamError struct {
	ParamName string
	Err       error
}

func (*UnmarshalingParamError) Error

func (e *UnmarshalingParamError) Error() string

func (*UnmarshalingParamError) Unwrap

func (e *UnmarshalingParamError) Unwrap() error

type UpdateAccessRuleRequest

type UpdateAccessRuleRequest struct {
	// Approver config for access rules
	Approval    externalRef1.ApproverConfig `json:"approval"`
	Description string                      `json:"description"`
	Groups      []string                    `json:"groups"`
	Name        string                      `json:"name"`

	// Time configuration for an Access Rule.
	TimeConstraints externalRef1.TimeConstraints `json:"timeConstraints"`
	UpdateMessage   *string                      `json:"updateMessage,omitempty"`
}

UpdateAccessRuleRequest defines model for UpdateAccessRuleRequest.

Jump to

Keyboard shortcuts

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