Documentation
¶
Index ¶
- func CheckErr(cmd *cobra.Command, err error) bool
- func IsBadRequest(err error) bool
- func IsNoToken(err error) bool
- func IsNotFound(err error) bool
- func IsUnauthorized(err error) bool
- type APIError
- type ApplicationItem
- type Client
- func (c *Client) CreateApplication(name, description, organizationID string) (*CreateApplicationResponse, error)
- func (c *Client) CreateApplicationVersion(applicationID string) (*CreateApplicationVersionResponse, error)
- func (c *Client) GetApplicationByRepo(owner, repo string) (*GetApplicationByRepoResponse, error)
- func (c *Client) GetApplicationEnv(organizationID, applicationID string) (map[string]string, error)
- func (c *Client) GetApplicationResources(applicationID string) (*GetApplicationResourcesResponse, error)
- func (c *Client) GetOrganizationApplications(organizationID string) (*GetOrganizationApplicationsResponse, error)
- func (c *Client) GetOrganizations() (*OrganizationsResponse, error)
- func (c *Client) Logout() error
- func (c *Client) PollLogin(deviceCode string) (*LoginPollResponse, error)
- func (c *Client) StartLogin() (*LoginStartResponse, error)
- func (c *Client) VerifyToken() (*VerifyTokenResponse, error)
- type CreateApplicationRequest
- type CreateApplicationResponse
- type CreateApplicationVersionRequest
- type CreateApplicationVersionResponse
- type ErrorResponse
- type GetApplicationByRepoRequest
- type GetApplicationByRepoResponse
- type GetApplicationEnvRequest
- type GetApplicationEnvResponse
- type GetApplicationResourcesResponse
- type GetOrganizationApplicationsRequest
- type GetOrganizationApplicationsResponse
- type LoginPollRequest
- type LoginPollResponse
- type LoginStartResponse
- type NoTokenError
- type Organization
- type OrganizationsResponse
- type ResourceItem
- type VerifyTokenResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckErr ¶
CheckErr checks for errors and prints appropriate messages using the command's output Returns true if no error (ok to continue), false if there was an error
func IsBadRequest ¶
IsBadRequest checks if the error is a bad request error
func IsNotFound ¶
IsNotFound checks if the error is a not found error
func IsUnauthorized ¶
IsUnauthorized checks if the error is an unauthorized error
Types ¶
type ApplicationItem ¶ added in v0.1.6
type ApplicationItem struct {
ID string `json:"id"`
Name string `json:"name"`
GithubRepositoryName string `json:"githubRepositoryName"`
CloneURLSSH string `json:"cloneUrlSsh"`
CloneURLHTTPS string `json:"cloneUrlHttps"`
}
ApplicationItem represents a single application in the list
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents an API client for making authenticated requests
func (*Client) CreateApplication ¶
func (c *Client) CreateApplication(name, description, organizationID string) (*CreateApplicationResponse, error)
CreateApplication creates a new application with a GitHub repository
func (*Client) CreateApplicationVersion ¶ added in v0.1.2
func (c *Client) CreateApplicationVersion(applicationID string) (*CreateApplicationVersionResponse, error)
CreateApplicationVersion creates a new version of an application
func (*Client) GetApplicationByRepo ¶
func (c *Client) GetApplicationByRepo(owner, repo string) (*GetApplicationByRepoResponse, error)
GetApplicationByRepo retrieves an application by its repository owner and name
func (*Client) GetApplicationEnv ¶
GetApplicationEnv retrieves environment variables for an application
func (*Client) GetApplicationResources ¶ added in v0.1.1
func (c *Client) GetApplicationResources(applicationID string) (*GetApplicationResourcesResponse, error)
GetApplicationResources retrieves resources for an application
func (*Client) GetOrganizationApplications ¶ added in v0.1.6
func (c *Client) GetOrganizationApplications(organizationID string) (*GetOrganizationApplicationsResponse, error)
GetOrganizationApplications retrieves all applications for an organization
func (*Client) GetOrganizations ¶
func (c *Client) GetOrganizations() (*OrganizationsResponse, error)
GetOrganizations retrieves the list of organizations for the authenticated user
func (*Client) PollLogin ¶
func (c *Client) PollLogin(deviceCode string) (*LoginPollResponse, error)
PollLogin polls the login endpoint to check if the user has authorized the device
func (*Client) StartLogin ¶
func (c *Client) StartLogin() (*LoginStartResponse, error)
StartLogin initiates the device flow login process
func (*Client) VerifyToken ¶
func (c *Client) VerifyToken() (*VerifyTokenResponse, error)
VerifyToken verifies the current token and returns user information
type CreateApplicationRequest ¶
type CreateApplicationRequest struct {
Name string `json:"name"`
Description string `json:"description"`
OrganizationID string `json:"organizationId"`
}
CreateApplicationRequest represents the request body for POST /applications
type CreateApplicationResponse ¶
type CreateApplicationResponse struct {
ApplicationID string `json:"applicationId"`
RepositoryName string `json:"repositoryName"`
CloneURLSSH string `json:"cloneUrlSsh"`
CloneURLHTTPS string `json:"cloneUrlHttps"`
}
CreateApplicationResponse represents the response from POST /applications
type CreateApplicationVersionRequest ¶ added in v0.1.2
type CreateApplicationVersionRequest struct {
ApplicationID string `json:"applicationId"`
}
CreateApplicationVersionRequest represents the request body for POST /applications/versions
type CreateApplicationVersionResponse ¶ added in v0.1.2
type CreateApplicationVersionResponse struct {
VersionID string `json:"versionId"`
}
CreateApplicationVersionResponse represents the response from POST /applications/versions
type ErrorResponse ¶
type ErrorResponse struct {
Error string `json:"error"`
ErrorDescription string `json:"error_description"`
Message string `json:"message"`
}
ErrorResponse represents an error response from the API
type GetApplicationByRepoRequest ¶
GetApplicationByRepoRequest represents the request body for GET /application/from-repo
type GetApplicationByRepoResponse ¶
type GetApplicationByRepoResponse struct {
ApplicationID string `json:"applicationId"`
}
GetApplicationByRepoResponse represents the response from GET /application/from-repo
type GetApplicationEnvRequest ¶
type GetApplicationEnvRequest struct {
OrganizationID string `json:"organizationId"`
ApplicationID string `json:"applicationId"`
}
GetApplicationEnvRequest represents the request body for POST /application/env
type GetApplicationEnvResponse ¶
GetApplicationEnvResponse represents the response from POST /application/env
type GetApplicationResourcesResponse ¶ added in v0.1.1
type GetApplicationResourcesResponse struct {
Resources []ResourceItem `json:"resources"`
}
GetApplicationResourcesResponse represents the response from GET /applications/:applicationId/resources
type GetOrganizationApplicationsRequest ¶ added in v0.1.7
type GetOrganizationApplicationsRequest struct {
OrganizationID string `json:"organizationId"`
}
GetOrganizationApplicationsRequest represents the request body for POST /organizations/applications
type GetOrganizationApplicationsResponse ¶ added in v0.1.6
type GetOrganizationApplicationsResponse struct {
Applications []ApplicationItem `json:"applications"`
}
GetOrganizationApplicationsResponse represents the response from POST /organizations/applications
type LoginPollRequest ¶
type LoginPollRequest struct {
DeviceCode string `json:"device_code"`
}
LoginPollRequest represents the request body for POST /login/poll
type LoginPollResponse ¶
type LoginPollResponse struct {
// Pending state
Error string `json:"error,omitempty"`
ErrorDescription string `json:"error_description,omitempty"`
// Success state
AccessToken string `json:"access_token,omitempty"`
TokenType string `json:"token_type,omitempty"`
ExpiresIn int `json:"expires_in,omitempty"`
}
LoginPollResponse represents the response from POST /login/poll
type LoginStartResponse ¶
type LoginStartResponse struct {
DeviceCode string `json:"device_code"`
UserCode string `json:"user_code"`
VerificationURI string `json:"verification_uri"`
ExpiresIn int `json:"expires_in"`
Interval int `json:"interval"`
}
LoginStartResponse represents the response from POST /login/start
type NoTokenError ¶
type NoTokenError struct {
OriginalError error
}
NoTokenError represents an error when no token is available
func (*NoTokenError) Error ¶
func (e *NoTokenError) Error() string
type Organization ¶
Organization represents an organization from the API
type OrganizationsResponse ¶
type OrganizationsResponse struct {
Organizations []Organization `json:"organizations"`
}
OrganizationsResponse represents the response from GET /organizations
type ResourceItem ¶ added in v0.1.1
type ResourceItem struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
}
ResourceItem represents a single resource