{"modulePath":"github.com/nmiyake/circleci-cli","version":"v0.1.4308","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package api\n\n## Functions\n\n```go\nfunc OrbLatestVersion(opts Options, namespace string, orb string) (string, error)\n```\nOrbLatestVersion finds the latest published version of an orb and returns it. If it doesn't find a version, it will return 0.0.0 for the orb's version\n\n```go\nfunc OrbSource(opts Options, orbRef string) (string, error)\n```\nOrbSource gets the source of an orb\n\n## Types\n\n```go\ntype BuildConfigResponse struct {\n\tBuildConfig struct {\n\t\tConfigResponse\n\t}\n}\n```\nBuildConfigResponse wraps the GQL result of the ConfigQuery\n\n```go\ntype ConfigResponse struct {\n\tValid      bool\n\tSourceYaml string\n\tOutputYaml string\n\n\tErrors GQLErrorsCollection\n}\n```\nConfigResponse is a structure that matches the result of the GQL query, so that we can use mapstructure to convert from nested maps to a strongly typed struct.\n\n```go\nfunc ConfigQuery(opts Options, configPath string) (*ConfigResponse, error)\n```\nConfigQuery calls the GQL API to validate and process config\n\n```go\nfunc OrbQuery(opts Options, configPath string) (*ConfigResponse, error)\n```\nOrbQuery validated and processes an orb.\n\n```go\ntype CreateNamespaceResponse struct {\n\tCreateNamespace struct {\n\t\tNamespace struct {\n\t\t\tCreatedAt string\n\t\t\tID        string\n\t\t}\n\n\t\tErrors GQLErrorsCollection\n\t}\n}\n```\nCreateNamespaceResponse type matches the data shape of the GQL response for creating a namespace\n\n```go\nfunc CreateNamespace(opts Options, name string, organizationName string, organizationVcs string) (*CreateNamespaceResponse, error)\n```\nCreateNamespace creates (reserves) a namespace for an organization\n\n```go\ntype CreateOrbResponse struct {\n\tCreateOrb struct {\n\t\tOrb    Orb\n\t\tErrors GQLErrorsCollection\n\t}\n}\n```\nCreateOrbResponse type matches the data shape of the GQL response for creating an orb\n\n```go\nfunc CreateOrb(opts Options, namespace string, name string) (*CreateOrbResponse, error)\n```\nCreateOrb creates (reserves) an orb within a namespace\n\n```go\ntype GQLErrorsCollection []GQLResponseError\n```\nGQLErrorsCollection is a slice of errors returned by the GraphQL server. Each error is made up of a GQLResponseError type.\n\n```go\nfunc (errs GQLErrorsCollection) Error() string\n```\nError turns a GQLErrorsCollection into an acceptable error string that can be printed to the user.\n\n```go\ntype GQLResponseError struct {\n\tMessage       string\n\tValue         string\n\tAllowedValues []string\n\tEnumType      string\n\tType          string\n}\n```\nGQLResponseError is a mapping of the data returned by the GraphQL server of key-value pairs. Typically used with the structure \"Message: string\", but other response errors provide additional fields.\n\n```go\ntype GetNamespaceResponse struct {\n\tRegistryNamespace struct {\n\t\tID string\n\t}\n}\n```\nGetNamespaceResponse type wraps the GQL response for fetching a namespace\n\n```go\ntype GetOrganizationResponse struct {\n\tOrganization struct {\n\t\tID string\n\t}\n}\n```\nGetOrganizationResponse type wraps the GQL response for fetching an organization and ID.\n\n```go\ntype IntrospectionResponse struct {\n\tSchema struct {\n\t\tMutationType struct {\n\t\t\tName string\n\t\t}\n\t\tQueryType struct {\n\t\t\tName string\n\t\t}\n\t\tTypes []struct {\n\t\t\tDescription string\n\t\t\tFields      []struct {\n\t\t\t\tName string\n\t\t\t}\n\t\t\tKind string\n\t\t\tName string\n\t\t}\n\t} `json:\"__schema\"`\n}\n```\nIntrospectionResponse matches the result from making an introspection query\n\n```go\nfunc IntrospectionQuery(opts Options) (*IntrospectionResponse, error)\n```\nIntrospectionQuery makes a query on the API asking for bits of the schema This query isn't intended to get the entire schema, there are better tools for that.\n\n```go\ntype NamespaceOrbResponse struct {\n\tRegistryNamespace struct {\n\t\tName string\n\t\tOrbs struct {\n\t\t\tEdges []struct {\n\t\t\t\tCursor string\n\t\t\t\tNode   OrbWithData\n\t\t\t}\n\t\t\tTotalCount int\n\t\t\tPageInfo   struct {\n\t\t\t\tHasNextPage bool\n\t\t\t}\n\t\t}\n\t}\n}\n```\nNamespaceOrbResponse type matches the result from GQL. So that we can use mapstructure to convert from nested maps to a strongly typed struct.\n\n```go\ntype Options struct {\n\tContext context.Context\n\tClient  *client.Client\n}\n```\nOptions wraps common requirements for API functions into a single struct.\n\n```go\ntype Orb struct {\n\tID        string\n\tName      string\n\tNamespace string\n\tCreatedAt string\n\n\tSource         string\n\tHighestVersion string `json:\"version\"`\n\n\tCommands  map[string]OrbElement\n\tJobs      map[string]OrbElement\n\tExecutors map[string]OrbElement\n\tVersions  []OrbVersion\n}\n```\nOrb is a struct for containing the yaml-unmarshaled contents of an orb\n\n```go\nfunc OrbIncrementVersion(opts Options, configPath string, namespace string, orb string, segment string) (*Orb, error)\n```\nOrbIncrementVersion accepts an orb and segment to increment the orb.\n\n```go\nfunc OrbPromote(opts Options, namespace string, orb string, label string, segment string) (*Orb, error)\n```\nOrbPromote takes an orb and a development version and increments a semantic release with the given segment.\n\n```go\nfunc OrbPublishByID(opts Options, configPath string, orbID string, orbVersion string) (*Orb, error)\n```\nOrbPublishByID publishes a new version of an orb by id\n\n```go\ntype OrbConfigResponse struct {\n\tOrbConfig struct {\n\t\tConfigResponse\n\t}\n}\n```\nOrbConfigResponse wraps the GQL result for OrbQuery.\n\n```go\ntype OrbElement RealOrbElement\n```\nOrbElement implements RealOrbElement interface and allows us to deserialize by hand.\n\n```go\nfunc (orbElement *OrbElement) UnmarshalYAML(unmarshal func(interface{}) error) error\n```\nUnmarshalYAML method allows OrbElement to be a string or a map. For now, don't even try to dereference the string, just return what is essentially an empty OrbElement (no description or parameters)\n\n```go\ntype OrbElementParameter struct {\n\tDescription string      `json:\"-\"`\n\tType        string      `json:\"-\"`\n\tDefault     interface{} `json:\"-\"`\n}\n```\nOrbElementParameter represents the yaml-unmarshled contents of a parameter for a command/job/executor\n\n```go\ntype OrbIDResponse struct {\n\tOrb struct {\n\t\tID string\n\t}\n\tRegistryNamespace struct {\n\t\tID string\n\t}\n}\n```\nOrbIDResponse matches the GQL response for fetching an Orb and ID\n\n```go\nfunc OrbID(opts Options, namespace string, orb string) (*OrbIDResponse, error)\n```\nOrbID fetches an orb returning the ID\n\n```go\ntype OrbLatestVersionResponse struct {\n\tOrb struct {\n\t\tVersions []OrbVersion\n\t}\n}\n```\nOrbLatestVersionResponse wraps the GQL result of fetching an Orb and latest version\n\n```go\ntype OrbListResponse struct {\n\tOrbs struct {\n\t\tTotalCount int\n\t\tEdges      []struct {\n\t\t\tCursor string\n\t\t\tNode   OrbWithData\n\t\t}\n\t\tPageInfo struct {\n\t\t\tHasNextPage bool\n\t\t}\n\t}\n}\n```\nOrbListResponse type matches the result from GQL. So that we can use mapstructure to convert from nested maps to a strongly typed struct.\n\n```go\ntype OrbPromoteResponse struct {\n\tPromoteOrb struct {\n\t\tOrb Orb\n\n\t\tErrors GQLErrorsCollection\n\t}\n}\n```\nThe OrbPromoteResponse type matches the data shape of the GQL response for promoting an orb.\n\n```go\ntype OrbPublishResponse struct {\n\tPublishOrb struct {\n\t\tOrb Orb\n\n\t\tErrors GQLErrorsCollection\n\t}\n}\n```\nThe OrbPublishResponse type matches the data shape of the GQL response for publishing an orb.\n\n```go\ntype OrbVersion struct {\n\tID        string\n\tVersion   string\n\tOrb       Orb\n\tSource    string\n\tCreatedAt string\n}\n```\nOrbVersion wraps the GQL result used by OrbSource and OrbInfo\n\n```go\nfunc OrbInfo(opts Options, orbRef string) (*OrbVersion, error)\n```\nOrbInfo gets the meta-data of an orb\n\n```go\ntype OrbWithData struct {\n\tName           string `json:\"name\"`\n\tHighestVersion string `json:\"version\"`\n\tVersions       []struct {\n\t\tVersion string `json:\"version\"`\n\t\tSource  string `json:\"source\"`\n\t} `json:\"versions\"`\n\n\t// These fields are printing manually when --details flag is added so hidden from JSON output.\n\tCommands  map[string]OrbElement `json:\"-\"`\n\tJobs      map[string]OrbElement `json:\"-\"`\n\tExecutors map[string]OrbElement `json:\"-\"`\n}\n```\nOrbWithData wraps an orb with select fields for deserializing into JSON.\n\n```go\ntype OrbsForListing struct {\n\tOrbs      []OrbWithData `json:\"orbs\"`\n\tNamespace string        `json:\"namespace,omitempty\"`\n}\n```\nOrbsForListing is a container type for multiple orbs that includes the namespace and orbs for deserializing back into JSON.\n\n```go\nfunc ListNamespaceOrbs(opts Options, namespace string) (*OrbsForListing, error)\n```\nListNamespaceOrbs queries the API to find all orbs belonging to the given namespace. Returns a collection of Orb objects containing their relevant data.\n\n```go\nfunc ListOrbs(opts Options, uncertified bool) (*OrbsForListing, error)\n```\nListOrbs queries the API to find all orbs. Returns a collection of Orb objects containing their relevant data.\n\n```go\ntype RealOrbElement struct {\n\tDescription string                         `json:\"-\"`\n\tParameters  map[string]OrbElementParameter `json:\"-\"`\n}\n```\nRealOrbElement represents the yaml-unmarshled contents of a named element under a command/job/executor\n\n```go\ntype WhoamiResponse struct {\n\tMe struct {\n\t\tName string\n\t}\n}\n```\nWhoamiResponse type matches the data shape of the GQL response for the current user\n\n```go\nfunc WhoamiQuery(opts Options) (*WhoamiResponse, error)\n```\nWhoamiQuery returns the result of querying the \\`/me\\` endpoint of the API\n\n","path":"github.com/nmiyake/circleci-cli/api","name":"api","synopsis":"","isRedistributable":true}
