stainless

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const BASE_URL string = "https://api.stainlessapi.com/api"

Variables

This section is empty.

Functions

func WithCredentials

func WithCredentials(credentials string) func(*Client) error

Types

type Build

type Build struct {
	ID          int        `json:"id"`
	Status      string     `json:"status"`
	StartedAt   string     `json:"startedAt"`
	EndedAt     string     `json:"endedAt"`
	Org         string     `json:"org"`
	Project     string     `json:"project"`
	Sdks        []BuildSDK `json:"sdks"`
	TriggeredBy string     `json:"triggeredBy"`
}

type BuildSDK

type BuildSDK struct {
	Language string `json:"language"`
	Status   string `json:"status"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(options ...func(*Client) error) (*Client, error)

func (*Client) Do

func (client *Client) Do(req *http.Request) (*http.Response, error)

func (*Client) GenerateSdk

func (client *Client) GenerateSdk(orgName, projectName, openApiSpec, stainlessConfig, outDir, language string) (*GenerateResponse, error)

func (*Client) GetBuildStatus

func (client *Client) GetBuildStatus(orgName, projectName, language, branch string) (*GetBuildStatusResponse, error)

func (*Client) GetDefaultOrg

func (client *Client) GetDefaultOrg() (string, error)

func (*Client) GetDefaultProject

func (client *Client) GetDefaultProject(orgName string) (string, error)

func (*Client) ListApiKeys

func (client *Client) ListApiKeys(orgName string) (*ListApiKeysResponse, error)

func (*Client) ListBuilds

func (client *Client) ListBuilds(orgName, projectName string) (*ListBuildsResponse, error)

func (*Client) ListMembers

func (client *Client) ListMembers(orgName string) (*ListMembersResponse, error)

func (*Client) ListOrgs

func (client *Client) ListOrgs() (*ListOrgsResponse, error)

func (*Client) ListProjects

func (client *Client) ListProjects(orgName string) (*ListProjectsResponse, error)

func (*Client) ListSdks

func (client *Client) ListSdks(orgName, projectName string) (*ListSdksResponse, error)

func (*Client) NewStainlessApiURL

func (client *Client) NewStainlessApiURL(orgName, projectName, path string) string

func (*Client) Request

func (client *Client) Request(method, url string, body io.Reader) (*http.Request, error)

type GenerateResponse

type GenerateResponse struct {
	ProjectName string `json:"projectName"`
	Generate    bool   `json:"generated"`
	NewSha      string `json:"newSha"`
	HasMerged   bool   `json:"hasMerged"`
}

type GetBuildStatusResponse

type GetBuildStatusResponse struct {
	ID                  uint64    `json:"id"`
	Status              string    `json:"status"`
	DiagnosticsFileURL  string    `json:"diagnosticsFileURL"`
	StartedGeneratingAt time.Time `json:"startedGeneratingAt"`
	EndedAt             time.Time `json:"endedAt"`
	HasGenerated        bool      `json:"hasGenerated"`
}

type ListApiKeysResponse

type ListApiKeysResponse []struct {
	ID            string    `json:"id"`
	Key           string    `json:"key"`
	Name          string    `json:"name"`
	CreatedAt     time.Time `json:"createdAt"`
	UpdatedAt     time.Time `json:"updatedAt"`
	DeletedAt     time.Time `json:"deletedAt"`
	CreatedByUser struct {
		Name     string `json:"name"`
		Email    string `json:"email"`
		ImageURL string `json:"imageURL"`
	} `json:"createdByUser"`
}

type ListBuildsResponse

type ListBuildsResponse struct {
	Builds          []Build `json:"builds"`
	HasNextPage     bool    `json:"hasNextPage"`
	HasPreviousPage bool    `json:"hasPreviousPage"`
}

type ListMembersResponse

type ListMembersResponse []struct {
	UserID   string `json:"userID"`
	InviteID string `json:"inviteID"`
	Name     string `json:"name"`
	Email    string `json:"email"`
	ImageURL string `json:"imageURL"`
	Role     string `json:"role"`
}

type ListOrgsResponse

type ListOrgsResponse struct {
	StartCursor     string    `json:"startCursor"`
	EndCursor       string    `json:"EndCursor"`
	HasNextPage     bool      `json:"hasNextPage"`
	HasPreviousPage bool      `json:"hasPreviousPage"`
	Items           []OrgItem `json:"items"`
}

type ListProjectsResponse

type ListProjectsResponse struct {
	StartCursor     string        `json:"startCursor"`
	EndCursor       string        `json:"EndCursor"`
	HasNextPage     bool          `json:"hasNextPage"`
	HasPreviousPage bool          `json:"hasPreviousPage"`
	Items           []ProjectItem `json:"items"`
}

type ListSdksResponse

type ListSdksResponse struct {
	Items []SdkListItem `json:"items"`
}

type OrgItem

type OrgItem struct {
	Name        string `json:"name"`
	DisplayName string `json:"displayName"`
}

type ProjectItem

type ProjectItem struct {
	Name string `json:"name"`
	Org  string `json:"org"`
}

type SdkListItem

type SdkListItem struct {
	ID                    int    `json:"id"`
	Org                   string `json:"org"`
	Project               string `json:"project"`
	Language              string `json:"language"`
	InternalRepositoryURL string `json:"internalRepositoryUrl"`
	AutoMergeEnabled      bool   `json:"autoMergeEnabled"`
	IsLive                bool   `json:"isLive"`
	ReleaseInformation    struct {
		PackageName string `json:"packageName"`
		Repo        string `json:"repo"`
	} `json:"releaseInformation"`
	CustomCodeInformation struct {
		GistURL      string `json:"gistUrl"`
		LinesAdded   int    `json:"linesAdded"`
		LinesRemoved int    `json:"linesRemoved"`
	} `json:"customCodeInformation"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL