Documentation
¶
Index ¶
- type MockEnvironmentsClient
- func (m *MockEnvironmentsClient) CreateEnvironment(ctx context.Context, request *pingone.EnvironmentCreateRequest) (*pingone.EnvironmentResponse, *http.Response, error)
- func (m *MockEnvironmentsClient) GetEnvironment(ctx context.Context, environmentId uuid.UUID) (*pingone.EnvironmentResponse, *http.Response, error)
- func (m *MockEnvironmentsClient) GetEnvironmentServices(ctx context.Context, environmentId uuid.UUID) (*pingone.EnvironmentBillOfMaterialsResponse, *http.Response, error)
- func (m *MockEnvironmentsClient) GetEnvironments(ctx context.Context, filter *string) (pingone.PagedIterator[pingone.EnvironmentsCollectionResponse], error)
- func (m *MockEnvironmentsClient) UpdateEnvironment(ctx context.Context, environmentId uuid.UUID, ...) (*pingone.EnvironmentResponse, *http.Response, error)
- func (m *MockEnvironmentsClient) UpdateEnvironmentServices(ctx context.Context, environmentId uuid.UUID, ...) (*pingone.EnvironmentBillOfMaterialsResponse, *http.Response, error)
- type MockEnvironmentsClientFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockEnvironmentsClient ¶
MockEnvironmentsClient is a mock implementation of the EnvironmentsClient interface. It provides test doubles for all environments API operations and uses testify/mock for flexible test assertions and behavior configuration.
func (*MockEnvironmentsClient) CreateEnvironment ¶
func (m *MockEnvironmentsClient) CreateEnvironment(ctx context.Context, request *pingone.EnvironmentCreateRequest) (*pingone.EnvironmentResponse, *http.Response, error)
CreateEnvironment creates a new PingOne environment with the provided configuration. Returns the created environment response, HTTP response details, and any error encountered. The ctx parameter provides context for the API operation including cancellation and timeouts. The request parameter contains the environment configuration including name, type, and license.
func (*MockEnvironmentsClient) GetEnvironment ¶
func (m *MockEnvironmentsClient) GetEnvironment(ctx context.Context, environmentId uuid.UUID) (*pingone.EnvironmentResponse, *http.Response, error)
GetEnvironment retrieves a specific environment by its unique identifier. Returns the environment response, HTTP response details, and any error encountered. The ctx parameter provides context for the API operation including cancellation and timeouts. The environmentId parameter specifies the UUID of the environment to retrieve.
func (*MockEnvironmentsClient) GetEnvironmentServices ¶
func (m *MockEnvironmentsClient) GetEnvironmentServices(ctx context.Context, environmentId uuid.UUID) (*pingone.EnvironmentBillOfMaterialsResponse, *http.Response, error)
GetEnvironmentServices retrieves the bill of materials (enabled services) for an environment. Returns the bill of materials response, HTTP response details, and any error encountered. The ctx parameter provides context for the API operation including cancellation and timeouts. The environmentId parameter specifies the UUID of the environment whose services to retrieve.
func (*MockEnvironmentsClient) GetEnvironments ¶
func (m *MockEnvironmentsClient) GetEnvironments(ctx context.Context, filter *string) (pingone.PagedIterator[pingone.EnvironmentsCollectionResponse], error)
GetEnvironments retrieves a paginated list of environments matching the optional filter. Returns a PagedIterator for accessing environment collection responses and any error encountered. The ctx parameter provides context for the API operation including cancellation and timeouts. The filter parameter specifies optional filter criteria to limit the environments returned.
func (*MockEnvironmentsClient) UpdateEnvironment ¶
func (m *MockEnvironmentsClient) UpdateEnvironment(ctx context.Context, environmentId uuid.UUID, request *pingone.EnvironmentReplaceRequest) (*pingone.EnvironmentResponse, *http.Response, error)
UpdateEnvironment updates an existing environment with new configuration. Returns the updated environment response, HTTP response details, and any error encountered. The ctx parameter provides context for the API operation including cancellation and timeouts. The environmentId parameter specifies the UUID of the environment to update. The request parameter contains the updated environment configuration.
func (*MockEnvironmentsClient) UpdateEnvironmentServices ¶
func (m *MockEnvironmentsClient) UpdateEnvironmentServices(ctx context.Context, environmentId uuid.UUID, request *pingone.EnvironmentBillOfMaterialsReplaceRequest) (*pingone.EnvironmentBillOfMaterialsResponse, *http.Response, error)
UpdateEnvironmentServices updates the enabled services (bill of materials) for an environment. Returns the updated bill of materials response, HTTP response details, and any error encountered. The ctx parameter provides context for the API operation including cancellation and timeouts. The environmentId parameter specifies the UUID of the environment whose services to update. The request parameter contains the updated bill of materials configuration.
type MockEnvironmentsClientFactory ¶
type MockEnvironmentsClientFactory struct {
Client environments.EnvironmentsClient
Err error
}
MockEnvironmentsClientFactory is a mock implementation of the EnvironmentsClientFactory interface. It returns a pre-configured mock client and optional error for testing authentication flows.
func NewMockEnvironmentsClientFactory ¶
func NewMockEnvironmentsClientFactory(client environments.EnvironmentsClient, err error) *MockEnvironmentsClientFactory
NewMockEnvironmentsClientFactory creates a new MockEnvironmentsClientFactory with the provided client and error. The client parameter is the mock client instance to return from GetAuthenticatedClient. The err parameter is the error to return from GetAuthenticatedClient, or nil for successful authentication.
func (*MockEnvironmentsClientFactory) GetAuthenticatedClient ¶
func (m *MockEnvironmentsClientFactory) GetAuthenticatedClient(ctx context.Context) (environments.EnvironmentsClient, error)
GetAuthenticatedClient returns the pre-configured mock client and error. This method implements the EnvironmentsClientFactory interface for testing purposes. The ctx parameter provides context for the authentication operation (not used in mock).