Versions in this module Expand all Collapse all v2 v2.1.2 Mar 18, 2024 Changes in this version + const EnvAPIToken + const EnvPageLimit + var ErrAPITokenNoSet = errors.New("api_token not set") + var ErrGraphqlConnectorIDIsEmpty = errors.New("connector id is empty") + var ErrGraphqlEmailIsEmpty = errors.New("email is empty") + var ErrGraphqlEmptyBothNameAndID = errors.New("both name and id should not be empty") + var ErrGraphqlIDIsEmpty = errors.New("id is empty") + var ErrGraphqlNameIsEmpty = errors.New("name is empty") + var ErrGraphqlNetworkIDIsEmpty = errors.New("network id is empty") + var ErrGraphqlNetworkNameIsEmpty = errors.New("network name is empty") + var ErrGraphqlResultIsEmpty = errors.New("query result is empty") + func NewUserFilterInput(filter *UsersFilter) *query.UserFilterInput + type APIError struct + ID graphql.ID + Name string + Operation string + Resource string + WrappedError error + func NewAPIError(wrappedError error, operation, resource string) *APIError + func NewAPIErrorWithID(wrappedError error, operation, resource, id string) *APIError + func NewAPIErrorWithName(wrappedError error, operation, resource, name string) *APIError + func (e *APIError) Error() string + func (e *APIError) Unwrap() error + type AccessInput struct + PrincipalID string + SecurityPolicyID *string + type Client struct + APIServerURL string + GraphqlClient *graphql.Client + GraphqlServerURL string + HTTPClient *http.Client + func NewClient(url string, apiToken string, network string, httpTimeout time.Duration, ...) *Client + func (client *Client) AddResourceAccess(ctx context.Context, resourceID string, principalIDs []string) error + func (client *Client) CreateConnector(ctx context.Context, input *model.Connector) (*model.Connector, error) + func (client *Client) CreateGroup(ctx context.Context, input *model.Group) (*model.Group, error) + func (client *Client) CreateRemoteNetwork(ctx context.Context, req *model.RemoteNetwork) (*model.RemoteNetwork, error) + func (client *Client) CreateResource(ctx context.Context, input *model.Resource) (*model.Resource, error) + func (client *Client) CreateServiceAccount(ctx context.Context, serviceAccountName string) (*model.ServiceAccount, error) + func (client *Client) CreateServiceKey(ctx context.Context, serviceAccountKey *model.ServiceKey) (*model.ServiceKey, error) + func (client *Client) CreateUser(ctx context.Context, input *model.User) (*model.User, error) + func (client *Client) DeleteConnector(ctx context.Context, connectorID string) error + func (client *Client) DeleteGroup(ctx context.Context, groupID string) error + func (client *Client) DeleteGroupUsers(ctx context.Context, groupID string, userIDs []string) error + func (client *Client) DeleteRemoteNetwork(ctx context.Context, remoteNetworkID string) error + func (client *Client) DeleteResource(ctx context.Context, resourceID string) error + func (client *Client) DeleteServiceAccount(ctx context.Context, serviceAccountID string) error + func (client *Client) DeleteServiceKey(ctx context.Context, serviceAccountKeyID string) error + func (client *Client) DeleteUser(ctx context.Context, userID string) error + func (client *Client) GenerateConnectorTokens(ctx context.Context, connectorID string) (*model.ConnectorTokens, error) + func (client *Client) ReadConnector(ctx context.Context, connectorID string) (*model.Connector, error) + func (client *Client) ReadConnectors(ctx context.Context, name, filter string) ([]*model.Connector, error) + func (client *Client) ReadGroup(ctx context.Context, groupID string) (*model.Group, error) + func (client *Client) ReadGroups(ctx context.Context, filter *model.GroupsFilter) ([]*model.Group, error) + func (client *Client) ReadRemoteNetwork(ctx context.Context, remoteNetworkID, remoteNetworkName string) (*model.RemoteNetwork, error) + func (client *Client) ReadRemoteNetworkByID(ctx context.Context, remoteNetworkID string) (*model.RemoteNetwork, error) + func (client *Client) ReadRemoteNetworkByName(ctx context.Context, remoteNetworkName string) (*model.RemoteNetwork, error) + func (client *Client) ReadRemoteNetworks(ctx context.Context, name, filter string) ([]*model.RemoteNetwork, error) + func (client *Client) ReadResource(ctx context.Context, resourceID string) (*model.Resource, error) + func (client *Client) ReadResources(ctx context.Context) ([]*model.Resource, error) + func (client *Client) ReadResourcesByName(ctx context.Context, name, filter string) ([]*model.Resource, error) + func (client *Client) ReadSecurityPolicies(ctx context.Context, name, filter string) ([]*model.SecurityPolicy, error) + func (client *Client) ReadSecurityPolicy(ctx context.Context, securityPolicyID, securityPolicyName string) (*model.SecurityPolicy, error) + func (client *Client) ReadServiceAccount(ctx context.Context, serviceAccountID string) (*model.ServiceAccount, error) + func (client *Client) ReadServiceAccounts(ctx context.Context, input ...string) ([]*model.ServiceAccount, error) + func (client *Client) ReadServiceKey(ctx context.Context, serviceAccountKeyID string) (*model.ServiceKey, error) + func (client *Client) ReadShallowServiceAccount(ctx context.Context, serviceAccountID string) (*model.ServiceAccount, error) + func (client *Client) ReadShallowServiceAccounts(ctx context.Context) ([]*model.ServiceAccount, error) + func (client *Client) ReadUser(ctx context.Context, userID string) (*model.User, error) + func (client *Client) ReadUsers(ctx context.Context, filter *UsersFilter) ([]*model.User, error) + func (client *Client) RemoveResourceAccess(ctx context.Context, resourceID string, principalIDs []string) error + func (client *Client) RevokeServiceKey(ctx context.Context, serviceAccountKeyID string) error + func (client *Client) UpdateConnector(ctx context.Context, input *model.Connector) (*model.Connector, error) + func (client *Client) UpdateGroup(ctx context.Context, input *model.Group) (*model.Group, error) + func (client *Client) UpdateRemoteNetwork(ctx context.Context, req *model.RemoteNetwork) (*model.RemoteNetwork, error) + func (client *Client) UpdateResource(ctx context.Context, input *model.Resource) (*model.Resource, error) + func (client *Client) UpdateResourceActiveState(ctx context.Context, resource *model.Resource) error + func (client *Client) UpdateServiceAccount(ctx context.Context, serviceAccount *model.ServiceAccount) (*model.ServiceAccount, error) + func (client *Client) UpdateServiceAccountRemoveResources(ctx context.Context, serviceAccountID string, resourceIDsToRemove []string) error + func (client *Client) UpdateServiceKey(ctx context.Context, serviceAccountKey *model.ServiceKey) (*model.ServiceKey, error) + func (client *Client) UpdateUser(ctx context.Context, input *model.UserUpdate) (*model.User, error) + func (client *Client) UpdateUserRole(ctx context.Context, input *model.UserUpdate) (*model.User, error) + func (client *Client) VerifyConnectorTokens(ctx context.Context, refreshToken, accessToken string) error + type HTTPError struct + Body []byte + RequestURI string + StatusCode int + func NewHTTPError(requestURI string, statusCode int, body []byte) *HTTPError + func (e *HTTPError) Error() string + type MutationError struct + Message string + func NewMutationError(message string) *MutationError + func (e *MutationError) Error() string + type MutationResponse interface + ErrorStr func() string + OK func() bool + type PortRangeInput struct + End int + Start int + type ProtocolInput struct + Policy string + Ports []*PortRangeInput + type ProtocolsInput struct + AllowIcmp bool + TCP *ProtocolInput + UDP *ProtocolInput + type RemoteNetworkLocation string + type ResponseWithPayload interface + IsEmpty func() bool + type StringFilter struct + Filter string + Name string + type UsersFilter struct + Email *StringFilter + FirstName *StringFilter + LastName *StringFilter + Roles []string Other modules containing this package github.com/Twingate/terraform-provider-twingate github.com/Twingate/terraform-provider-twingate/v3