Documentation ¶
Overview ¶
Package testclient provides the graph client for interacting with the tenant api. WARNING: THIS IS ONLY MEANT TO BE USED INTERNALLY FOR TESTS The client in this folder is generated automatically by gqlgenc.
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) GetTenant(ctx context.Context, id gidx.PrefixedID, ...) (*GetTenant, error)
- func (c *Client) GetTenantChildByID(ctx context.Context, id gidx.PrefixedID, childID gidx.PrefixedID, ...) (*GetTenantChildByID, error)
- func (c *Client) GetTenantChildren(ctx context.Context, id gidx.PrefixedID, orderBy *TenantOrder, ...) (*GetTenantChildren, error)
- func (c *Client) TenantCreate(ctx context.Context, input CreateTenantInput, ...) (*TenantCreate, error)
- func (c *Client) TenantDelete(ctx context.Context, id gidx.PrefixedID, ...) (*TenantDelete, error)
- func (c *Client) TenantUpdate(ctx context.Context, id gidx.PrefixedID, input UpdateTenantInput, ...) (*TenantUpdate, error)
- type CreateTenantInput
- type Entity
- type GetTenant
- type GetTenantChildByID
- type GetTenantChildren
- type MetadataNode
- type Mutation
- type Node
- type OrderDirection
- type PageInfo
- type Query
- type ResourceOwner
- type Service
- type Tenant
- type TenantConnection
- type TenantCreate
- type TenantCreatePayload
- type TenantDelete
- type TenantDeletePayload
- type TenantEdge
- type TenantOrder
- type TenantOrderField
- type TenantUpdate
- type TenantUpdatePayload
- type TenantWhereInput
- type TestClient
- type UpdateTenantInput
Constants ¶
const GetTenantChildByIDDocument = `` /* 184-byte string literal not displayed */
const GetTenantChildrenDocument = `` /* 188-byte string literal not displayed */
const GetTenantDocument = `` /* 132-byte string literal not displayed */
const TenantCreateDocument = `` /* 157-byte string literal not displayed */
const TenantDeleteDocument = `mutation TenantDelete ($id: ID!) {
tenantDelete(id: $id) {
deletedID
}
}
`
const TenantUpdateDocument = `` /* 176-byte string literal not displayed */
Variables ¶
var AllOrderDirection = []OrderDirection{ OrderDirectionAsc, OrderDirectionDesc, }
var AllTenantOrderField = []TenantOrderField{ TenantOrderFieldCreatedAt, TenantOrderFieldUpdatedAt, TenantOrderFieldName, }
Functions ¶
This section is empty.
Types ¶
type Client ¶
func (*Client) GetTenant ¶
func (c *Client) GetTenant(ctx context.Context, id gidx.PrefixedID, httpRequestOptions ...client.HTTPRequestOption) (*GetTenant, error)
func (*Client) GetTenantChildByID ¶
func (c *Client) GetTenantChildByID(ctx context.Context, id gidx.PrefixedID, childID gidx.PrefixedID, httpRequestOptions ...client.HTTPRequestOption) (*GetTenantChildByID, error)
func (*Client) GetTenantChildren ¶
func (c *Client) GetTenantChildren(ctx context.Context, id gidx.PrefixedID, orderBy *TenantOrder, httpRequestOptions ...client.HTTPRequestOption) (*GetTenantChildren, error)
func (*Client) TenantCreate ¶
func (c *Client) TenantCreate(ctx context.Context, input CreateTenantInput, httpRequestOptions ...client.HTTPRequestOption) (*TenantCreate, error)
func (*Client) TenantDelete ¶
func (c *Client) TenantDelete(ctx context.Context, id gidx.PrefixedID, httpRequestOptions ...client.HTTPRequestOption) (*TenantDelete, error)
func (*Client) TenantUpdate ¶
func (c *Client) TenantUpdate(ctx context.Context, id gidx.PrefixedID, input UpdateTenantInput, httpRequestOptions ...client.HTTPRequestOption) (*TenantUpdate, error)
type CreateTenantInput ¶
type CreateTenantInput struct { // The name of a tenant. Name string `json:"name"` // An optional description of the tenant. Description *string `json:"description,omitempty"` ParentID *gidx.PrefixedID `json:"parentID,omitempty"` }
Input information to create a tenant.
type GetTenant ¶
type GetTenant struct { Tenant struct { ID gidx.PrefixedID "json:\"id\" graphql:\"id\"" Name string "json:\"name\" graphql:\"name\"" Description *string "json:\"description\" graphql:\"description\"" CreatedAt time.Time "json:\"createdAt\" graphql:\"createdAt\"" UpdatedAt time.Time "json:\"updatedAt\" graphql:\"updatedAt\"" Parent *struct { ID gidx.PrefixedID "json:\"id\" graphql:\"id\"" Name string "json:\"name\" graphql:\"name\"" } "json:\"parent\" graphql:\"parent\"" } "json:\"tenant\" graphql:\"tenant\"" }
type GetTenantChildByID ¶
type GetTenantChildByID struct { Tenant struct { Children struct { Edges []*struct { Node *struct { ID gidx.PrefixedID "json:\"id\" graphql:\"id\"" Name string "json:\"name\" graphql:\"name\"" Description *string "json:\"description\" graphql:\"description\"" } "json:\"node\" graphql:\"node\"" } "json:\"edges\" graphql:\"edges\"" } "json:\"children\" graphql:\"children\"" } "json:\"tenant\" graphql:\"tenant\"" }
type GetTenantChildren ¶
type GetTenantChildren struct { Tenant struct { Children struct { Edges []*struct { Node *struct { ID gidx.PrefixedID "json:\"id\" graphql:\"id\"" Name string "json:\"name\" graphql:\"name\"" Description *string "json:\"description\" graphql:\"description\"" } "json:\"node\" graphql:\"node\"" } "json:\"edges\" graphql:\"edges\"" } "json:\"children\" graphql:\"children\"" } "json:\"tenant\" graphql:\"tenant\"" }
type MetadataNode ¶
type MetadataNode interface { IsMetadataNode() GetID() gidx.PrefixedID }
type Node ¶
type Node interface { IsNode() // The id of the object. GetID() gidx.PrefixedID }
An object with an ID. Follows the [Relay Global Object Identification Specification](https://relay.dev/graphql/objectidentification.htm)
type OrderDirection ¶
type OrderDirection string
Possible directions in which to order a list of items when provided an `orderBy` argument.
const ( // Specifies an ascending order for a given `orderBy` argument. OrderDirectionAsc OrderDirection = "ASC" // Specifies a descending order for a given `orderBy` argument. OrderDirectionDesc OrderDirection = "DESC" )
func (OrderDirection) IsValid ¶
func (e OrderDirection) IsValid() bool
func (OrderDirection) MarshalGQL ¶
func (e OrderDirection) MarshalGQL(w io.Writer)
func (OrderDirection) String ¶
func (e OrderDirection) String() string
func (*OrderDirection) UnmarshalGQL ¶
func (e *OrderDirection) UnmarshalGQL(v interface{}) error
type PageInfo ¶
type PageInfo struct { // When paginating forwards, are there more items? HasNextPage bool `json:"hasNextPage"` // When paginating backwards, are there more items? HasPreviousPage bool `json:"hasPreviousPage"` // When paginating backwards, the cursor to continue. StartCursor *string `json:"startCursor,omitempty"` // When paginating forwards, the cursor to continue. EndCursor *string `json:"endCursor,omitempty"` }
Information about pagination in a connection. https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo
type ResourceOwner ¶
type ResourceOwner interface { IsResourceOwner() GetID() gidx.PrefixedID }
type Tenant ¶
type Tenant struct { // ID for the tenant. ID gidx.PrefixedID `json:"id"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` // The name of a tenant. Name string `json:"name"` // An optional description of the tenant. Description *string `json:"description,omitempty"` Parent *Tenant `json:"parent,omitempty"` Children *TenantConnection `json:"children"` }
func (Tenant) GetID ¶
func (this Tenant) GetID() gidx.PrefixedID
func (Tenant) IsMetadataNode ¶
func (Tenant) IsMetadataNode()
func (Tenant) IsResourceOwner ¶
func (Tenant) IsResourceOwner()
type TenantConnection ¶
type TenantConnection struct { // A list of edges. Edges []*TenantEdge `json:"edges,omitempty"` // Information to aid in pagination. PageInfo *PageInfo `json:"pageInfo"` // Identifies the total count of items in the connection. TotalCount int64 `json:"totalCount"` }
A connection to a list of items.
type TenantCreate ¶
type TenantCreate struct { TenantCreate struct { Tenant struct { ID gidx.PrefixedID "json:\"id\" graphql:\"id\"" Name string "json:\"name\" graphql:\"name\"" Description *string "json:\"description\" graphql:\"description\"" Parent *struct { ID gidx.PrefixedID "json:\"id\" graphql:\"id\"" } "json:\"parent\" graphql:\"parent\"" } "json:\"tenant\" graphql:\"tenant\"" } "json:\"tenantCreate\" graphql:\"tenantCreate\"" }
type TenantCreatePayload ¶
type TenantCreatePayload struct { // The created tenant. Tenant *Tenant `json:"tenant"` }
Return response from tenantCreate.
type TenantDelete ¶
type TenantDelete struct { TenantDelete struct { DeletedID gidx.PrefixedID "json:\"deletedID\" graphql:\"deletedID\"" } "json:\"tenantDelete\" graphql:\"tenantDelete\"" }
type TenantDeletePayload ¶
type TenantDeletePayload struct { // The ID of the deleted tenant. DeletedID gidx.PrefixedID `json:"deletedID"` }
Return response from tenantDelete.
type TenantEdge ¶
type TenantEdge struct { // The item at the end of the edge. Node *Tenant `json:"node,omitempty"` // A cursor for use in pagination. Cursor string `json:"cursor"` }
An edge in a connection.
type TenantOrder ¶
type TenantOrder struct { // The ordering direction. Direction OrderDirection `json:"direction"` // The field by which to order Tenants. Field TenantOrderField `json:"field"` }
Ordering options for Tenant connections
type TenantOrderField ¶
type TenantOrderField string
Properties by which Tenant connections can be ordered.
const ( TenantOrderFieldCreatedAt TenantOrderField = "CREATED_AT" TenantOrderFieldUpdatedAt TenantOrderField = "UPDATED_AT" TenantOrderFieldName TenantOrderField = "NAME" )
func (TenantOrderField) IsValid ¶
func (e TenantOrderField) IsValid() bool
func (TenantOrderField) MarshalGQL ¶
func (e TenantOrderField) MarshalGQL(w io.Writer)
func (TenantOrderField) String ¶
func (e TenantOrderField) String() string
func (*TenantOrderField) UnmarshalGQL ¶
func (e *TenantOrderField) UnmarshalGQL(v interface{}) error
type TenantUpdate ¶
type TenantUpdate struct { TenantUpdate struct { Tenant struct { ID gidx.PrefixedID "json:\"id\" graphql:\"id\"" Name string "json:\"name\" graphql:\"name\"" Description *string "json:\"description\" graphql:\"description\"" Parent *struct { ID gidx.PrefixedID "json:\"id\" graphql:\"id\"" } "json:\"parent\" graphql:\"parent\"" } "json:\"tenant\" graphql:\"tenant\"" } "json:\"tenantUpdate\" graphql:\"tenantUpdate\"" }
type TenantUpdatePayload ¶
type TenantUpdatePayload struct { // The updated tenant. Tenant *Tenant `json:"tenant"` }
Return response from tenantUpdate.
type TenantWhereInput ¶
type TenantWhereInput struct { Not *TenantWhereInput `json:"not,omitempty"` And []*TenantWhereInput `json:"and,omitempty"` Or []*TenantWhereInput `json:"or,omitempty"` // id field predicates ID *gidx.PrefixedID `json:"id,omitempty"` IDNeq *gidx.PrefixedID `json:"idNEQ,omitempty"` IDIn []gidx.PrefixedID `json:"idIn,omitempty"` IDNotIn []gidx.PrefixedID `json:"idNotIn,omitempty"` IDGt *gidx.PrefixedID `json:"idGT,omitempty"` IDGte *gidx.PrefixedID `json:"idGTE,omitempty"` IDLt *gidx.PrefixedID `json:"idLT,omitempty"` IDLte *gidx.PrefixedID `json:"idLTE,omitempty"` // created_at field predicates CreatedAt *time.Time `json:"createdAt,omitempty"` CreatedAtNeq *time.Time `json:"createdAtNEQ,omitempty"` CreatedAtIn []*time.Time `json:"createdAtIn,omitempty"` CreatedAtNotIn []*time.Time `json:"createdAtNotIn,omitempty"` CreatedAtGt *time.Time `json:"createdAtGT,omitempty"` CreatedAtGte *time.Time `json:"createdAtGTE,omitempty"` CreatedAtLt *time.Time `json:"createdAtLT,omitempty"` CreatedAtLte *time.Time `json:"createdAtLTE,omitempty"` // updated_at field predicates UpdatedAt *time.Time `json:"updatedAt,omitempty"` UpdatedAtNeq *time.Time `json:"updatedAtNEQ,omitempty"` UpdatedAtIn []*time.Time `json:"updatedAtIn,omitempty"` UpdatedAtNotIn []*time.Time `json:"updatedAtNotIn,omitempty"` UpdatedAtGt *time.Time `json:"updatedAtGT,omitempty"` UpdatedAtGte *time.Time `json:"updatedAtGTE,omitempty"` UpdatedAtLt *time.Time `json:"updatedAtLT,omitempty"` UpdatedAtLte *time.Time `json:"updatedAtLTE,omitempty"` // parent edge predicates HasParent *bool `json:"hasParent,omitempty"` HasParentWith []*TenantWhereInput `json:"hasParentWith,omitempty"` // children edge predicates HasChildren *bool `json:"hasChildren,omitempty"` HasChildrenWith []*TenantWhereInput `json:"hasChildrenWith,omitempty"` }
TenantWhereInput is used for filtering Tenant objects. Input was generated by ent.
type TestClient ¶
type TestClient interface { GetTenant(ctx context.Context, id gidx.PrefixedID, httpRequestOptions ...client.HTTPRequestOption) (*GetTenant, error) GetTenantChildByID(ctx context.Context, id gidx.PrefixedID, childID gidx.PrefixedID, httpRequestOptions ...client.HTTPRequestOption) (*GetTenantChildByID, error) GetTenantChildren(ctx context.Context, id gidx.PrefixedID, orderBy *TenantOrder, httpRequestOptions ...client.HTTPRequestOption) (*GetTenantChildren, error) TenantCreate(ctx context.Context, input CreateTenantInput, httpRequestOptions ...client.HTTPRequestOption) (*TenantCreate, error) TenantDelete(ctx context.Context, id gidx.PrefixedID, httpRequestOptions ...client.HTTPRequestOption) (*TenantDelete, error) TenantUpdate(ctx context.Context, id gidx.PrefixedID, input UpdateTenantInput, httpRequestOptions ...client.HTTPRequestOption) (*TenantUpdate, error) }
func NewClient ¶
func NewClient(cli *http.Client, baseURL string, options ...client.HTTPRequestOption) TestClient
type UpdateTenantInput ¶
type UpdateTenantInput struct { // The name of a tenant. Name *string `json:"name,omitempty"` // An optional description of the tenant. Description *string `json:"description,omitempty"` ClearDescription *bool `json:"clearDescription,omitempty"` }
Input information to update a tenant.