diff --git a/VERSION.txt b/VERSION.txt index 04e1946..8c43fb4 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -v0.1.3 +v0.1.4 diff --git a/base64helpers.go b/base64helpers.go index 4b37fef..23ead7d 100644 --- a/base64helpers.go +++ b/base64helpers.go @@ -10,7 +10,7 @@ import ( // This function will automatically base64 decode the contents of the result output. // // This function is a wrapper around the GetConversion function. -func (c *FileService) GetConversionWithBase64Helper(id string) (*FileConversionWithOutput, []byte, error) { +func (c *FileService) GetConversionWithBase64Helper(id string) (*AsyncAPICallOutput, []byte, error) { resp, err := c.GetConversion(id) if err != nil { return nil, nil, err @@ -34,7 +34,7 @@ func (c *FileService) GetConversionWithBase64Helper(id string) (*FileConversionW // src file and output file. // // This function is a wrapper around the CreateConversion function. -func (c *FileService) CreateConversionWithBase64Helper(srcFormat FileConversionSourceFormat, outputFormat FileConversionOutputFormat, body []byte) (*FileConversionWithOutput, []byte, error) { +func (c *FileService) CreateConversionWithBase64Helper(srcFormat FileSourceFormat, outputFormat FileOutputFormat, body []byte) (*FileConversion, []byte, error) { var b bytes.Buffer encoder := base64.NewEncoder(base64.StdEncoding, &b) // Encode the body as base64. diff --git a/client.go b/client.go index 13f3cd9..3874dc8 100644 --- a/client.go +++ b/client.go @@ -21,8 +21,12 @@ type Client struct { APIToken *APITokenService // File: CAD file operations. Create, get, and list CAD file conversions. More endpoints will be added here in the future as we build out transforms, etc on CAD models. File *FileService + // Hidden: Hidden API endpoints that should not show up in the docs. + Hidden *HiddenService // Meta: Meta information about the API. Meta *MetaService + // Payment: Operations around payments and billing. + Payment *PaymentService // Session: Sessions allow users to call the API from their session cookie in the browser. Session *SessionService // User: A user is someone who uses the KittyCAD API. Here, we can create, delete, and list users. We can also get information about a user. Operations will only be authorized if the user is requesting information about themselves. @@ -38,9 +42,15 @@ type APITokenService service // FileService: CAD file operations. Create, get, and list CAD file conversions. More endpoints will be added here in the future as we build out transforms, etc on CAD models. type FileService service +// HiddenService: Hidden API endpoints that should not show up in the docs. +type HiddenService service + // MetaService: Meta information about the API. type MetaService service +// PaymentService: Operations around payments and billing. +type PaymentService service + // SessionService: Sessions allow users to call the API from their session cookie in the browser. type SessionService service diff --git a/generate/generate.go b/generate/generate.go index c5d92cd..4ca53d1 100644 --- a/generate/generate.go +++ b/generate/generate.go @@ -410,10 +410,6 @@ func writePath(doc *openapi3.T, f *os.File, path string, p *openapi3.PathItem) { if p.Head != nil { writeMethod(doc, f, http.MethodHead, path, p.Head, false) } - - if p.Options != nil { - writeMethod(doc, f, http.MethodOptions, path, p.Options, false) - } } func writeMethod(doc *openapi3.T, f *os.File, method string, path string, o *openapi3.Operation, isGetAllPages bool) { @@ -690,6 +686,8 @@ func writeMethod(doc *openapi3.T, f *os.File, method string, path string, o *ope fmt.Fprintf(f, " %q: %s,\n", name, n) } else if t == "int" { fmt.Fprintf(f, " %q: strconv.Itoa(%s),\n", name, n) + } else if t == "float64" { + fmt.Fprintf(f, " %q: fmt.Sprintf(\"%%f\", %s),\n", name, n) } else { fmt.Fprintf(f, " %q: string(%s),\n", name, n) } @@ -798,6 +796,10 @@ func getSuccessResponseType(o *openapi3.Operation, isGetAllPages bool) (string, return getReferenceSchema(content.Schema), getAllPagesType } + if content.Schema.Value.Title == "Null" { + return "", "" + } + if content.Schema.Value.Type == "array" { return printType("", content.Schema), getAllPagesType } diff --git a/lib.go b/lib.go index 4d10de4..b1251b8 100644 --- a/lib.go +++ b/lib.go @@ -58,6 +58,7 @@ func NewClient(token, userAgent string) (*Client, error) { client.Meta = &MetaService{client: client} client.User = &UserService{client: client} client.APICall = &APICallService{client: client} + client.Payment = &PaymentService{client: client} client.APIToken = &APITokenService{client: client} client.Session = &SessionService{client: client} diff --git a/lib_test.go b/lib_test.go index 547480d..c32e8e4 100644 --- a/lib_test.go +++ b/lib_test.go @@ -52,7 +52,7 @@ func TestFileConversion(t *testing.T) { t.Fatalf("reading the test file %q failed: %v", file, err) } - fc, output, err := client.File.CreateConversionWithBase64Helper(FileConversionSourceFormatStl, FileConversionOutputFormatObj, body) + fc, output, err := client.File.CreateConversionWithBase64Helper(FileSourceFormatStl, FileOutputFormatObj, body) if err != nil { t.Fatalf("getting the file conversion failed: %v", err) } diff --git a/paths.go b/paths.go index 7614c5d..25068d5 100755 --- a/paths.go +++ b/paths.go @@ -3,6 +3,7 @@ package kittycad import ( + "bytes" "encoding/json" "errors" "fmt" @@ -129,7 +130,7 @@ func (s *APICallService) GetMetrics(groupBy APICallQueryGroupBy) (*[]APICallQuer // // Parameters: // - `limit`: Maximum number of items returned by a single call -// - `pageToken`: Token returned by previous call to retreive the subsequent page +// - `pageToken`: Token returned by previous call to retrieve the subsequent page // - `sortBy` func (s *APICallService) List(limit int, pageToken string, sortBy CreatedAtSortMode) (*APICallWithPriceResultsPage, error) { // Create the url. @@ -242,16 +243,62 @@ func (s *APICallService) Get(id string) (*APICallWithPrice, error) { return &body, nil } +// GetAsyncOperation: Get an async operation. +// +// Get the status and output of an async operation. +// This endpoint requires authentication by any KittyCAD user. It returns details of the requested async operation for the user. +// If the user is not authenticated to view the specified async operation, then it is not returned. +// Only KittyCAD employees with the proper access can view async operations for other users. +// +// Parameters: +// - `id`: The ID of the async operation. +func (s *APICallService) GetAsyncOperation(id string) (*AsyncAPICallOutput, error) { + // Create the url. + path := "/async/operations/{{.id}}" + uri := resolveRelative(s.client.server, path) + // Create the request. + req, err := http.NewRequest("GET", uri, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %v", err) + } + // Add the parameters to the url. + if err := expandURL(req.URL, map[string]string{ + "id": id, + }); err != nil { + return nil, fmt.Errorf("expanding URL with parameters failed: %v", err) + } + // Send the request. + resp, err := s.client.client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %v", err) + } + defer resp.Body.Close() + // Check the response. + if err := checkResponse(resp); err != nil { + return nil, err + } + // Decode the body from the response. + if resp.Body == nil { + return nil, errors.New("request returned an empty body in the response") + } + var body AsyncAPICallOutput + if err := json.NewDecoder(resp.Body).Decode(&body); err != nil { + return nil, fmt.Errorf("error decoding response body: %v", err) + } + // Return the response. + return &body, nil +} + // CreateConversion: Convert CAD file. // // Convert a CAD file from one format to another. If the file being converted is larger than 30MB, it will be performed asynchronously. // If the conversion is performed synchronously, the contents of the converted file (`output`) will be returned as a base64 encoded string. -// If the conversion is performed asynchronously, the `id` of the conversion will be returned. You can use the `id` returned from the request to get status information about the async conversion from the `/file/conversions/{id}` endpoint. +// If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint. // // Parameters: // - `outputFormat`: The format the file should be converted to. // - `srcFormat`: The format of the file to convert. -func (s *FileService) CreateConversion(outputFormat FileConversionOutputFormat, srcFormat FileConversionSourceFormat, b io.Reader) (*FileConversionWithOutput, error) { +func (s *FileService) CreateConversion(outputFormat FileOutputFormat, srcFormat FileSourceFormat, b io.Reader) (*FileConversion, error) { // Create the url. path := "/file/conversion/{{.src_format}}/{{.output_format}}" uri := resolveRelative(s.client.server, path) @@ -281,7 +328,7 @@ func (s *FileService) CreateConversion(outputFormat FileConversionOutputFormat, if resp.Body == nil { return nil, errors.New("request returned an empty body in the response") } - var body FileConversionWithOutput + var body FileConversion if err := json.NewDecoder(resp.Body).Decode(&body); err != nil { return nil, fmt.Errorf("error decoding response body: %v", err) } @@ -289,21 +336,18 @@ func (s *FileService) CreateConversion(outputFormat FileConversionOutputFormat, return &body, nil } -// ListConversions: List file conversions. -// -// This endpoint does not return the contents of the converted file (`output`). To get the contents use the `/file/conversions/{id}` endpoint. -// This endpoint requires authentication by a KittyCAD employee. +// GetConversion: Get a file conversion. // -// To iterate over all pages, use the `ListConversionsAllPages` method, instead. +// Get the status and output of an async file conversion. +// This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user. +// If the user is not authenticated to view the specified file conversion, then it is not returned. +// Only KittyCAD employees with the proper access can view file conversions for other users. // // Parameters: -// - `limit`: Maximum number of items returned by a single call -// - `pageToken`: Token returned by previous call to retreive the subsequent page -// - `sortBy` -// - `status`: The status to filter by. -func (s *FileService) ListConversions(limit int, pageToken string, sortBy CreatedAtSortMode, status FileConversionStatus) (*FileConversionResultsPage, error) { +// - `id`: The ID of the async operation. +func (s *FileService) GetConversion(id string) (*AsyncAPICallOutput, error) { // Create the url. - path := "/file/conversions" + path := "/file/conversions/{{.id}}" uri := resolveRelative(s.client.server, path) // Create the request. req, err := http.NewRequest("GET", uri, nil) @@ -312,10 +356,7 @@ func (s *FileService) ListConversions(limit int, pageToken string, sortBy Create } // Add the parameters to the url. if err := expandURL(req.URL, map[string]string{ - "limit": strconv.Itoa(limit), - "page_token": pageToken, - "sort_by": string(sortBy), - "status": string(status), + "id": id, }); err != nil { return nil, fmt.Errorf("expanding URL with parameters failed: %v", err) } @@ -333,7 +374,7 @@ func (s *FileService) ListConversions(limit int, pageToken string, sortBy Create if resp.Body == nil { return nil, errors.New("request returned an empty body in the response") } - var body FileConversionResultsPage + var body AsyncAPICallOutput if err := json.NewDecoder(resp.Body).Decode(&body); err != nil { return nil, fmt.Errorf("error decoding response body: %v", err) } @@ -341,56 +382,114 @@ func (s *FileService) ListConversions(limit int, pageToken string, sortBy Create return &body, nil } -// ListConversionsAllPages: List file conversions. +// CreateExecution: Execute a KittyCAD program in a specific language. // -// This endpoint does not return the contents of the converted file (`output`). To get the contents use the `/file/conversions/{id}` endpoint. -// This endpoint requires authentication by a KittyCAD employee. +// Parameters: +// - `lang`: The language of the code. +// - `output`: The output file we want to get the contents for (this is relative to where in litterbox it is being run). +func (s *FileService) CreateExecution(lang CodeLanguage, output string, b io.Reader) (*CodeOutput, error) { + // Create the url. + path := "/file/execute/{{.lang}}" + uri := resolveRelative(s.client.server, path) + // Create the request. + req, err := http.NewRequest("POST", uri, b) + if err != nil { + return nil, fmt.Errorf("error creating request: %v", err) + } + // Add the parameters to the url. + if err := expandURL(req.URL, map[string]string{ + "lang": string(lang), + "output": output, + }); err != nil { + return nil, fmt.Errorf("expanding URL with parameters failed: %v", err) + } + // Send the request. + resp, err := s.client.client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %v", err) + } + defer resp.Body.Close() + // Check the response. + if err := checkResponse(resp); err != nil { + return nil, err + } + // Decode the body from the response. + if resp.Body == nil { + return nil, errors.New("request returned an empty body in the response") + } + var body CodeOutput + if err := json.NewDecoder(resp.Body).Decode(&body); err != nil { + return nil, fmt.Errorf("error decoding response body: %v", err) + } + // Return the response. + return &body, nil +} + +// CreateMass: Get CAD file mass. // -// This method is a wrapper around the `ListConversions` method. -// This method returns all the pages at once. +// Get the mass of an object in a CAD file. If the file is larger than 30MB, it will be performed asynchronously. +// If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint. // // Parameters: -// - `sortBy` -// - `status`: The status to filter by. -func (s *FileService) ListConversionsAllPages(sortBy CreatedAtSortMode, status FileConversionStatus) (*[]FileConversion, error) { - - var allPages []FileConversion - pageToken := "" - limit := 100 - for { - page, err := s.ListConversions(limit, pageToken, sortBy, status) - if err != nil { - return nil, err - } - allPages = append(allPages, page.Items...) - if page.NextPage == "" { - break - } - pageToken = page.NextPage +// - `materialDensity`: The material density. +// - `srcFormat`: The format of the file. +func (s *FileService) CreateMass(materialDensity float64, srcFormat FileSourceFormat, b io.Reader) (*FileMass, error) { + // Create the url. + path := "/file/mass" + uri := resolveRelative(s.client.server, path) + // Create the request. + req, err := http.NewRequest("POST", uri, b) + if err != nil { + return nil, fmt.Errorf("error creating request: %v", err) + } + // Add the parameters to the url. + if err := expandURL(req.URL, map[string]string{ + "material_density": fmt.Sprintf("%f", materialDensity), + "src_format": string(srcFormat), + }); err != nil { + return nil, fmt.Errorf("expanding URL with parameters failed: %v", err) + } + // Send the request. + resp, err := s.client.client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %v", err) + } + defer resp.Body.Close() + // Check the response. + if err := checkResponse(resp); err != nil { + return nil, err } + // Decode the body from the response. + if resp.Body == nil { + return nil, errors.New("request returned an empty body in the response") + } + var body FileMass + if err := json.NewDecoder(resp.Body).Decode(&body); err != nil { + return nil, fmt.Errorf("error decoding response body: %v", err) + } + // Return the response. + return &body, nil +} - return &allPages, nil -} // GetConversion: Get a file conversion. +// CreateVolume: Get CAD file volume. // -// Get the status and output of an async file conversion. -// This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user. -// If the user is not authenticated to view the specified file conversion, then it is not returned. -// Only KittyCAD employees with the proper access can view file conversions for other users. +// Get the volume of an object in a CAD file. If the file is larger than 30MB, it will be performed asynchronously. +// If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint. // // Parameters: -// - `id`: The ID of the file conversion. -func (s *FileService) GetConversion(id string) (*FileConversionWithOutput, error) { +// - `srcFormat`: The format of the file. +func (s *FileService) CreateVolume(srcFormat FileSourceFormat, b io.Reader) (*FileVolume, error) { // Create the url. - path := "/file/conversions/{{.id}}" + path := "/file/volume" uri := resolveRelative(s.client.server, path) // Create the request. - req, err := http.NewRequest("GET", uri, nil) + req, err := http.NewRequest("POST", uri, b) if err != nil { return nil, fmt.Errorf("error creating request: %v", err) } // Add the parameters to the url. if err := expandURL(req.URL, map[string]string{ - "id": id, + "src_format": string(srcFormat), }); err != nil { return nil, fmt.Errorf("expanding URL with parameters failed: %v", err) } @@ -408,7 +507,7 @@ func (s *FileService) GetConversion(id string) (*FileConversionWithOutput, error if resp.Body == nil { return nil, errors.New("request returned an empty body in the response") } - var body FileConversionWithOutput + var body FileVolume if err := json.NewDecoder(resp.Body).Decode(&body); err != nil { return nil, fmt.Errorf("error decoding response body: %v", err) } @@ -416,6 +515,35 @@ func (s *FileService) GetConversion(id string) (*FileConversionWithOutput, error return &body, nil } +// Login: This endpoint sets a session cookie for a user. +func (s *HiddenService) Login(j *LoginParams) error { + // Create the url. + path := "/login" + uri := resolveRelative(s.client.server, path) + // Encode the request body as json. + b := new(bytes.Buffer) + if err := json.NewEncoder(b).Encode(j); err != nil { + return fmt.Errorf("encoding json body request failed: %v", err) + } + // Create the request. + req, err := http.NewRequest("POST", uri, b) + if err != nil { + return fmt.Errorf("error creating request: %v", err) + } + // Send the request. + resp, err := s.client.client.Do(req) + if err != nil { + return fmt.Errorf("error sending request: %v", err) + } + defer resp.Body.Close() + // Check the response. + if err := checkResponse(resp); err != nil { + return err + } + // Return. + return nil +} + // Ping: Return pong. func (s *MetaService) Ping() (*Pong, error) { // Create the url. @@ -483,6 +611,45 @@ func (s *UserService) GetSelf() (*User, error) { return &body, nil } +// UpdateSelf: Update your user. +// +// This endpoint requires authentication by any KittyCAD user. It updates information about the authenticated user. +func (s *UserService) UpdateSelf(j *UpdateUser) (*User, error) { + // Create the url. + path := "/user" + uri := resolveRelative(s.client.server, path) + // Encode the request body as json. + b := new(bytes.Buffer) + if err := json.NewEncoder(b).Encode(j); err != nil { + return nil, fmt.Errorf("encoding json body request failed: %v", err) + } + // Create the request. + req, err := http.NewRequest("PUT", uri, b) + if err != nil { + return nil, fmt.Errorf("error creating request: %v", err) + } + // Send the request. + resp, err := s.client.client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %v", err) + } + defer resp.Body.Close() + // Check the response. + if err := checkResponse(resp); err != nil { + return nil, err + } + // Decode the body from the response. + if resp.Body == nil { + return nil, errors.New("request returned an empty body in the response") + } + var body User + if err := json.NewDecoder(resp.Body).Decode(&body); err != nil { + return nil, fmt.Errorf("error decoding response body: %v", err) + } + // Return the response. + return &body, nil +} + // UserList: List API calls for your user. // // This endpoint requires authentication by any KittyCAD user. It returns the API calls for the authenticated user. @@ -492,7 +659,7 @@ func (s *UserService) GetSelf() (*User, error) { // // Parameters: // - `limit`: Maximum number of items returned by a single call -// - `pageToken`: Token returned by previous call to retreive the subsequent page +// - `pageToken`: Token returned by previous call to retrieve the subsequent page // - `sortBy` func (s *APICallService) UserList(limit int, pageToken string, sortBy CreatedAtSortMode) (*APICallWithPriceResultsPage, error) { // Create the url. @@ -613,7 +780,7 @@ func (s *APICallService) GetForUser(id string) (*APICallWithPrice, error) { // // Parameters: // - `limit`: Maximum number of items returned by a single call -// - `pageToken`: Token returned by previous call to retreive the subsequent page +// - `pageToken`: Token returned by previous call to retrieve the subsequent page // - `sortBy` func (s *APITokenService) ListForUser(limit int, pageToken string, sortBy CreatedAtSortMode) (*APITokenResultsPage, error) { // Create the url. @@ -830,21 +997,16 @@ func (s *UserService) GetSelfExtended() (*ExtendedUser, error) { return &body, nil } -// ListConversionsForUser: List file conversions for your user. -// -// This endpoint does not return the contents of the converted file (`output`). To get the contents use the `/file/conversions/{id}` endpoint. -// This endpoint requires authentication by any KittyCAD user. It returns the API tokens for the authenticated user. -// The file conversions are returned in order of creation, with the most recently created file conversions first. +// GetConversionForUser: Get a file conversion for your user. // -// To iterate over all pages, use the `ListConversionsForUserAllPages` method, instead. +// Get the status and output of an async file conversion. If completed, the contents of the converted file (`output`) will be returned as a base64 encoded string. +// This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user. // // Parameters: -// - `limit`: Maximum number of items returned by a single call -// - `pageToken`: Token returned by previous call to retreive the subsequent page -// - `sortBy` -func (s *FileService) ListConversionsForUser(limit int, pageToken string, sortBy CreatedAtSortMode) (*FileConversionResultsPage, error) { +// - `id`: The ID of the async operation. +func (s *FileService) GetConversionForUser(id string) (*AsyncAPICallOutput, error) { // Create the url. - path := "/user/file/conversions" + path := "/user/file/conversions/{{.id}}" uri := resolveRelative(s.client.server, path) // Create the request. req, err := http.NewRequest("GET", uri, nil) @@ -853,9 +1015,7 @@ func (s *FileService) ListConversionsForUser(limit int, pageToken string, sortBy } // Add the parameters to the url. if err := expandURL(req.URL, map[string]string{ - "limit": strconv.Itoa(limit), - "page_token": pageToken, - "sort_by": string(sortBy), + "id": id, }); err != nil { return nil, fmt.Errorf("expanding URL with parameters failed: %v", err) } @@ -873,7 +1033,7 @@ func (s *FileService) ListConversionsForUser(limit int, pageToken string, sortBy if resp.Body == nil { return nil, errors.New("request returned an empty body in the response") } - var body FileConversionResultsPage + var body AsyncAPICallOutput if err := json.NewDecoder(resp.Body).Decode(&body); err != nil { return nil, fmt.Errorf("error decoding response body: %v", err) } @@ -881,56 +1041,227 @@ func (s *FileService) ListConversionsForUser(limit int, pageToken string, sortBy return &body, nil } -// ListConversionsForUserAllPages: List file conversions for your user. +// GetInformationForUser: Get payment info about your user. // -// This endpoint does not return the contents of the converted file (`output`). To get the contents use the `/file/conversions/{id}` endpoint. -// This endpoint requires authentication by any KittyCAD user. It returns the API tokens for the authenticated user. -// The file conversions are returned in order of creation, with the most recently created file conversions first. +// This includes billing address, phone, and name. +// This endpoint requires authentication by any KittyCAD user. It gets the payment information for the authenticated user. +func (s *PaymentService) GetInformationForUser() (*Customer, error) { + // Create the url. + path := "/user/payment" + uri := resolveRelative(s.client.server, path) + // Create the request. + req, err := http.NewRequest("GET", uri, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %v", err) + } + // Send the request. + resp, err := s.client.client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %v", err) + } + defer resp.Body.Close() + // Check the response. + if err := checkResponse(resp); err != nil { + return nil, err + } + // Decode the body from the response. + if resp.Body == nil { + return nil, errors.New("request returned an empty body in the response") + } + var body Customer + if err := json.NewDecoder(resp.Body).Decode(&body); err != nil { + return nil, fmt.Errorf("error decoding response body: %v", err) + } + // Return the response. + return &body, nil +} + +// CreateInformationForUser: Create payment info for your user. // -// This method is a wrapper around the `ListConversionsForUser` method. -// This method returns all the pages at once. +// This includes billing address, phone, and name. +// This endpoint requires authentication by any KittyCAD user. It creates the payment information for the authenticated user. +func (s *PaymentService) CreateInformationForUser(j *BillingInfo) (*Customer, error) { + // Create the url. + path := "/user/payment" + uri := resolveRelative(s.client.server, path) + // Encode the request body as json. + b := new(bytes.Buffer) + if err := json.NewEncoder(b).Encode(j); err != nil { + return nil, fmt.Errorf("encoding json body request failed: %v", err) + } + // Create the request. + req, err := http.NewRequest("POST", uri, b) + if err != nil { + return nil, fmt.Errorf("error creating request: %v", err) + } + // Send the request. + resp, err := s.client.client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %v", err) + } + defer resp.Body.Close() + // Check the response. + if err := checkResponse(resp); err != nil { + return nil, err + } + // Decode the body from the response. + if resp.Body == nil { + return nil, errors.New("request returned an empty body in the response") + } + var body Customer + if err := json.NewDecoder(resp.Body).Decode(&body); err != nil { + return nil, fmt.Errorf("error decoding response body: %v", err) + } + // Return the response. + return &body, nil +} + +// UpdateInformationForUser: Update payment info for your user. // -// Parameters: -// - `sortBy` -func (s *FileService) ListConversionsForUserAllPages(sortBy CreatedAtSortMode) (*[]FileConversion, error) { +// This includes billing address, phone, and name. +// This endpoint requires authentication by any KittyCAD user. It updates the payment information for the authenticated user. +func (s *PaymentService) UpdateInformationForUser(j *BillingInfo) (*Customer, error) { + // Create the url. + path := "/user/payment" + uri := resolveRelative(s.client.server, path) + // Encode the request body as json. + b := new(bytes.Buffer) + if err := json.NewEncoder(b).Encode(j); err != nil { + return nil, fmt.Errorf("encoding json body request failed: %v", err) + } + // Create the request. + req, err := http.NewRequest("PUT", uri, b) + if err != nil { + return nil, fmt.Errorf("error creating request: %v", err) + } + // Send the request. + resp, err := s.client.client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %v", err) + } + defer resp.Body.Close() + // Check the response. + if err := checkResponse(resp); err != nil { + return nil, err + } + // Decode the body from the response. + if resp.Body == nil { + return nil, errors.New("request returned an empty body in the response") + } + var body Customer + if err := json.NewDecoder(resp.Body).Decode(&body); err != nil { + return nil, fmt.Errorf("error decoding response body: %v", err) + } + // Return the response. + return &body, nil +} - var allPages []FileConversion - pageToken := "" - limit := 100 - for { - page, err := s.ListConversionsForUser(limit, pageToken, sortBy) - if err != nil { - return nil, err - } - allPages = append(allPages, page.Items...) - if page.NextPage == "" { - break - } - pageToken = page.NextPage +// DeleteInformationForUser: Delete payment info for your user. +// +// This includes billing address, phone, and name. +// This endpoint requires authentication by any KittyCAD user. It deletes the payment information for the authenticated user. +func (s *PaymentService) DeleteInformationForUser() error { + // Create the url. + path := "/user/payment" + uri := resolveRelative(s.client.server, path) + // Create the request. + req, err := http.NewRequest("DELETE", uri, nil) + if err != nil { + return fmt.Errorf("error creating request: %v", err) + } + // Send the request. + resp, err := s.client.client.Do(req) + if err != nil { + return fmt.Errorf("error sending request: %v", err) } + defer resp.Body.Close() + // Check the response. + if err := checkResponse(resp); err != nil { + return err + } + // Return. + return nil +} - return &allPages, nil -} // GetConversionForUser: Get a file conversion for your user. +// CreateIntentForUser: Create a payment intent for your user. // -// Get the status and output of an async file conversion. If completed, the contents of the converted file (`output`) will be returned as a base64 encoded string. -// This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user. +// This endpoint requires authentication by any KittyCAD user. It creates a new payment intent for the authenticated user. +func (s *PaymentService) CreateIntentForUser() (*PaymentIntent, error) { + // Create the url. + path := "/user/payment/intent" + uri := resolveRelative(s.client.server, path) + // Create the request. + req, err := http.NewRequest("POST", uri, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %v", err) + } + // Send the request. + resp, err := s.client.client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %v", err) + } + defer resp.Body.Close() + // Check the response. + if err := checkResponse(resp); err != nil { + return nil, err + } + // Decode the body from the response. + if resp.Body == nil { + return nil, errors.New("request returned an empty body in the response") + } + var body PaymentIntent + if err := json.NewDecoder(resp.Body).Decode(&body); err != nil { + return nil, fmt.Errorf("error decoding response body: %v", err) + } + // Return the response. + return &body, nil +} + +// ListInvoicesForUser: List invoices for your user. // -// Parameters: -// - `id`: The ID of the file conversion. -func (s *FileService) GetConversionForUser(id string) (*FileConversionWithOutput, error) { +// This endpoint requires authentication by any KittyCAD user. It lists invoices for the authenticated user. +func (s *PaymentService) ListInvoicesForUser() (*[]Invoice, error) { // Create the url. - path := "/user/file/conversions/{{.id}}" + path := "/user/payment/invoices" uri := resolveRelative(s.client.server, path) // Create the request. req, err := http.NewRequest("GET", uri, nil) if err != nil { return nil, fmt.Errorf("error creating request: %v", err) } - // Add the parameters to the url. - if err := expandURL(req.URL, map[string]string{ - "id": id, - }); err != nil { - return nil, fmt.Errorf("expanding URL with parameters failed: %v", err) + // Send the request. + resp, err := s.client.client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %v", err) + } + defer resp.Body.Close() + // Check the response. + if err := checkResponse(resp); err != nil { + return nil, err + } + // Decode the body from the response. + if resp.Body == nil { + return nil, errors.New("request returned an empty body in the response") + } + var body []Invoice + if err := json.NewDecoder(resp.Body).Decode(&body); err != nil { + return nil, fmt.Errorf("error decoding response body: %v", err) + } + // Return the response. + return &body, nil +} + +// ListMethodsForUser: List payment methods for your user. +// +// This endpoint requires authentication by any KittyCAD user. It lists payment methods for the authenticated user. +func (s *PaymentService) ListMethodsForUser() (*[]PaymentMethod, error) { + // Create the url. + path := "/user/payment/methods" + uri := resolveRelative(s.client.server, path) + // Create the request. + req, err := http.NewRequest("GET", uri, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %v", err) } // Send the request. resp, err := s.client.client.Do(req) @@ -946,7 +1277,7 @@ func (s *FileService) GetConversionForUser(id string) (*FileConversionWithOutput if resp.Body == nil { return nil, errors.New("request returned an empty body in the response") } - var body FileConversionWithOutput + var body []PaymentMethod if err := json.NewDecoder(resp.Body).Decode(&body); err != nil { return nil, fmt.Errorf("error decoding response body: %v", err) } @@ -954,6 +1285,41 @@ func (s *FileService) GetConversionForUser(id string) (*FileConversionWithOutput return &body, nil } +// DeleteMethodForUser: Delete a payment method for your user. +// +// This endpoint requires authentication by any KittyCAD user. It deletes the specified payment method for the authenticated user. +// +// Parameters: +// - `id`: The ID of the payment method. +func (s *PaymentService) DeleteMethodForUser(id string) error { + // Create the url. + path := "/user/payment/methods/{{.id}}" + uri := resolveRelative(s.client.server, path) + // Create the request. + req, err := http.NewRequest("DELETE", uri, nil) + if err != nil { + return fmt.Errorf("error creating request: %v", err) + } + // Add the parameters to the url. + if err := expandURL(req.URL, map[string]string{ + "id": id, + }); err != nil { + return fmt.Errorf("expanding URL with parameters failed: %v", err) + } + // Send the request. + resp, err := s.client.client.Do(req) + if err != nil { + return fmt.Errorf("error sending request: %v", err) + } + defer resp.Body.Close() + // Check the response. + if err := checkResponse(resp); err != nil { + return err + } + // Return. + return nil +} + // GetForUser: Get a session for your user. // // This endpoint requires authentication by any KittyCAD user. It returns details of the requested API token for the user. @@ -1005,7 +1371,7 @@ func (s *SessionService) GetForUser(token string) (*Session, error) { // // Parameters: // - `limit`: Maximum number of items returned by a single call -// - `pageToken`: Token returned by previous call to retreive the subsequent page +// - `pageToken`: Token returned by previous call to retrieve the subsequent page // - `sortBy` func (s *UserService) List(limit int, pageToken string, sortBy CreatedAtSortMode) (*UserResultsPage, error) { // Create the url. @@ -1081,7 +1447,7 @@ func (s *UserService) ListAllPages(sortBy CreatedAtSortMode) (*[]User, error) { // // Parameters: // - `limit`: Maximum number of items returned by a single call -// - `pageToken`: Token returned by previous call to retreive the subsequent page +// - `pageToken`: Token returned by previous call to retrieve the subsequent page // - `sortBy` func (s *UserService) ListExtended(limit int, pageToken string, sortBy CreatedAtSortMode) (*ExtendedUserResultsPage, error) { // Create the url. @@ -1251,7 +1617,7 @@ func (s *UserService) Get(id string) (*User, error) { // Parameters: // - `id`: The user ID. // - `limit`: Maximum number of items returned by a single call -// - `pageToken`: Token returned by previous call to retreive the subsequent page +// - `pageToken`: Token returned by previous call to retrieve the subsequent page // - `sortBy` func (s *APICallService) ListForUser(id string, limit int, pageToken string, sortBy CreatedAtSortMode) (*APICallWithPriceResultsPage, error) { // Create the url. diff --git a/spec.json b/spec.json index 370a345..b61033d 100644 --- a/spec.json +++ b/spec.json @@ -13,6 +13,74 @@ } }, "schemas": { + "APICallStatus": { + "description": "The status of an async API call.", + "enum": [ + "Queued", + "Uploaded", + "In Progress", + "Completed", + "Failed" + ], + "type": "string" + }, + "Address": { + "description": "An address.", + "properties": { + "city": { + "description": "The city component.", + "type": "string" + }, + "country": { + "description": "The country component.", + "type": "string" + }, + "created_at": { + "description": "The time and date the address was created.", + "format": "partial-date-time", + "type": "string" + }, + "id": { + "allOf": [ + { + "$ref": "#/components/schemas/Uuid" + } + ], + "description": "The unique identifier of the address." + }, + "state": { + "description": "The state component.", + "type": "string" + }, + "street1": { + "description": "The first street component.", + "type": "string" + }, + "street2": { + "description": "The second street component.", + "type": "string" + }, + "updated_at": { + "description": "The time and date the address was last updated.", + "format": "partial-date-time", + "type": "string" + }, + "user_id": { + "description": "The user ID that this address belongs to.", + "type": "string" + }, + "zip": { + "description": "The zip component.", + "type": "string" + } + }, + "required": [ + "created_at", + "id", + "updated_at" + ], + "type": "object" + }, "ApiCallQueryGroup": { "description": "A response for a query on the API call table that is grouped by something.", "properties": { @@ -254,20 +322,362 @@ ], "type": "object" }, + "AsyncApiCallOutput": { + "description": "The output from the async API call.", + "oneOf": [ + { + "description": "A file conversion.", + "properties": { + "completed_at": { + "description": "The time and date the file conversion was completed.", + "format": "partial-date-time", + "nullable": true, + "type": "string" + }, + "created_at": { + "description": "The time and date the file conversion was created.", + "format": "partial-date-time", + "type": "string" + }, + "id": { + "allOf": [ + { + "$ref": "#/components/schemas/Uuid" + } + ], + "description": "The unique identifier of the file conversion.\n\nThis is the same as the API call ID." + }, + "output": { + "description": "The converted file, if completed, base64 encoded. If the conversion failed, this field will show any errors.", + "type": "string" + }, + "output_format": { + "allOf": [ + { + "$ref": "#/components/schemas/FileOutputFormat" + } + ], + "description": "The output format of the file conversion." + }, + "src_format": { + "allOf": [ + { + "$ref": "#/components/schemas/FileSourceFormat" + } + ], + "description": "The source format of the file conversion." + }, + "started_at": { + "description": "The time and date the file conversion was started.", + "format": "partial-date-time", + "nullable": true, + "type": "string" + }, + "status": { + "allOf": [ + { + "$ref": "#/components/schemas/APICallStatus" + } + ], + "description": "The status of the file conversion." + }, + "type": { + "enum": [ + "FileConversion" + ], + "type": "string" + }, + "updated_at": { + "description": "The time and date the file conversion was last updated.", + "format": "partial-date-time", + "type": "string" + }, + "user_id": { + "description": "The user ID of the user who created the file conversion.", + "type": "string" + } + }, + "required": [ + "created_at", + "id", + "output_format", + "src_format", + "status", + "type", + "updated_at" + ], + "type": "object" + }, + { + "description": "A file mass.", + "properties": { + "completed_at": { + "description": "The time and date the mass was completed.", + "format": "partial-date-time", + "nullable": true, + "type": "string" + }, + "created_at": { + "description": "The time and date the mass was created.", + "format": "partial-date-time", + "type": "string" + }, + "error": { + "description": "The error the function returned, if any.", + "nullable": true, + "type": "string" + }, + "id": { + "allOf": [ + { + "$ref": "#/components/schemas/Uuid" + } + ], + "description": "The unique identifier of the mass request.\n\nThis is the same as the API call ID." + }, + "mass": { + "description": "The resulting mass.", + "format": "float", + "nullable": true, + "type": "number" + }, + "material_density": { + "default": 0, + "description": "The material density as denoted by the user.", + "format": "float", + "type": "number" + }, + "src_format": { + "allOf": [ + { + "$ref": "#/components/schemas/FileSourceFormat" + } + ], + "description": "The source format of the file." + }, + "started_at": { + "description": "The time and date the mass was started.", + "format": "partial-date-time", + "nullable": true, + "type": "string" + }, + "status": { + "allOf": [ + { + "$ref": "#/components/schemas/APICallStatus" + } + ], + "description": "The status of the mass." + }, + "type": { + "enum": [ + "FileMass" + ], + "type": "string" + }, + "updated_at": { + "description": "The time and date the mass was last updated.", + "format": "partial-date-time", + "type": "string" + }, + "user_id": { + "description": "The user ID of the user who created the mass.", + "type": "string" + } + }, + "required": [ + "created_at", + "id", + "src_format", + "status", + "type", + "updated_at" + ], + "type": "object" + }, + { + "description": "A file volume.", + "properties": { + "completed_at": { + "description": "The time and date the volume was completed.", + "format": "partial-date-time", + "nullable": true, + "type": "string" + }, + "created_at": { + "description": "The time and date the volume was created.", + "format": "partial-date-time", + "type": "string" + }, + "error": { + "description": "The error the function returned, if any.", + "nullable": true, + "type": "string" + }, + "id": { + "allOf": [ + { + "$ref": "#/components/schemas/Uuid" + } + ], + "description": "The unique identifier of the volume request.\n\nThis is the same as the API call ID." + }, + "src_format": { + "allOf": [ + { + "$ref": "#/components/schemas/FileSourceFormat" + } + ], + "description": "The source format of the file." + }, + "started_at": { + "description": "The time and date the volume was started.", + "format": "partial-date-time", + "nullable": true, + "type": "string" + }, + "status": { + "allOf": [ + { + "$ref": "#/components/schemas/APICallStatus" + } + ], + "description": "The status of the volume." + }, + "type": { + "enum": [ + "FileVolume" + ], + "type": "string" + }, + "updated_at": { + "description": "The time and date the volume was last updated.", + "format": "partial-date-time", + "type": "string" + }, + "user_id": { + "description": "The user ID of the user who created the volume.", + "type": "string" + }, + "volume": { + "description": "The resulting volume.", + "format": "float", + "nullable": true, + "type": "number" + } + }, + "required": [ + "created_at", + "id", + "src_format", + "status", + "type", + "updated_at" + ], + "type": "object" + } + ] + }, + "BillingInfo": { + "description": "The billing information for payments.", + "properties": { + "address": { + "allOf": [ + { + "$ref": "#/components/schemas/Address" + } + ], + "description": "The address of the customer.", + "nullable": true + }, + "name": { + "description": "The name of the customer.", + "type": "string" + }, + "phone": { + "description": "The phone for the customer.", + "type": "string" + } + }, + "type": "object" + }, + "CacheMetadata": { + "description": "Metadata about our cache.\n\nThis is mostly used for internal purposes and debugging.", + "properties": { + "ok": { + "description": "If the cache returned an ok response from ping.", + "type": "boolean" + } + }, + "required": [ + "ok" + ], + "type": "object" + }, + "CardDetails": { + "description": "The card details of a payment method.", + "properties": { + "brand": { + "description": "Card brand.\n\nCan be `amex`, `diners`, `discover`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.", + "type": "string" + }, + "checks": { + "allOf": [ + { + "$ref": "#/components/schemas/PaymentMethodCardChecks" + } + ], + "default": {}, + "description": "Checks on Card address and CVC if provided." + }, + "country": { + "description": "Two-letter ISO code representing the country of the card.", + "type": "string" + }, + "exp_month": { + "default": 0, + "description": "Two-digit number representing the card's expiration month.", + "format": "int64", + "type": "integer" + }, + "exp_year": { + "default": 0, + "description": "Four-digit number representing the card's expiration year.", + "format": "int64", + "type": "integer" + }, + "fingerprint": { + "description": "Uniquely identifies this particular card number.", + "type": "string" + }, + "funding": { + "description": "Card funding type.\n\nCan be `credit`, `debit`, `prepaid`, or `unknown`.", + "type": "string" + }, + "last4": { + "description": "The last four digits of the card.", + "type": "string" + } + }, + "type": "object" + }, "Cluster": { "description": "Cluster information.", "properties": { "addr": { "description": "The IP address of the cluster.", "format": "ip", + "nullable": true, "type": "string" }, "auth_timeout": { + "default": 0, "description": "The auth timeout of the cluster.", "format": "int64", "type": "integer" }, "cluster_port": { + "default": 0, "description": "The port of the cluster.", "format": "int64", "type": "integer" @@ -277,6 +687,7 @@ "type": "string" }, "tls_timeout": { + "default": 0, "description": "The TLS timeout for the cluster.", "format": "int64", "type": "integer" @@ -289,1107 +700,3052 @@ "type": "array" } }, - "required": [ - "addr" - ], "type": "object" }, - "CreatedAtSortMode": { - "description": "Supported set of sort modes for scanning by created_at only.\n\nCurrently, we only support scanning in ascending order.", + "CodeLanguage": { + "description": "The language code is written in.", "enum": [ - "created-at-ascending", - "created-at-descending" + "go", + "rust", + "python", + "node" ], "type": "string" }, - "Duration": { - "format": "int64", - "title": "int64", - "type": "integer" - }, - "EngineMetadata": { - "description": "Metadata about an engine API instance.\n\nThis is mostly used for internal purposes and debugging.", - "properties": { - "async_jobs_running": { - "description": "If any async job is currently running.", - "type": "boolean" - }, - "fs": { - "allOf": [ - { - "$ref": "#/components/schemas/FileSystemMetadata" - } - ], - "description": "Metadata about our file system." - }, - "git_hash": { - "description": "The git hash of the server.", - "type": "string" - }, - "nats": { - "allOf": [ - { - "$ref": "#/components/schemas/NatsConnection" - } - ], - "description": "Metadata about our nats.io connection." - } - }, - "required": [ - "async_jobs_running", - "fs", - "git_hash", - "nats" - ], - "type": "object" - }, - "Error": { - "description": "Error information from a response.", + "CodeOutput": { + "description": "Output of the code being executed.", "properties": { - "error_code": { + "output": { + "description": "The contents of the output file if it was passed. This is base64 encoded so we can ensure it is UTF-8 for JSON.", "type": "string" }, - "message": { + "stderr": { + "description": "The stderr of the code.", "type": "string" }, - "request_id": { + "stdout": { + "description": "The stdout of the code.", "type": "string" } }, "required": [ - "message", - "request_id" + "output", + "stderr", + "stdout" ], "type": "object" }, - "ExtendedUser": { - "description": "Extended user information.\n\nThis is mostly used for internal purposes. It returns a mapping of the user's information, including that of our third party services we use for users: MailChimp, Stripe, and Zendesk.", + "Connection": { + "description": "Metadata about a pub-sub connection.\n\nThis is mostly used for internal purposes and debugging.", "properties": { - "company": { - "description": "The user's company.", - "type": "string" + "auth_timeout": { + "default": 0, + "description": "The auth timeout of the server.", + "format": "int64", + "type": "integer" }, - "created_at": { - "description": "The date and time the user was created.", - "format": "partial-date-time", - "type": "string" + "cluster": { + "allOf": [ + { + "$ref": "#/components/schemas/Cluster" + } + ], + "default": { + "auth_timeout": 0, + "cluster_port": 0, + "tls_timeout": 0 + }, + "description": "Information about the cluster." }, - "discord": { - "description": "The user's Discord handle.", + "config_load_time": { + "description": "The time the configuration was loaded.", + "format": "date-time", "type": "string" }, - "email": { - "description": "The email address of the user.", - "type": "string" + "connections": { + "default": 0, + "description": "The number of connections to the server.", + "format": "int64", + "type": "integer" }, - "email_verified": { - "description": "The date and time the email address was verified.", - "format": "partial-date-time", - "nullable": true, - "type": "string" - }, - "first_name": { - "description": "The user's first name.", - "type": "string" + "cores": { + "default": 0, + "description": "The CPU core usage of the server.", + "format": "int64", + "type": "integer" }, - "github": { - "description": "The user's GitHub handle.", - "type": "string" + "cpu": { + "default": 0, + "description": "The CPU usage of the server.", + "format": "double", + "type": "number" }, - "id": { - "description": "The unique identifier for the user.", - "type": "string" + "gateway": { + "allOf": [ + { + "$ref": "#/components/schemas/Gateway" + } + ], + "default": { + "auth_timeout": 0, + "port": 0, + "tls_timeout": 0 + }, + "description": "Information about the gateway." }, - "image": { - "description": "The image avatar for the user. This is a URL.", + "git_commit": { + "description": "The git commit.", "type": "string" }, - "last_name": { - "description": "The user's last name.", + "go": { + "description": "The go version.", "type": "string" }, - "mailchimp_id": { - "description": "The user's MailChimp ID. This is mostly used for internal mapping.", - "nullable": true, - "type": "string" + "gomaxprocs": { + "default": 0, + "description": "`GOMAXPROCS` of the server.", + "format": "int64", + "type": "integer" }, - "name": { - "description": "The name of the user. This is auto populated at first from the authentication provider (if there was a name). It can be updated by the user by updating their `first_name` and `last_name` fields.", + "host": { + "description": "The host of the server.", + "format": "ip", "type": "string" }, - "phone": { - "description": "The user's phone number.", + "http_base_path": { + "description": "The http base path of the server.", "type": "string" }, - "stripe_id": { - "description": "The user's Stripe ID. This is mostly used for internal mapping.", - "nullable": true, + "http_host": { + "description": "The http host of the server.", "type": "string" }, - "updated_at": { - "description": "The date and time the user was last updated.", - "format": "partial-date-time", - "type": "string" + "http_port": { + "default": 0, + "description": "The http port of the server.", + "format": "int64", + "type": "integer" }, - "zendesk_id": { - "description": "The user's Zendesk ID. This is mostly used for internal mapping.", - "nullable": true, - "type": "string" - } - }, - "required": [ - "created_at", - "updated_at" - ], - "type": "object" - }, - "ExtendedUserResultsPage": { - "description": "A single page of results", - "properties": { - "items": { - "description": "list of items on this page of results", - "items": { - "$ref": "#/components/schemas/ExtendedUser" + "http_req_stats": { + "additionalProperties": { + "format": "int64", + "type": "integer" }, - "type": "array" - }, - "next_page": { - "description": "token used to fetch the next page of results (if any)", - "nullable": true, - "type": "string" - } - }, - "required": [ - "items" - ], - "type": "object" - }, - "FileConversion": { - "description": "A file conversion.\n\nFor now, in the database, we only store the file conversions if we performed it asynchronously.", - "properties": { - "completed_at": { - "description": "The time and date the file conversion was completed.", - "format": "partial-date-time", - "nullable": true, - "type": "string" + "description": "HTTP request statistics.", + "type": "object" }, - "created_at": { - "description": "The time and date the file conversion was created.", - "format": "partial-date-time", - "type": "string" + "https_port": { + "default": 0, + "description": "The https port of the server.", + "format": "int64", + "type": "integer" }, "id": { - "allOf": [ - { - "$ref": "#/components/schemas/Uuid" - } - ], - "description": "The unique identifier of the file conversion.\n\nThis is the same as the API call ID." + "description": "The ID as known by the most recently connected server.", + "format": "uint64", + "minimum": 0, + "type": "integer" + }, + "in_bytes": { + "default": 0, + "description": "The count of inbound bytes for the server.", + "format": "int64", + "type": "integer" + }, + "in_msgs": { + "default": 0, + "description": "The number of inbound messages for the server.", + "format": "int64", + "type": "integer" }, - "output_file_link": { - "description": "The link to the file conversion output in our blob storage.", + "ip": { + "description": "The client IP as known by the most recently connected server.", + "format": "ip", "type": "string" }, - "output_format": { + "jetstream": { "allOf": [ { - "$ref": "#/components/schemas/FileConversionOutputFormat" + "$ref": "#/components/schemas/Jetstream" } ], - "description": "The output format of the file conversion." - }, - "src_file_link": { - "description": "The link to the file conversion source in our blob storage.", - "type": "string" + "default": { + "config": { + "max_memory": 0, + "max_storage": 0 + }, + "meta": { + "cluster_size": 0 + }, + "stats": { + "accounts": 0, + "api": { + "errors": 0, + "inflight": 0, + "total": 0 + }, + "ha_assets": 0, + "memory": 0, + "reserved_memory": 0, + "reserved_store": 0, + "store": 0 + } + }, + "description": "Jetstream information." }, - "src_format": { + "leaf": { "allOf": [ { - "$ref": "#/components/schemas/FileConversionSourceFormat" + "$ref": "#/components/schemas/LeafNode" } ], - "description": "The source format of the file conversion." + "default": { + "auth_timeout": 0, + "port": 0, + "tls_timeout": 0 + }, + "description": "Information about leaf nodes." }, - "started_at": { - "description": "The time and date the file conversion was started.", - "format": "partial-date-time", - "nullable": true, + "leafnodes": { + "default": 0, + "description": "The number of leaf nodes for the server.", + "format": "int64", + "type": "integer" + }, + "max_connections": { + "default": 0, + "description": "The max connections of the server.", + "format": "int64", + "type": "integer" + }, + "max_control_line": { + "default": 0, + "description": "The max control line of the server.", + "format": "int64", + "type": "integer" + }, + "max_payload": { + "default": 0, + "description": "The max payload of the server.", + "format": "int64", + "type": "integer" + }, + "max_pending": { + "default": 0, + "description": "The max pending of the server.", + "format": "int64", + "type": "integer" + }, + "mem": { + "default": 0, + "description": "The memory usage of the server.", + "format": "int64", + "type": "integer" + }, + "now": { + "description": "The time now.", + "format": "date-time", "type": "string" }, - "status": { + "out_bytes": { + "default": 0, + "description": "The count of outbound bytes for the server.", + "format": "int64", + "type": "integer" + }, + "out_msgs": { + "default": 0, + "description": "The number of outbound messages for the server.", + "format": "int64", + "type": "integer" + }, + "ping_interval": { + "default": 0, + "description": "The ping interval of the server.", + "format": "int64", + "type": "integer" + }, + "ping_max": { + "default": 0, + "description": "The ping max of the server.", + "format": "int64", + "type": "integer" + }, + "port": { + "default": 0, + "description": "The port of the server.", + "format": "int64", + "type": "integer" + }, + "proto": { + "default": 0, + "description": "The protocol version.", + "format": "int64", + "type": "integer" + }, + "remotes": { + "default": 0, + "description": "The number of remotes for the server.", + "format": "int64", + "type": "integer" + }, + "routes": { + "default": 0, + "description": "The number of routes for the server.", + "format": "int64", + "type": "integer" + }, + "rtt": { "allOf": [ { - "$ref": "#/components/schemas/FileConversionStatus" + "$ref": "#/components/schemas/Duration" } ], - "description": "The status of the file conversion." + "description": "The round trip time between this client and the server." }, - "updated_at": { - "description": "The time and date the file conversion was last updated.", - "format": "partial-date-time", + "server_id": { + "description": "The server ID.", "type": "string" }, - "user_id": { - "description": "The user ID of the user who created the file conversion.", + "server_name": { + "description": "The server name.", "type": "string" }, - "worker": { - "description": "The worker node that is performing or performed the file conversion.", - "type": "string" - } - }, - "required": [ - "created_at", - "id", - "output_format", - "src_format", - "status", - "updated_at" - ], - "type": "object" - }, - "FileConversionOutputFormat": { - "description": "The valid types of output file formats.", - "enum": [ - "stl", - "obj", - "dae", - "step", - "fbx", - "fbxb" - ], - "type": "string" - }, - "FileConversionResultsPage": { - "description": "A single page of results", - "properties": { - "items": { - "description": "list of items on this page of results", - "items": { - "$ref": "#/components/schemas/FileConversion" - }, - "type": "array" + "slow_consumers": { + "default": 0, + "description": "The number of slow consumers for the server.", + "format": "int64", + "type": "integer" }, - "next_page": { - "description": "token used to fetch the next page of results (if any)", - "nullable": true, + "start": { + "description": "When the server was started.", + "format": "date-time", + "type": "string" + }, + "subscriptions": { + "default": 0, + "description": "The number of subscriptions for the server.", + "format": "int64", + "type": "integer" + }, + "system_account": { + "description": "The system account.", + "type": "string" + }, + "tls_timeout": { + "default": 0, + "description": "The TLS timeout of the server.", + "format": "int64", + "type": "integer" + }, + "total_connections": { + "default": 0, + "description": "The total number of connections to the server.", + "format": "int64", + "type": "integer" + }, + "uptime": { + "description": "The uptime of the server.", + "type": "string" + }, + "version": { + "description": "The version of the service.", "type": "string" + }, + "write_deadline": { + "default": 0, + "description": "The write deadline of the server.", + "format": "int64", + "type": "integer" } }, "required": [ - "items" + "config_load_time", + "host", + "http_req_stats", + "id", + "ip", + "now", + "rtt", + "start" ], "type": "object" }, - "FileConversionSourceFormat": { - "description": "The valid types of source file formats.", + "CreatedAtSortMode": { + "description": "Supported set of sort modes for scanning by created_at only.\n\nCurrently, we only support scanning in ascending order.", "enum": [ - "stl", - "obj", - "dae", - "step", - "fbx" + "created-at-ascending", + "created-at-descending" ], "type": "string" }, - "FileConversionStatus": { - "description": "The status of a file conversion.", + "Currency": { + "description": "Currency is the list of supported currencies.\n\nFor more details see \u003chttps://support.stripe.com/questions/which-currencies-does-stripe-support\u003e.", "enum": [ - "Queued", - "Uploaded", - "In Progress", - "Completed", - "Failed" + "aed", + "afn", + "all", + "amd", + "ang", + "aoa", + "ars", + "aud", + "awg", + "azn", + "bam", + "bbd", + "bdt", + "bgn", + "bif", + "bmd", + "bnd", + "bob", + "brl", + "bsd", + "bwp", + "bzd", + "cad", + "cdf", + "chf", + "clp", + "cny", + "cop", + "crc", + "cve", + "czk", + "djf", + "dkk", + "dop", + "dzd", + "eek", + "egp", + "etb", + "eur", + "fjd", + "fkp", + "gbp", + "gel", + "gip", + "gmd", + "gnf", + "gtq", + "gyd", + "hkd", + "hnl", + "hrk", + "htg", + "huf", + "idr", + "ils", + "inr", + "isk", + "jmd", + "jpy", + "kes", + "kgs", + "khr", + "kmf", + "krw", + "kyd", + "kzt", + "lak", + "lbp", + "lkr", + "lrd", + "lsl", + "ltl", + "lvl", + "mad", + "mdl", + "mga", + "mkd", + "mnt", + "mop", + "mro", + "mur", + "mvr", + "mwk", + "mxn", + "myr", + "mzn", + "nad", + "ngn", + "nio", + "nok", + "npr", + "nzd", + "pab", + "pen", + "pgk", + "php", + "pkr", + "pln", + "pyg", + "qar", + "ron", + "rsd", + "rub", + "rwf", + "sar", + "sbd", + "scr", + "sek", + "sgd", + "shp", + "sll", + "sos", + "srd", + "std", + "svc", + "szl", + "thb", + "tjs", + "top", + "try", + "ttd", + "twd", + "tzs", + "uah", + "ugx", + "usd", + "uyu", + "uzs", + "vef", + "vnd", + "vuv", + "wst", + "xaf", + "xcd", + "xof", + "xpf", + "yer", + "zar", + "zmw" ], "type": "string" }, - "FileConversionWithOutput": { - "description": "A file conversion as we ouput it to the user.", + "Customer": { + "description": "The resource representing a payment \"Customer\".", "properties": { - "completed_at": { - "description": "The time and date the file conversion was completed.", - "format": "partial-date-time", - "nullable": true, - "type": "string" - }, - "created_at": { - "description": "The time and date the file conversion was created.", - "format": "partial-date-time", - "type": "string" - }, - "id": { + "address": { "allOf": [ { - "$ref": "#/components/schemas/Uuid" + "$ref": "#/components/schemas/Address" } ], - "description": "The unique identifier of the file conversion.\n\nThis is the same as the API call ID." + "description": "The customer's address.", + "nullable": true }, - "output": { - "description": "The converted file, if completed, base64 encoded. If the conversion failed, this field will show any errors.", + "balance": { + "default": 0, + "description": "Current balance, if any, being stored on the customer.\n\nIf negative, the customer has credit to apply to their next invoice. If positive, the customer has an amount owed that will be added to their next invoice. The balance does not refer to any unpaid invoices; it solely takes into account amounts that have yet to be successfully applied to any invoice. This balance is only taken into account as invoices are finalized.", + "format": "int64", + "type": "integer" + }, + "created_at": { + "description": "Time at which the object was created.", + "format": "date-time", "type": "string" }, - "output_format": { + "currency": { "allOf": [ { - "$ref": "#/components/schemas/FileConversionOutputFormat" + "$ref": "#/components/schemas/Currency" } ], - "description": "The output format of the file conversion." + "description": "Three-letter ISO code for the currency the customer can be charged in for recurring billing purposes." }, - "src_format": { - "allOf": [ - { - "$ref": "#/components/schemas/FileConversionSourceFormat" - } - ], - "description": "The source format of the file conversion." + "delinquent": { + "default": false, + "description": "When the customer's latest invoice is billed by charging automatically, `delinquent` is `true` if the invoice's latest charge failed.\n\nWhen the customer's latest invoice is billed by sending an invoice, `delinquent` is `true` if the invoice isn't paid by its due date. If an invoice is marked uncollectible by dunning, `delinquent` doesn't get reset to `false`.", + "type": "boolean" }, - "started_at": { - "description": "The time and date the file conversion was started.", - "format": "partial-date-time", - "nullable": true, + "email": { + "description": "The customer's email address.", "type": "string" }, - "status": { - "allOf": [ - { - "$ref": "#/components/schemas/FileConversionStatus" - } - ], - "description": "The status of the file conversion." + "id": { + "description": "Unique identifier for the object.", + "type": "string" }, - "updated_at": { - "description": "The time and date the file conversion was last updated.", - "format": "partial-date-time", + "metadata": { + "additionalProperties": { + "type": "string" + }, + "default": {}, + "description": "Set of key-value pairs.", + "type": "object" + }, + "name": { + "description": "The customer's full name or business name.", "type": "string" }, - "user_id": { - "description": "The user ID of the user who created the file conversion.", + "phone": { + "description": "The customer's phone number.", "type": "string" } }, "required": [ "created_at", - "id", - "output_format", - "src_format", - "status", - "updated_at" + "currency" ], "type": "object" }, - "FileSystemMetadata": { - "description": "Metadata about our file system.\n\nThis is mostly used for internal purposes and debugging.", - "properties": { - "ok": { - "description": "If the file system passed a sanity check.", - "type": "boolean" - } - }, - "required": [ - "ok" - ], - "type": "object" + "Duration": { + "format": "int64", + "title": "int64", + "type": "integer" }, - "Gateway": { - "description": "Gateway information.", + "EngineMetadata": { + "description": "Metadata about an engine API instance.\n\nThis is mostly used for internal purposes and debugging.", "properties": { - "auth_timeout": { - "description": "The auth timeout of the gateway.", - "format": "int64", - "type": "integer" - }, - "host": { - "description": "The host of the gateway.", - "type": "string" - }, - "name": { - "description": "The name of the gateway.", - "type": "string" - }, - "port": { - "description": "The port of the gateway.", - "format": "int64", - "type": "integer" + "async_jobs_running": { + "description": "If any async job is currently running.", + "type": "boolean" }, - "tls_timeout": { - "description": "The TLS timeout for the gateway.", - "format": "int64", - "type": "integer" - } - }, - "type": "object" - }, - "Jetstream": { - "description": "Jetstream information.", - "properties": { - "config": { + "fs": { "allOf": [ { - "$ref": "#/components/schemas/JetstreamConfig" + "$ref": "#/components/schemas/FileSystemMetadata" } ], - "description": "The Jetstream config." + "description": "Metadata about our file system." }, - "meta": { - "allOf": [ - { - "$ref": "#/components/schemas/MetaClusterInfo" - } - ], - "description": "Meta information about the cluster." + "git_hash": { + "description": "The git hash of the server.", + "type": "string" }, - "stats": { + "pubsub": { "allOf": [ { - "$ref": "#/components/schemas/JetstreamStats" + "$ref": "#/components/schemas/Connection" } ], - "description": "Jetstream statistics." + "description": "Metadata about our pub-sub connection." } }, + "required": [ + "async_jobs_running", + "fs", + "git_hash", + "pubsub" + ], "type": "object" }, - "JetstreamApiStats": { - "description": "Jetstream API statistics.", + "Environment": { + "description": "The environment the server is running in.", + "enum": [ + "DEVELOPMENT", + "PREVIEW", + "PRODUCTION" + ], + "type": "string" + }, + "Error": { + "description": "Error information from a response.", "properties": { - "errors": { - "description": "The number of errors.", - "format": "int64", - "type": "integer" + "error_code": { + "type": "string" }, - "inflight": { - "description": "The number of inflight requests.", - "format": "int64", - "type": "integer" + "message": { + "type": "string" }, - "total": { - "description": "The number of requests.", - "format": "int64", - "type": "integer" + "request_id": { + "type": "string" } }, - "type": "object" + "required": [ + "message", + "request_id" + ], + "type": "object" }, - "JetstreamConfig": { - "description": "Jetstream configuration.", + "ExtendedUser": { + "description": "Extended user information.\n\nThis is mostly used for internal purposes. It returns a mapping of the user's information, including that of our third party services we use for users: MailChimp, Stripe, and Zendesk.", "properties": { - "domain": { - "description": "The domain.", + "company": { + "description": "The user's company.", "type": "string" }, - "max_memory": { - "description": "The max memory.", - "format": "int64", - "type": "integer" + "created_at": { + "description": "The date and time the user was created.", + "format": "partial-date-time", + "type": "string" }, - "max_storage": { - "description": "The max storage.", - "format": "int64", - "type": "integer" + "discord": { + "description": "The user's Discord handle.", + "type": "string" }, - "store_dir": { - "description": "The store directory.", + "email": { + "description": "The email address of the user.", "type": "string" - } - }, - "type": "object" - }, - "JetstreamStats": { - "description": "Jetstream statistics.", - "properties": { - "accounts": { - "description": "The number of accounts.", - "format": "int64", - "type": "integer" }, - "api": { - "allOf": [ - { - "$ref": "#/components/schemas/JetstreamApiStats" - } - ], - "description": "API stats." + "email_verified": { + "description": "The date and time the email address was verified.", + "format": "partial-date-time", + "nullable": true, + "type": "string" }, - "ha_assets": { - "description": "The number of HA assets.", - "format": "int64", - "type": "integer" + "first_name": { + "description": "The user's first name.", + "type": "string" }, - "memory": { - "description": "The memory used by the Jetstream server.", - "format": "int64", - "type": "integer" + "github": { + "description": "The user's GitHub handle.", + "type": "string" }, - "reserved_memory": { - "description": "The reserved memory for the Jetstream server.", - "format": "int64", - "type": "integer" + "id": { + "description": "The unique identifier for the user.", + "type": "string" }, - "reserved_store": { - "description": "The reserved storage for the Jetstream server.", - "format": "int64", - "type": "integer" + "image": { + "description": "The image avatar for the user. This is a URL.", + "type": "string" }, - "store": { - "description": "The storage used by the Jetstream server.", - "format": "int64", - "type": "integer" - } - }, - "type": "object" - }, - "LeafNode": { - "description": "Leaf node information.", - "properties": { - "auth_timeout": { - "description": "The auth timeout of the leaf node.", - "format": "int64", - "type": "integer" + "last_name": { + "description": "The user's last name.", + "type": "string" }, - "host": { - "description": "The host of the leaf node.", + "mailchimp_id": { + "description": "The user's MailChimp ID. This is mostly used for internal mapping.", + "nullable": true, "type": "string" }, - "port": { - "description": "The port of the leaf node.", - "format": "int64", - "type": "integer" + "name": { + "description": "The name of the user. This is auto populated at first from the authentication provider (if there was a name). It can be updated by the user by updating their `first_name` and `last_name` fields.", + "type": "string" }, - "tls_timeout": { - "description": "The TLS timeout for the leaf node.", - "format": "int64", - "type": "integer" + "phone": { + "description": "The user's phone number.", + "type": "string" + }, + "stripe_id": { + "description": "The user's Stripe ID. This is mostly used for internal mapping.", + "nullable": true, + "type": "string" + }, + "updated_at": { + "description": "The date and time the user was last updated.", + "format": "partial-date-time", + "type": "string" + }, + "zendesk_id": { + "description": "The user's Zendesk ID. This is mostly used for internal mapping.", + "nullable": true, + "type": "string" } }, + "required": [ + "created_at", + "updated_at" + ], "type": "object" }, - "MetaClusterInfo": { - "description": "Jetstream statistics.", + "ExtendedUserResultsPage": { + "description": "A single page of results", "properties": { - "cluster_size": { - "description": "The size of the cluster.", - "format": "int64", - "type": "integer" - }, - "leader": { - "description": "The leader of the cluster.", - "type": "string" + "items": { + "description": "list of items on this page of results", + "items": { + "$ref": "#/components/schemas/ExtendedUser" + }, + "type": "array" }, - "name": { - "description": "The name of the cluster.", + "next_page": { + "description": "token used to fetch the next page of results (if any)", + "nullable": true, "type": "string" } }, + "required": [ + "items" + ], "type": "object" }, - "Metadata": { - "description": "Metadata about our currently running server.\n\nThis is mostly used for internal purposes and debugging.", + "FileConversion": { + "description": "A file conversion.", "properties": { - "engine": { + "completed_at": { + "description": "The time and date the file conversion was completed.", + "format": "partial-date-time", + "nullable": true, + "type": "string" + }, + "created_at": { + "description": "The time and date the file conversion was created.", + "format": "partial-date-time", + "type": "string" + }, + "id": { "allOf": [ { - "$ref": "#/components/schemas/EngineMetadata" + "$ref": "#/components/schemas/Uuid" } ], - "description": "Metadata about our engine API connection." + "description": "The unique identifier of the file conversion.\n\nThis is the same as the API call ID." }, - "fs": { + "output": { + "description": "The converted file, if completed, base64 encoded. If the conversion failed, this field will show any errors.", + "type": "string" + }, + "output_format": { "allOf": [ { - "$ref": "#/components/schemas/FileSystemMetadata" + "$ref": "#/components/schemas/FileOutputFormat" } ], - "description": "Metadata about our file system." + "description": "The output format of the file conversion." }, - "git_hash": { - "description": "The git hash of the server.", + "src_format": { + "allOf": [ + { + "$ref": "#/components/schemas/FileSourceFormat" + } + ], + "description": "The source format of the file conversion." + }, + "started_at": { + "description": "The time and date the file conversion was started.", + "format": "partial-date-time", + "nullable": true, "type": "string" }, - "nats": { + "status": { "allOf": [ { - "$ref": "#/components/schemas/NatsConnection" + "$ref": "#/components/schemas/APICallStatus" } ], - "description": "Metadata about our nats.io connection." + "description": "The status of the file conversion." + }, + "updated_at": { + "description": "The time and date the file conversion was last updated.", + "format": "partial-date-time", + "type": "string" + }, + "user_id": { + "description": "The user ID of the user who created the file conversion.", + "type": "string" } }, "required": [ - "engine", - "fs", - "git_hash", - "nats" + "created_at", + "id", + "output_format", + "src_format", + "status", + "updated_at" ], "type": "object" }, - "Method": { - "description": "The Request Method (VERB)\n\nThis type also contains constants for a number of common HTTP methods such as GET, POST, etc.\n\nCurrently includes 8 variants representing the 8 methods defined in [RFC 7230](https://tools.ietf.org/html/rfc7231#section-4.1), plus PATCH, and an Extension variant for all extensions.", - "enum": [ - "OPTIONS", - "GET", - "POST", - "PUT", - "DELETE", - "HEAD", - "TRACE", - "CONNECT", - "PATCH", - "EXTENSION" - ], - "type": "string" - }, - "NatsConnection": { - "description": "Metadata about a nats.io connection.\n\nThis is mostly used for internal purposes and debugging.", + "FileMass": { + "description": "A file mass result.", "properties": { - "auth_timeout": { - "description": "The auth timeout of the server.", - "format": "int64", - "type": "integer" + "completed_at": { + "description": "The time and date the mass was completed.", + "format": "partial-date-time", + "nullable": true, + "type": "string" }, - "cluster": { - "allOf": [ - { - "$ref": "#/components/schemas/Cluster" - } - ], - "description": "Information about the cluster." + "created_at": { + "description": "The time and date the mass was created.", + "format": "partial-date-time", + "type": "string" }, - "config_load_time": { - "description": "The time the configuration was loaded.", - "format": "date-time", + "error": { + "description": "The error the function returned, if any.", + "nullable": true, "type": "string" }, - "connections": { - "description": "The number of connections to the server.", - "format": "int64", - "type": "integer" + "id": { + "allOf": [ + { + "$ref": "#/components/schemas/Uuid" + } + ], + "description": "The unique identifier of the mass request.\n\nThis is the same as the API call ID." }, - "cores": { - "description": "The CPU core usage of the server.", - "format": "int64", - "type": "integer" + "mass": { + "description": "The resulting mass.", + "format": "float", + "nullable": true, + "type": "number" }, - "cpu": { - "description": "The CPU usage of the server.", - "format": "int64", - "type": "integer" + "material_density": { + "default": 0, + "description": "The material density as denoted by the user.", + "format": "float", + "type": "number" }, - "gateway": { + "src_format": { "allOf": [ { - "$ref": "#/components/schemas/Gateway" + "$ref": "#/components/schemas/FileSourceFormat" } ], - "description": "Information about the gateway." - }, - "git_commit": { - "description": "The git commit.", - "type": "string" + "description": "The source format of the file." }, - "go": { - "description": "The go version.", + "started_at": { + "description": "The time and date the mass was started.", + "format": "partial-date-time", + "nullable": true, "type": "string" }, - "gomaxprocs": { - "description": "`GOMAXPROCS` of the server.", - "format": "int64", - "type": "integer" + "status": { + "allOf": [ + { + "$ref": "#/components/schemas/APICallStatus" + } + ], + "description": "The status of the mass." }, - "host": { - "description": "The host of the server.", - "format": "ip", + "updated_at": { + "description": "The time and date the mass was last updated.", + "format": "partial-date-time", "type": "string" }, - "http_base_path": { - "description": "The http base path of the server.", + "user_id": { + "description": "The user ID of the user who created the mass.", "type": "string" - }, - "http_host": { - "description": "The http host of the server.", + } + }, + "required": [ + "created_at", + "id", + "src_format", + "status", + "updated_at" + ], + "type": "object" + }, + "FileOutputFormat": { + "description": "The valid types of output file formats.", + "enum": [ + "stl", + "obj", + "dae", + "step", + "fbx", + "fbxb" + ], + "type": "string" + }, + "FileSourceFormat": { + "description": "The valid types of source file formats.", + "enum": [ + "stl", + "obj", + "dae", + "step", + "fbx" + ], + "type": "string" + }, + "FileSystemMetadata": { + "description": "Metadata about our file system.\n\nThis is mostly used for internal purposes and debugging.", + "properties": { + "ok": { + "description": "If the file system passed a sanity check.", + "type": "boolean" + } + }, + "required": [ + "ok" + ], + "type": "object" + }, + "FileVolume": { + "description": "A file volume result.", + "properties": { + "completed_at": { + "description": "The time and date the volume was completed.", + "format": "partial-date-time", + "nullable": true, "type": "string" }, - "http_port": { - "description": "The http port of the server.", - "format": "int64", - "type": "integer" - }, - "http_req_stats": { - "additionalProperties": { - "format": "int64", - "type": "integer" - }, - "description": "HTTP request statistics.", - "type": "object" - }, - "https_port": { - "description": "The https port of the server.", - "format": "int64", - "type": "integer" - }, - "id": { - "description": "The ID as known by the most recently connected server.", - "format": "uint64", - "minimum": 0, - "type": "integer" - }, - "in_bytes": { - "description": "The count of inbound bytes for the server.", - "format": "int64", - "type": "integer" - }, - "in_msgs": { - "description": "The number of inbound messages for the server.", - "format": "int64", - "type": "integer" + "created_at": { + "description": "The time and date the volume was created.", + "format": "partial-date-time", + "type": "string" }, - "ip": { - "description": "The client IP as known by the most recently connected server.", - "format": "ip", + "error": { + "description": "The error the function returned, if any.", + "nullable": true, "type": "string" }, - "jetstream": { + "id": { "allOf": [ { - "$ref": "#/components/schemas/Jetstream" + "$ref": "#/components/schemas/Uuid" } ], - "description": "Jetstream information." + "description": "The unique identifier of the volume request.\n\nThis is the same as the API call ID." }, - "leaf": { + "src_format": { "allOf": [ { - "$ref": "#/components/schemas/LeafNode" + "$ref": "#/components/schemas/FileSourceFormat" } ], - "description": "Information about leaf nodes." + "description": "The source format of the file." }, - "leafnodes": { - "description": "The number of leaf nodes for the server.", - "format": "int64", - "type": "integer" + "started_at": { + "description": "The time and date the volume was started.", + "format": "partial-date-time", + "nullable": true, + "type": "string" }, - "max_connections": { - "description": "The max connections of the server.", - "format": "int64", - "type": "integer" + "status": { + "allOf": [ + { + "$ref": "#/components/schemas/APICallStatus" + } + ], + "description": "The status of the volume." }, - "max_control_line": { - "description": "The max control line of the server.", - "format": "int64", - "type": "integer" + "updated_at": { + "description": "The time and date the volume was last updated.", + "format": "partial-date-time", + "type": "string" }, - "max_payload": { - "description": "The max payload of the server.", - "format": "int64", - "type": "integer" + "user_id": { + "description": "The user ID of the user who created the volume.", + "type": "string" }, - "max_pending": { - "description": "The max pending of the server.", + "volume": { + "description": "The resulting volume.", + "format": "float", + "nullable": true, + "type": "number" + } + }, + "required": [ + "created_at", + "id", + "src_format", + "status", + "updated_at" + ], + "type": "object" + }, + "Gateway": { + "description": "Gateway information.", + "properties": { + "auth_timeout": { + "default": 0, + "description": "The auth timeout of the gateway.", "format": "int64", "type": "integer" }, - "mem": { - "description": "The memory usage of the server.", - "format": "int64", - "type": "integer" + "host": { + "description": "The host of the gateway.", + "type": "string" }, - "now": { - "description": "The time now.", - "format": "date-time", + "name": { + "description": "The name of the gateway.", "type": "string" }, - "out_bytes": { - "description": "The count of outbound bytes for the server.", + "port": { + "default": 0, + "description": "The port of the gateway.", "format": "int64", "type": "integer" }, - "out_msgs": { - "description": "The number of outbound messages for the server.", + "tls_timeout": { + "default": 0, + "description": "The TLS timeout for the gateway.", "format": "int64", "type": "integer" - }, - "ping_interval": { - "description": "The ping interval of the server.", + } + }, + "type": "object" + }, + "Invoice": { + "description": "An invoice.", + "properties": { + "amount_due": { + "default": 0, + "description": "Final amount due at this time for this invoice.\n\nIf the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the `amount_due` may be 0. If there is a positive `starting_balance` for the invoice (the customer owes money), the `amount_due` will also take that into account. The charge that gets generated for the invoice will be for the amount specified in `amount_due`.", "format": "int64", "type": "integer" }, - "ping_max": { - "description": "The ping max of the server.", + "amount_paid": { + "default": 0, + "description": "The amount, in %s, that was paid.", "format": "int64", "type": "integer" }, - "port": { - "description": "The port of the server.", + "amount_remaining": { + "default": 0, + "description": "The amount remaining, in %s, that is due.", "format": "int64", "type": "integer" }, - "proto": { - "description": "The protocol version.", - "format": "int64", + "attempt_count": { + "default": 0, + "description": "Number of payment attempts made for this invoice, from the perspective of the payment retry schedule.\n\nAny payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule.", + "format": "uint64", + "minimum": 0, "type": "integer" }, - "remotes": { - "description": "The number of remotes for the server.", - "format": "int64", - "type": "integer" + "attempted": { + "default": false, + "description": "Whether an attempt has been made to pay the invoice.\n\nAn invoice is not attempted until 1 hour after the `invoice.created` webhook, for example, so you might not want to display that invoice as unpaid to your users.", + "type": "boolean" }, - "routes": { - "description": "The number of routes for the server.", - "format": "int64", - "type": "integer" + "created_at": { + "description": "Time at which the object was created.", + "format": "date-time", + "type": "string" }, - "rtt": { + "currency": { "allOf": [ { - "$ref": "#/components/schemas/Duration" + "$ref": "#/components/schemas/Currency" } ], - "description": "The round trip time between this client and the server." + "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase." }, - "server_id": { - "description": "The server ID.", + "description": { + "description": "Description of the invoice.", "type": "string" }, - "server_name": { - "description": "The server name.", + "id": { + "description": "Unique identifier for the object.", "type": "string" }, - "slow_consumers": { - "description": "The number of slow consumers for the server.", - "format": "int64", - "type": "integer" + "invoice_pdf": { + "description": "The link to download the PDF for the invoice.", + "type": "string" }, - "start": { - "description": "When the server was started.", - "format": "date-time", + "invoice_url": { + "description": "The URL for the hosted invoice page, which allows customers to view and pay an invoice.", "type": "string" }, - "subscriptions": { - "description": "The number of subscriptions for the server.", - "format": "int64", - "type": "integer" + "lines": { + "description": "The individual line items that make up the invoice.\n\n`lines` is sorted as follows: invoice items in reverse chronological order, followed by the subscription, if any.", + "items": { + "$ref": "#/components/schemas/InvoiceLineItem" + }, + "type": "array" }, - "system_account": { - "description": "The system account.", + "metadata": { + "additionalProperties": { + "type": "string" + }, + "default": {}, + "description": "Set of key-value pairs.", + "type": "object" + }, + "number": { + "description": "A unique, identifying string that appears on emails sent to the customer for this invoice.", "type": "string" }, - "tls_timeout": { - "description": "The TLS timeout of the server.", + "paid": { + "default": false, + "description": "Whether payment was successfully collected for this invoice.\n\nAn invoice can be paid (most commonly) with a charge or with credit from the customer's account balance.", + "type": "boolean" + }, + "receipt_number": { + "description": "This is the transaction number that appears on email receipts sent for this invoice.", + "type": "string" + }, + "statement_descriptor": { + "description": "Extra information about an invoice for the customer's credit card statement.", + "type": "string" + }, + "status": { + "allOf": [ + { + "$ref": "#/components/schemas/InvoiceStatus" + } + ], + "description": "The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`.\n\n[Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview).", + "nullable": true + }, + "subtotal": { + "default": 0, + "description": "Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or tax is applied.\n\nItem discounts are already incorporated.", "format": "int64", "type": "integer" }, - "total_connections": { - "description": "The total number of connections to the server.", + "tax": { + "default": 0, + "description": "The amount of tax on this invoice.\n\nThis is the sum of all the tax amounts on this invoice.", "format": "int64", "type": "integer" }, - "uptime": { - "description": "The uptime of the server.", - "type": "string" - }, - "version": { - "description": "The version of the service.", - "type": "string" - }, - "write_deadline": { - "description": "The write deadline of the server.", + "total": { + "default": 0, + "description": "Total after discounts and taxes.", "format": "int64", "type": "integer" } }, "required": [ - "cluster", - "config_load_time", - "host", - "http_req_stats", - "id", - "ip", - "now", - "rtt", - "start" + "created_at", + "currency" ], "type": "object" }, - "Pong": { - "description": "The response from the `/ping` endpoint.", + "InvoiceLineItem": { + "description": "An invoice line item.", "properties": { - "message": { - "description": "The pong response.", + "amount": { + "default": 0, + "description": "The amount, in %s.", + "format": "int64", + "type": "integer" + }, + "currency": { + "allOf": [ + { + "$ref": "#/components/schemas/Currency" + } + ], + "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase." + }, + "description": { + "description": "The description.", + "type": "string" + }, + "id": { + "description": "Unique identifier for the object.", + "type": "string" + }, + "invoice_item": { + "description": "The ID of the invoice item associated with this line item if any.", "type": "string" + }, + "metadata": { + "additionalProperties": { + "type": "string" + }, + "default": {}, + "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.\n\nSet of key-value pairs.", + "type": "object" } }, "required": [ - "message" + "currency" ], "type": "object" }, - "Session": { - "description": "An authentication session.\n\nFor our UIs, these are automatically created by Next.js.", + "InvoiceStatus": { + "description": "An enum representing the possible values of an `Invoice`'s `status` field.", + "enum": [ + "deleted", + "draft", + "open", + "paid", + "uncollectible", + "void" + ], + "type": "string" + }, + "Jetstream": { + "description": "Jetstream information.", "properties": { - "created_at": { - "description": "The date and time the session was created.", - "format": "partial-date-time", - "type": "string" - }, - "expires": { - "description": "The date and time the session expires.", - "format": "partial-date-time", - "type": "string" + "config": { + "allOf": [ + { + "$ref": "#/components/schemas/JetstreamConfig" + } + ], + "default": { + "max_memory": 0, + "max_storage": 0 + }, + "description": "The Jetstream config." }, - "id": { - "description": "The unique identifier for the session.", - "type": "string" + "meta": { + "allOf": [ + { + "$ref": "#/components/schemas/MetaClusterInfo" + } + ], + "default": { + "cluster_size": 0 + }, + "description": "Meta information about the cluster." }, - "session_token": { + "stats": { "allOf": [ { - "$ref": "#/components/schemas/Uuid" + "$ref": "#/components/schemas/JetstreamStats" } ], - "description": "The session token." + "default": { + "accounts": 0, + "api": { + "errors": 0, + "inflight": 0, + "total": 0 + }, + "ha_assets": 0, + "memory": 0, + "reserved_memory": 0, + "reserved_store": 0, + "store": 0 + }, + "description": "Jetstream statistics." + } + }, + "type": "object" + }, + "JetstreamApiStats": { + "description": "Jetstream API statistics.", + "properties": { + "errors": { + "default": 0, + "description": "The number of errors.", + "format": "int64", + "type": "integer" }, - "updated_at": { - "description": "The date and time the session was last updated.", - "format": "partial-date-time", - "type": "string" + "inflight": { + "default": 0, + "description": "The number of inflight requests.", + "format": "int64", + "type": "integer" }, - "user_id": { - "description": "The user ID of the user that the session belongs to.", - "type": "string" + "total": { + "default": 0, + "description": "The number of requests.", + "format": "int64", + "type": "integer" } }, - "required": [ - "created_at", - "expires", - "session_token", - "updated_at" - ], "type": "object" }, - "StatusCode": { - "format": "int32", - "title": "int32", - "type": "integer" - }, - "User": { - "description": "A user.", + "JetstreamConfig": { + "description": "Jetstream configuration.", "properties": { - "company": { - "description": "The user's company.", + "domain": { + "description": "The domain.", "type": "string" }, - "created_at": { - "description": "The date and time the user was created.", - "format": "partial-date-time", - "type": "string" + "max_memory": { + "default": 0, + "description": "The max memory.", + "format": "int64", + "type": "integer" }, - "discord": { - "description": "The user's Discord handle.", - "type": "string" + "max_storage": { + "default": 0, + "description": "The max storage.", + "format": "int64", + "type": "integer" }, - "email": { - "description": "The email address of the user.", + "store_dir": { + "description": "The store directory.", "type": "string" + } + }, + "type": "object" + }, + "JetstreamStats": { + "description": "Jetstream statistics.", + "properties": { + "accounts": { + "default": 0, + "description": "The number of accounts.", + "format": "int64", + "type": "integer" }, - "email_verified": { - "description": "The date and time the email address was verified.", - "format": "partial-date-time", - "nullable": true, - "type": "string" + "api": { + "allOf": [ + { + "$ref": "#/components/schemas/JetstreamApiStats" + } + ], + "default": { + "errors": 0, + "inflight": 0, + "total": 0 + }, + "description": "API stats." }, - "first_name": { - "description": "The user's first name.", - "type": "string" + "ha_assets": { + "default": 0, + "description": "The number of HA assets.", + "format": "int64", + "type": "integer" }, - "github": { - "description": "The user's GitHub handle.", - "type": "string" + "memory": { + "default": 0, + "description": "The memory used by the Jetstream server.", + "format": "int64", + "type": "integer" }, - "id": { - "description": "The unique identifier for the user.", - "type": "string" + "reserved_memory": { + "default": 0, + "description": "The reserved memory for the Jetstream server.", + "format": "int64", + "type": "integer" }, - "image": { - "description": "The image avatar for the user. This is a URL.", - "type": "string" + "reserved_store": { + "default": 0, + "description": "The reserved storage for the Jetstream server.", + "format": "int64", + "type": "integer" }, - "last_name": { - "description": "The user's last name.", + "store": { + "default": 0, + "description": "The storage used by the Jetstream server.", + "format": "int64", + "type": "integer" + } + }, + "type": "object" + }, + "LeafNode": { + "description": "Leaf node information.", + "properties": { + "auth_timeout": { + "default": 0, + "description": "The auth timeout of the leaf node.", + "format": "int64", + "type": "integer" + }, + "host": { + "description": "The host of the leaf node.", + "type": "string" + }, + "port": { + "default": 0, + "description": "The port of the leaf node.", + "format": "int64", + "type": "integer" + }, + "tls_timeout": { + "default": 0, + "description": "The TLS timeout for the leaf node.", + "format": "int64", + "type": "integer" + } + }, + "type": "object" + }, + "LoginParams": { + "description": "The parameters passed to login.", + "properties": { + "session": { + "description": "The session token we should set as a cookie.", + "type": "string" + } + }, + "required": [ + "session" + ], + "type": "object" + }, + "MetaClusterInfo": { + "description": "Jetstream statistics.", + "properties": { + "cluster_size": { + "default": 0, + "description": "The size of the cluster.", + "format": "int64", + "type": "integer" + }, + "leader": { + "description": "The leader of the cluster.", "type": "string" }, "name": { - "description": "The name of the user. This is auto populated at first from the authentication provider (if there was a name). It can be updated by the user by updating their `first_name` and `last_name` fields.", + "description": "The name of the cluster.", + "type": "string" + } + }, + "type": "object" + }, + "Metadata": { + "description": "Metadata about our currently running server.\n\nThis is mostly used for internal purposes and debugging.", + "properties": { + "cache": { + "allOf": [ + { + "$ref": "#/components/schemas/CacheMetadata" + } + ], + "description": "Metadata about our cache." + }, + "engine": { + "allOf": [ + { + "$ref": "#/components/schemas/EngineMetadata" + } + ], + "description": "Metadata about our engine API connection." + }, + "environment": { + "allOf": [ + { + "$ref": "#/components/schemas/Environment" + } + ], + "description": "The environment we are running in." + }, + "fs": { + "allOf": [ + { + "$ref": "#/components/schemas/FileSystemMetadata" + } + ], + "description": "Metadata about our file system." + }, + "git_hash": { + "description": "The git hash of the server.", "type": "string" }, - "phone": { - "description": "The user's phone number.", + "pubsub": { + "allOf": [ + { + "$ref": "#/components/schemas/Connection" + } + ], + "description": "Metadata about our pub-sub connection." + } + }, + "required": [ + "cache", + "engine", + "environment", + "fs", + "git_hash", + "pubsub" + ], + "type": "object" + }, + "Method": { + "description": "The Request Method (VERB)\n\nThis type also contains constants for a number of common HTTP methods such as GET, POST, etc.\n\nCurrently includes 8 variants representing the 8 methods defined in [RFC 7230](https://tools.ietf.org/html/rfc7231#section-4.1), plus PATCH, and an Extension variant for all extensions.", + "enum": [ + "OPTIONS", + "GET", + "POST", + "PUT", + "DELETE", + "HEAD", + "TRACE", + "CONNECT", + "PATCH", + "EXTENSION" + ], + "type": "string" + }, + "PaymentIntent": { + "description": "A payment intent response.", + "properties": { + "client_secret": { + "description": "The client secret is used for client-side retrieval using a publishable key. The client secret can be used to complete payment setup from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.", + "type": "string" + } + }, + "required": [ + "client_secret" + ], + "type": "object" + }, + "PaymentMethod": { + "description": "A payment method.", + "properties": { + "billing_info": { + "allOf": [ + { + "$ref": "#/components/schemas/BillingInfo" + } + ], + "description": "The billing info for the payment method." + }, + "card": { + "allOf": [ + { + "$ref": "#/components/schemas/CardDetails" + } + ], + "description": "The card, if it is one. For our purposes, this is the only type of payment method that we support.", + "nullable": true + }, + "created_at": { + "description": "Time at which the object was created.", + "format": "date-time", + "type": "string" + }, + "id": { + "description": "Unique identifier for the object.", + "type": "string" + }, + "metadata": { + "additionalProperties": { + "type": "string" + }, + "default": {}, + "description": "Set of key-value pairs.", + "type": "object" + }, + "type": { + "allOf": [ + { + "$ref": "#/components/schemas/PaymentMethodType" + } + ], + "description": "The type of payment method." + } + }, + "required": [ + "billing_info", + "created_at", + "type" + ], + "type": "object" + }, + "PaymentMethodCardChecks": { + "description": "Card checks.", + "properties": { + "address_line1_check": { + "description": "If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.", + "type": "string" + }, + "address_postal_code_check": { + "description": "If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.", + "type": "string" + }, + "cvc_check": { + "description": "If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.", + "type": "string" + } + }, + "type": "object" + }, + "PaymentMethodType": { + "description": "An enum representing the possible values of an `PaymentMethod`'s `type` field.", + "enum": [ + "card" + ], + "type": "string" + }, + "Pong": { + "description": "The response from the `/ping` endpoint.", + "properties": { + "message": { + "description": "The pong response.", + "type": "string" + } + }, + "required": [ + "message" + ], + "type": "object" + }, + "Session": { + "description": "An authentication session.\n\nFor our UIs, these are automatically created by Next.js.", + "properties": { + "created_at": { + "description": "The date and time the session was created.", + "format": "partial-date-time", + "type": "string" + }, + "expires": { + "description": "The date and time the session expires.", + "format": "partial-date-time", + "type": "string" + }, + "id": { + "description": "The unique identifier for the session.", "type": "string" }, + "session_token": { + "allOf": [ + { + "$ref": "#/components/schemas/Uuid" + } + ], + "description": "The session token." + }, "updated_at": { - "description": "The date and time the user was last updated.", + "description": "The date and time the session was last updated.", "format": "partial-date-time", "type": "string" + }, + "user_id": { + "description": "The user ID of the user that the session belongs to.", + "type": "string" } }, "required": [ "created_at", + "expires", + "session_token", "updated_at" ], - "type": "object" + "type": "object" + }, + "StatusCode": { + "format": "int32", + "title": "int32", + "type": "integer" + }, + "UpdateUser": { + "description": "The user-modifiable parts of a User.", + "properties": { + "company": { + "description": "The user's company.", + "type": "string" + }, + "discord": { + "description": "The user's Discord handle.", + "type": "string" + }, + "first_name": { + "description": "The user's first name.", + "type": "string" + }, + "github": { + "description": "The user's GitHub handle.", + "type": "string" + }, + "last_name": { + "description": "The user's last name.", + "type": "string" + }, + "phone": { + "description": "The user's phone number.", + "type": "string" + } + }, + "type": "object" + }, + "User": { + "description": "A user.", + "properties": { + "company": { + "description": "The user's company.", + "type": "string" + }, + "created_at": { + "description": "The date and time the user was created.", + "format": "partial-date-time", + "type": "string" + }, + "discord": { + "description": "The user's Discord handle.", + "type": "string" + }, + "email": { + "description": "The email address of the user.", + "type": "string" + }, + "email_verified": { + "description": "The date and time the email address was verified.", + "format": "partial-date-time", + "nullable": true, + "type": "string" + }, + "first_name": { + "description": "The user's first name.", + "type": "string" + }, + "github": { + "description": "The user's GitHub handle.", + "type": "string" + }, + "id": { + "description": "The unique identifier for the user.", + "type": "string" + }, + "image": { + "description": "The image avatar for the user. This is a URL.", + "type": "string" + }, + "last_name": { + "description": "The user's last name.", + "type": "string" + }, + "name": { + "description": "The name of the user. This is auto populated at first from the authentication provider (if there was a name). It can be updated by the user by updating their `first_name` and `last_name` fields.", + "type": "string" + }, + "phone": { + "description": "The user's phone number.", + "type": "string" + }, + "updated_at": { + "description": "The date and time the user was last updated.", + "format": "partial-date-time", + "type": "string" + } + }, + "required": [ + "created_at", + "updated_at" + ], + "type": "object" + }, + "UserResultsPage": { + "description": "A single page of results", + "properties": { + "items": { + "description": "list of items on this page of results", + "items": { + "$ref": "#/components/schemas/User" + }, + "type": "array" + }, + "next_page": { + "description": "token used to fetch the next page of results (if any)", + "nullable": true, + "type": "string" + } + }, + "required": [ + "items" + ], + "type": "object" + }, + "Uuid": { + "description": "A uuid.\n\nA Version 4 UUID is a universally unique identifier that is generated using random numbers.", + "format": "uuid", + "type": "string" + } + } + }, + "info": { + "contact": { + "email": "api@kittycad.io", + "url": "https://kittycad.io" + }, + "description": "API server for KittyCAD", + "title": "KittyCAD API", + "version": "0.1.0", + "x-go": { + "client": "// Create a client with your token.\nclient, err := kittycad.NewClient(\"$TOKEN\", \"your apps user agent\")\nif err != nil {\n panic(err)\n}\n\n// - OR -\n\n// Create a new client with your token parsed from the environment\n// variable: KITTYCAD_API_TOKEN.\nclient, err := kittycad.NewClientFromEnv(\"your apps user agent\")\nif err != nil {\n panic(err)\n}", + "install": "go get github.com/kittycad/kittycad.go" + } + }, + "openapi": "3.0.3", + "paths": { + "/": { + "get": { + "operationId": "get_schema", + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + }, + "summary": "Get OpenAPI schema.", + "tags": [ + "meta" + ], + "x-go": { + "example": "// GetSchema: Get OpenAPI schema.\nresponseGetSchema, err := client.Meta.GetSchema()", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#MetaService.GetSchema" + } + } + }, + "/_meta/info": { + "get": { + "description": "This includes information on any of our other distributed systems it is connected to.\nYou must be a KittyCAD employee to perform this request.", + "operationId": "get_metadata", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Metadata" + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + }, + "summary": "Get the metadata about our currently running server.", + "tags": [ + "meta" + ], + "x-go": { + "example": "// Getdata: Get the metadata about our currently running server.\n//\n// This includes information on any of our other distributed systems it is connected to.\n// You must be a KittyCAD employee to perform this request.\nmetadata, err := client.Meta.Getdata()", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#MetaService.Getdata" + } + } + }, + "/api-call-metrics": { + "get": { + "description": "This endpoint requires authentication by a KittyCAD employee. The API calls are grouped by the parameter passed.", + "operationId": "get_api_call_metrics", + "parameters": [ + { + "description": "What field to group the metrics by.", + "in": "query", + "name": "group_by", + "required": true, + "schema": { + "$ref": "#/components/schemas/ApiCallQueryGroupBy" + }, + "style": "form" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/ApiCallQueryGroup" + }, + "title": "Array_of_ApiCallQueryGroup", + "type": "array" + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + }, + "summary": "Get API call metrics.", + "tags": [ + "api-calls" + ], + "x-go": { + "example": "// GetMetrics: Get API call metrics.\n//\n// This endpoint requires authentication by a KittyCAD employee. The API calls are grouped by the parameter passed.\n//\n// Parameters:\n//\t- `groupBy`: What field to group the metrics by.\nAPICallQueryGroup, err := client.APICall.GetMetrics(groupBy)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APICallService.GetMetrics" + } + } + }, + "/api-calls": { + "get": { + "description": "This endpoint requires authentication by a KittyCAD employee. The API calls are returned in order of creation, with the most recently created API calls first.", + "operationId": "list_api_calls", + "parameters": [ + { + "description": "Maximum number of items returned by a single call", + "in": "query", + "name": "limit", + "schema": { + "format": "uint32", + "minimum": 1, + "nullable": true, + "type": "integer" + }, + "style": "form" + }, + { + "description": "Token returned by previous call to retrieve the subsequent page", + "in": "query", + "name": "page_token", + "schema": { + "nullable": true, + "type": "string" + }, + "style": "form" + }, + { + "in": "query", + "name": "sort_by", + "schema": { + "$ref": "#/components/schemas/CreatedAtSortMode" + }, + "style": "form" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiCallWithPriceResultsPage" + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + }, + "summary": "List API calls.", + "tags": [ + "api-calls" + ], + "x-dropshot-pagination": true, + "x-go": { + "example": "// List: List API calls.\n//\n// This endpoint requires authentication by a KittyCAD employee. The API calls are returned in order of creation, with the most recently created API calls first.\n//\n// To iterate over all pages, use the `ListAllPages` method, instead.\n//\n// Parameters:\n//\t- `limit`: Maximum number of items returned by a single call\n//\t- `pageToken`: Token returned by previous call to retrieve the subsequent page\n//\t- `sortBy`\naPICallWithPriceResultsPage, err := client.APICall.List(limit, pageToken, sortBy)\n\n// - OR -\n\n// ListAllPages: List API calls.\n//\n// This endpoint requires authentication by a KittyCAD employee. The API calls are returned in order of creation, with the most recently created API calls first.\n//\n// This method is a wrapper around the `List` method.\n// This method returns all the pages at once.\n//\n// Parameters:\n//\t- `sortBy`\nAPICallWithPrice, err := client.APICall.ListAllPages(sortBy)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APICallService.List" + } + } + }, + "/api-calls/{id}": { + "get": { + "description": "This endpoint requires authentication by any KittyCAD user. It returns details of the requested API call for the user.\nIf the user is not authenticated to view the specified API call, then it is not returned.\nOnly KittyCAD employees can view API calls for other users.", + "operationId": "get_api_call", + "parameters": [ + { + "description": "The ID of the API call.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiCallWithPrice" + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + }, + "summary": "Get details of an API call.", + "tags": [ + "api-calls" + ], + "x-go": { + "example": "// Get: Get details of an API call.\n//\n// This endpoint requires authentication by any KittyCAD user. It returns details of the requested API call for the user.\n// If the user is not authenticated to view the specified API call, then it is not returned.\n// Only KittyCAD employees can view API calls for other users.\n//\n// Parameters:\n//\t- `id`: The ID of the API call.\naPICallWithPrice, err := client.APICall.Get(id)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APICallService.Get" + } + } + }, + "/async/operations/{id}": { + "get": { + "description": "Get the status and output of an async operation.\nThis endpoint requires authentication by any KittyCAD user. It returns details of the requested async operation for the user.\nIf the user is not authenticated to view the specified async operation, then it is not returned.\nOnly KittyCAD employees with the proper access can view async operations for other users.", + "operationId": "get_async_operation", + "parameters": [ + { + "description": "The ID of the async operation.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AsyncApiCallOutput" + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + }, + "summary": "Get an async operation.", + "tags": [ + "api-calls" + ], + "x-go": { + "example": "// GetAsyncOperation: Get an async operation.\n//\n// Get the status and output of an async operation.\n// This endpoint requires authentication by any KittyCAD user. It returns details of the requested async operation for the user.\n// If the user is not authenticated to view the specified async operation, then it is not returned.\n// Only KittyCAD employees with the proper access can view async operations for other users.\n//\n// Parameters:\n//\t- `id`: The ID of the async operation.\nasyncAPICallOutput, err := client.APICall.GetAsyncOperation(id)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APICallService.GetAsyncOperation" + } + } + }, + "/file/conversion/{src_format}/{output_format}": { + "post": { + "description": "Convert a CAD file from one format to another. If the file being converted is larger than 30MB, it will be performed asynchronously.\nIf the conversion is performed synchronously, the contents of the converted file (`output`) will be returned as a base64 encoded string.\nIf the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.", + "operationId": "create_file_conversion", + "parameters": [ + { + "description": "The format the file should be converted to.", + "in": "path", + "name": "output_format", + "required": true, + "schema": { + "$ref": "#/components/schemas/FileOutputFormat" + }, + "style": "simple" + }, + { + "description": "The format of the file to convert.", + "in": "path", + "name": "src_format", + "required": true, + "schema": { + "$ref": "#/components/schemas/FileSourceFormat" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/octet-stream": { + "schema": { + "format": "binary", + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FileConversion" + } + } + }, + "description": "successful creation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + }, + "summary": "Convert CAD file.", + "tags": [ + "file" + ], + "x-go": { + "example": "// CreateConversion: Convert CAD file.\n//\n// Convert a CAD file from one format to another. If the file being converted is larger than 30MB, it will be performed asynchronously.\n// If the conversion is performed synchronously, the contents of the converted file (`output`) will be returned as a base64 encoded string.\n// If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.\n//\n// Parameters:\n//\t- `outputFormat`: The format the file should be converted to.\n//\t- `srcFormat`: The format of the file to convert.\nfileConversion, err := client.File.CreateConversion(outputFormat, srcFormat, body)\n\n// - OR -\n\n// CreateConversionWithBase64Helper will automatically base64 encode and decode the contents\n// of the file body.\n//\n// This function is a wrapper around the CreateConversion function.\nfileConversion, err := client.File.CreateConversionWithBase64Helper(outputFormat, srcFormat, body)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#FileService.CreateConversion" + } + } + }, + "/file/conversions/{id}": { + "get": { + "description": "Get the status and output of an async file conversion.\nThis endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user.\nIf the user is not authenticated to view the specified file conversion, then it is not returned.\nOnly KittyCAD employees with the proper access can view file conversions for other users.", + "operationId": "get_file_conversion", + "parameters": [ + { + "description": "The ID of the async operation.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AsyncApiCallOutput" + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + }, + "summary": "Get a file conversion.", + "tags": [ + "file" + ], + "x-go": { + "example": "// GetConversion: Get a file conversion.\n//\n// Get the status and output of an async file conversion.\n// This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user.\n// If the user is not authenticated to view the specified file conversion, then it is not returned.\n// Only KittyCAD employees with the proper access can view file conversions for other users.\n//\n// Parameters:\n//\t- `id`: The ID of the async operation.\nasyncAPICallOutput, err := client.File.GetConversion(id)\n\n// - OR -\n\n// GetConversionWithBase64Helper will automatically base64 encode and decode the contents\n// of the file body.\n//\n// This function is a wrapper around the GetConversion function.\nasyncAPICallOutput, err := client.File.GetConversionWithBase64Helper(id)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#FileService.GetConversion" + } + } + }, + "/file/execute/{lang}": { + "post": { + "operationId": "create_file_execution", + "parameters": [ + { + "description": "The language of the code.", + "in": "path", + "name": "lang", + "required": true, + "schema": { + "$ref": "#/components/schemas/CodeLanguage" + }, + "style": "simple" + }, + { + "description": "The output file we want to get the contents for (this is relative to where in litterbox it is being run).", + "in": "query", + "name": "output", + "schema": { + "nullable": true, + "type": "string" + }, + "style": "form" + } + ], + "requestBody": { + "content": { + "application/octet-stream": { + "schema": { + "format": "binary", + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CodeOutput" + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + }, + "summary": "Execute a KittyCAD program in a specific language.", + "tags": [ + "file" + ], + "x-go": { + "example": "// CreateExecution: Execute a KittyCAD program in a specific language.\n//\n// Parameters:\n//\t- `lang`: The language of the code.\n//\t- `output`: The output file we want to get the contents for (this is relative to where in litterbox it is being run).\ncodeOutput, err := client.File.CreateExecution(lang, output, body)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#FileService.CreateExecution" + } + } + }, + "/file/mass": { + "post": { + "description": "Get the mass of an object in a CAD file. If the file is larger than 30MB, it will be performed asynchronously.\nIf the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.", + "operationId": "create_file_mass", + "parameters": [ + { + "description": "The material density.", + "in": "query", + "name": "material_density", + "required": true, + "schema": { + "format": "float", + "type": "number" + }, + "style": "form" + }, + { + "description": "The format of the file.", + "in": "query", + "name": "src_format", + "required": true, + "schema": { + "$ref": "#/components/schemas/FileSourceFormat" + }, + "style": "form" + } + ], + "requestBody": { + "content": { + "application/octet-stream": { + "schema": { + "format": "binary", + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FileMass" + } + } + }, + "description": "successful creation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + }, + "summary": "Get CAD file mass.", + "tags": [ + "file", + "beta" + ], + "x-go": { + "example": "// CreateMass: Get CAD file mass.\n//\n// Get the mass of an object in a CAD file. If the file is larger than 30MB, it will be performed asynchronously.\n// If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.\n//\n// Parameters:\n//\t- `materialDensity`: The material density.\n//\t- `srcFormat`: The format of the file.\nfileMass, err := client.File.CreateMass(materialDensity, srcFormat, body)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#FileService.CreateMass" + } + } + }, + "/file/volume": { + "post": { + "description": "Get the volume of an object in a CAD file. If the file is larger than 30MB, it will be performed asynchronously.\nIf the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.", + "operationId": "create_file_volume", + "parameters": [ + { + "description": "The format of the file.", + "in": "query", + "name": "src_format", + "required": true, + "schema": { + "$ref": "#/components/schemas/FileSourceFormat" + }, + "style": "form" + } + ], + "requestBody": { + "content": { + "application/octet-stream": { + "schema": { + "format": "binary", + "type": "string" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FileVolume" + } + } + }, + "description": "successful creation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + }, + "summary": "Get CAD file volume.", + "tags": [ + "file", + "beta" + ], + "x-go": { + "example": "// CreateVolume: Get CAD file volume.\n//\n// Get the volume of an object in a CAD file. If the file is larger than 30MB, it will be performed asynchronously.\n// If the operation is performed asynchronously, the `id` of the operation will be returned. You can use the `id` returned from the request to get status information about the async operation from the `/async/operations/{id}` endpoint.\n//\n// Parameters:\n//\t- `srcFormat`: The format of the file.\nfileVolume, err := client.File.CreateVolume(srcFormat, body)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#FileService.CreateVolume" + } + } + }, + "/login": { + "post": { + "operationId": "login", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoginParams" + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "resource updated", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Set-Cookie": { + "description": "Set-Cookie header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + }, + "summary": "This endpoint sets a session cookie for a user.", + "tags": [ + "hidden" + ], + "x-go": { + "example": "// Login: This endpoint sets a session cookie for a user.\nif err := client.Hidden.Login(body); err != nil {\n\tpanic(err)\n}", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#HiddenService.Login" + } + } + }, + "/ping": { + "get": { + "operationId": "ping", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Pong" + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + }, + "summary": "Return pong.", + "tags": [ + "meta" + ], + "x-go": { + "example": "// Ping: Return pong.\npong, err := client.Meta.Ping()", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#MetaService.Ping" + } + } + }, + "/user": { + "get": { + "description": "Get the user information for the authenticated user.\nAlternatively, you can also use the `/users/me` endpoint.", + "operationId": "get_user_self", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/User" + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + }, + "summary": "Get your user.", + "tags": [ + "users" + ], + "x-go": { + "example": "// GetSelf: Get your user.\n//\n// Get the user information for the authenticated user.\n// Alternatively, you can also use the `/users/me` endpoint.\nuser, err := client.User.GetSelf()", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#UserService.GetSelf" + } }, - "UserResultsPage": { - "description": "A single page of results", - "properties": { - "items": { - "description": "list of items on this page of results", - "items": { - "$ref": "#/components/schemas/User" + "options": { + "description": "This is necessary for some preflight requests, specifically DELETE and PUT.", + "operationId": "options_user_self", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "enum": [ + null + ], + "title": "Null", + "type": "string" + } + } }, - "type": "array" + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } }, - "next_page": { - "description": "token used to fetch the next page of results (if any)", - "nullable": true, - "type": "string" + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" } }, - "required": [ - "items" - ], - "type": "object" + "summary": "OPTIONS endpoint for users.", + "tags": [ + "hidden" + ] }, - "Uuid": { - "description": "A uuid.\n\nA Version 4 UUID is a universally unique identifier that is generated using random numbers.", - "format": "uuid", - "type": "string" - } - } - }, - "info": { - "contact": { - "email": "api@kittycad.io", - "url": "https://kittycad.io" - }, - "description": "API server for KittyCAD", - "title": "KittyCAD API", - "version": "0.1.0", - "x-go": { - "client": "// Create a client with your token.\nclient, err := kittycad.NewClient(\"$TOKEN\", \"your apps user agent\")\nif err != nil {\n panic(err)\n}\n\n// - OR -\n\n// Create a new client with your token parsed from the environment\n// variable: KITTYCAD_API_TOKEN.\nclient, err := kittycad.NewClientFromEnv(\"your apps user agent\")\nif err != nil {\n panic(err)\n}", - "install": "go get github.com/kittycad/kittycad.go" - } - }, - "openapi": "3.0.3", - "paths": { - "/": { - "get": { - "operationId": "get_schema", + "put": { + "description": "This endpoint requires authentication by any KittyCAD user. It updates information about the authenticated user.", + "operationId": "update_user_self", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateUser" + } + } + }, + "required": true + }, "responses": { "200": { "content": { "application/json": { - "schema": {} + "schema": { + "$ref": "#/components/schemas/User" + } } }, "description": "successful operation", @@ -1435,26 +3791,58 @@ "$ref": "#/components/responses/Error" } }, - "summary": "Get OpenAPI schema.", + "summary": "Update your user.", "tags": [ - "meta" + "users" ], "x-go": { - "example": "// GetSchema: Get OpenAPI schema.\nresponseGetSchema, err := client.Meta.GetSchema()", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#MetaService.GetSchema" + "example": "// UpdateSelf: Update your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It updates information about the authenticated user.\nuser, err := client.User.UpdateSelf(body)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#UserService.UpdateSelf" } } }, - "/_meta/info": { + "/user/api-calls": { "get": { - "description": "This includes information on any of our other distributed systems it is connected to.\nYou must be a KittyCAD employee to perform this request.", - "operationId": "get_metadata", + "description": "This endpoint requires authentication by any KittyCAD user. It returns the API calls for the authenticated user.\nThe API calls are returned in order of creation, with the most recently created API calls first.", + "operationId": "user_list_api_calls", + "parameters": [ + { + "description": "Maximum number of items returned by a single call", + "in": "query", + "name": "limit", + "schema": { + "format": "uint32", + "minimum": 1, + "nullable": true, + "type": "integer" + }, + "style": "form" + }, + { + "description": "Token returned by previous call to retrieve the subsequent page", + "in": "query", + "name": "page_token", + "schema": { + "nullable": true, + "type": "string" + }, + "style": "form" + }, + { + "in": "query", + "name": "sort_by", + "schema": { + "$ref": "#/components/schemas/CreatedAtSortMode" + }, + "style": "form" + } + ], "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Metadata" + "$ref": "#/components/schemas/ApiCallWithPriceResultsPage" } } }, @@ -1501,30 +3889,31 @@ "$ref": "#/components/responses/Error" } }, - "summary": "Get the metadata about our currently running server.", + "summary": "List API calls for your user.", "tags": [ - "meta" + "api-calls" ], + "x-dropshot-pagination": true, "x-go": { - "example": "// Getdata: Get the metadata about our currently running server.\n//\n// This includes information on any of our other distributed systems it is connected to.\n// You must be a KittyCAD employee to perform this request.\nmetadata, err := client.Meta.Getdata()", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#MetaService.Getdata" + "example": "// UserList: List API calls for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It returns the API calls for the authenticated user.\n// The API calls are returned in order of creation, with the most recently created API calls first.\n//\n// To iterate over all pages, use the `UserListAllPages` method, instead.\n//\n// Parameters:\n//\t- `limit`: Maximum number of items returned by a single call\n//\t- `pageToken`: Token returned by previous call to retrieve the subsequent page\n//\t- `sortBy`\naPICallWithPriceResultsPage, err := client.APICall.UserList(limit, pageToken, sortBy)\n\n// - OR -\n\n// UserListAllPages: List API calls for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It returns the API calls for the authenticated user.\n// The API calls are returned in order of creation, with the most recently created API calls first.\n//\n// This method is a wrapper around the `UserList` method.\n// This method returns all the pages at once.\n//\n// Parameters:\n//\t- `sortBy`\nAPICallWithPrice, err := client.APICall.UserListAllPages(sortBy)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APICallService.UserList" } } }, - "/api-call-metrics": { + "/user/api-calls/{id}": { "get": { - "description": "This endpoint requires authentication by a KittyCAD employee. The API calls are grouped by the parameter passed.", - "operationId": "get_api_call_metrics", + "description": "This endpoint requires authentication by any KittyCAD user. It returns details of the requested API call for the user.", + "operationId": "get_api_call_for_user", "parameters": [ { - "description": "What field to group the metrics by.", - "in": "query", - "name": "group_by", + "description": "The ID of the API call.", + "in": "path", + "name": "id", "required": true, "schema": { - "$ref": "#/components/schemas/ApiCallQueryGroupBy" + "type": "string" }, - "style": "form" + "style": "simple" } ], "responses": { @@ -1532,11 +3921,7 @@ "content": { "application/json": { "schema": { - "items": { - "$ref": "#/components/schemas/ApiCallQueryGroup" - }, - "title": "Array_of_ApiCallQueryGroup", - "type": "array" + "$ref": "#/components/schemas/ApiCallWithPrice" } } }, @@ -1583,20 +3968,20 @@ "$ref": "#/components/responses/Error" } }, - "summary": "Get API call metrics.", + "summary": "Get an API call for a user.", "tags": [ "api-calls" ], "x-go": { - "example": "// GetMetrics: Get API call metrics.\n//\n// This endpoint requires authentication by a KittyCAD employee. The API calls are grouped by the parameter passed.\n//\n// Parameters:\n//\t- `groupBy`: What field to group the metrics by.\nAPICallQueryGroup, err := client.APICall.GetMetrics(groupBy)", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APICallService.GetMetrics" + "example": "// GetForUser: Get an API call for a user.\n//\n// This endpoint requires authentication by any KittyCAD user. It returns details of the requested API call for the user.\n//\n// Parameters:\n//\t- `id`: The ID of the API call.\naPICallWithPrice, err := client.APICall.GetForUser(id)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APICallService.GetForUser" } } }, - "/api-calls": { + "/user/api-tokens": { "get": { - "description": "This endpoint requires authentication by a KittyCAD employee. The API calls are returned in order of creation, with the most recently created API calls first.", - "operationId": "list_api_calls", + "description": "This endpoint requires authentication by any KittyCAD user. It returns the API tokens for the authenticated user.\nThe API tokens are returned in order of creation, with the most recently created API tokens first.", + "operationId": "list_api_tokens_for_user", "parameters": [ { "description": "Maximum number of items returned by a single call", @@ -1611,7 +3996,7 @@ "style": "form" }, { - "description": "Token returned by previous call to retreive the subsequent page", + "description": "Token returned by previous call to retrieve the subsequent page", "in": "query", "name": "page_token", "schema": { @@ -1630,15 +4015,80 @@ } ], "responses": { - "200": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiTokenResultsPage" + } + } + }, + "description": "successful operation", + "headers": { + "Access-Control-Allow-Credentials": { + "description": "Access-Control-Allow-Credentials header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Headers": { + "description": "Access-Control-Allow-Headers header. This is a comma-separated list of headers.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Methods": { + "description": "Access-Control-Allow-Methods header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + }, + "Access-Control-Allow-Origin": { + "description": "Access-Control-Allow-Origin header.", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + }, + "summary": "List API tokens for your user.", + "tags": [ + "api-tokens" + ], + "x-dropshot-pagination": true, + "x-go": { + "example": "// ListForUser: List API tokens for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It returns the API tokens for the authenticated user.\n// The API tokens are returned in order of creation, with the most recently created API tokens first.\n//\n// To iterate over all pages, use the `ListForUserAllPages` method, instead.\n//\n// Parameters:\n//\t- `limit`: Maximum number of items returned by a single call\n//\t- `pageToken`: Token returned by previous call to retrieve the subsequent page\n//\t- `sortBy`\naPITokenResultsPage, err := client.APIToken.ListForUser(limit, pageToken, sortBy)\n\n// - OR -\n\n// ListForUserAllPages: List API tokens for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It returns the API tokens for the authenticated user.\n// The API tokens are returned in order of creation, with the most recently created API tokens first.\n//\n// This method is a wrapper around the `ListForUser` method.\n// This method returns all the pages at once.\n//\n// Parameters:\n//\t- `sortBy`\nAPIToken, err := client.APIToken.ListForUserAllPages(sortBy)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APITokenService.ListForUser" + } + }, + "post": { + "description": "This endpoint requires authentication by any KittyCAD user. It creates a new API token for the authenticated user.", + "operationId": "create_api_token_for_user", + "responses": { + "201": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApiCallWithPriceResultsPage" + "$ref": "#/components/schemas/ApiToken" } } }, - "description": "successful operation", + "description": "successful creation", "headers": { "Access-Control-Allow-Credentials": { "description": "Access-Control-Allow-Credentials header.", @@ -1681,43 +4131,36 @@ "$ref": "#/components/responses/Error" } }, - "summary": "List API calls.", + "summary": "Create a new API token for your user.", "tags": [ - "api-calls" + "api-tokens" ], - "x-dropshot-pagination": true, "x-go": { - "example": "// List: List API calls.\n//\n// This endpoint requires authentication by a KittyCAD employee. The API calls are returned in order of creation, with the most recently created API calls first.\n//\n// To iterate over all pages, use the `ListAllPages` method, instead.\n//\n// Parameters:\n//\t- `limit`: Maximum number of items returned by a single call\n//\t- `pageToken`: Token returned by previous call to retreive the subsequent page\n//\t- `sortBy`\naPICallWithPriceResultsPage, err := client.APICall.List(limit, pageToken, sortBy)\n\n// - OR -\n\n// ListAllPages: List API calls.\n//\n// This endpoint requires authentication by a KittyCAD employee. The API calls are returned in order of creation, with the most recently created API calls first.\n//\n// This method is a wrapper around the `List` method.\n// This method returns all the pages at once.\n//\n// Parameters:\n//\t- `sortBy`\nAPICallWithPrice, err := client.APICall.ListAllPages(sortBy)", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APICallService.List" + "example": "// CreateForUser: Create a new API token for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It creates a new API token for the authenticated user.\naPIToken, err := client.APIToken.CreateForUser()", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APITokenService.CreateForUser" } } }, - "/api-calls/{id}": { - "get": { - "description": "This endpoint requires authentication by any KittyCAD user. It returns details of the requested API call for the user.\nIf the user is not authenticated to view the specified API call, then it is not returned.\nOnly KittyCAD employees can view API calls for other users.", - "operationId": "get_api_call", + "/user/api-tokens/{token}": { + "delete": { + "description": "This endpoint requires authentication by any KittyCAD user. It deletes the requested API token for the user.\nThis endpoint does not actually delete the API token from the database. It merely marks the token as invalid. We still want to keep the token in the database for historical purposes.", + "operationId": "delete_api_token_for_user", "parameters": [ { - "description": "The ID of the API call.", + "description": "The API token.", "in": "path", - "name": "id", + "name": "token", "required": true, "schema": { + "format": "uuid", "type": "string" }, "style": "simple" } ], "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ApiCallWithPrice" - } - } - }, - "description": "successful operation", + "204": { + "description": "successful deletion", "headers": { "Access-Control-Allow-Credentials": { "description": "Access-Control-Allow-Credentials header.", @@ -1760,63 +4203,41 @@ "$ref": "#/components/responses/Error" } }, - "summary": "Get details of an API call.", + "summary": "Delete an API token for your user.", "tags": [ - "api-calls" + "api-tokens" ], "x-go": { - "example": "// Get: Get details of an API call.\n//\n// This endpoint requires authentication by any KittyCAD user. It returns details of the requested API call for the user.\n// If the user is not authenticated to view the specified API call, then it is not returned.\n// Only KittyCAD employees can view API calls for other users.\n//\n// Parameters:\n//\t- `id`: The ID of the API call.\naPICallWithPrice, err := client.APICall.Get(id)", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APICallService.Get" + "example": "// DeleteForUser: Delete an API token for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It deletes the requested API token for the user.\n// This endpoint does not actually delete the API token from the database. It merely marks the token as invalid. We still want to keep the token in the database for historical purposes.\n//\n// Parameters:\n//\t- `token`: The API token.\nif err := client.APIToken.DeleteForUser(token); err != nil {\n\tpanic(err)\n}", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APITokenService.DeleteForUser" } - } - }, - "/file/conversion/{src_format}/{output_format}": { - "post": { - "description": "Convert a CAD file from one format to another. If the file being converted is larger than 30MB, it will be performed asynchronously.\nIf the conversion is performed synchronously, the contents of the converted file (`output`) will be returned as a base64 encoded string.\nIf the conversion is performed asynchronously, the `id` of the conversion will be returned. You can use the `id` returned from the request to get status information about the async conversion from the `/file/conversions/{id}` endpoint.", - "operationId": "create_file_conversion", + }, + "get": { + "description": "This endpoint requires authentication by any KittyCAD user. It returns details of the requested API token for the user.", + "operationId": "get_api_token_for_user", "parameters": [ { - "description": "The format the file should be converted to.", - "in": "path", - "name": "output_format", - "required": true, - "schema": { - "$ref": "#/components/schemas/FileConversionOutputFormat" - }, - "style": "simple" - }, - { - "description": "The format of the file to convert.", + "description": "The API token.", "in": "path", - "name": "src_format", + "name": "token", "required": true, "schema": { - "$ref": "#/components/schemas/FileConversionSourceFormat" + "format": "uuid", + "type": "string" }, "style": "simple" } ], - "requestBody": { - "content": { - "application/octet-stream": { - "schema": { - "format": "binary", - "type": "string" - } - } - }, - "required": true - }, "responses": { - "201": { + "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FileConversionWithOutput" + "$ref": "#/components/schemas/ApiToken" } } }, - "description": "successful creation", + "description": "successful operation", "headers": { "Access-Control-Allow-Credentials": { "description": "Access-Control-Allow-Credentials header.", @@ -1859,59 +4280,29 @@ "$ref": "#/components/responses/Error" } }, - "summary": "Convert CAD file.", + "summary": "Get an API token for your user.", "tags": [ - "file" + "api-tokens" ], "x-go": { - "example": "// CreateConversion: Convert CAD file.\n//\n// Convert a CAD file from one format to another. If the file being converted is larger than 30MB, it will be performed asynchronously.\n// If the conversion is performed synchronously, the contents of the converted file (`output`) will be returned as a base64 encoded string.\n// If the conversion is performed asynchronously, the `id` of the conversion will be returned. You can use the `id` returned from the request to get status information about the async conversion from the `/file/conversions/{id}` endpoint.\n//\n// Parameters:\n//\t- `outputFormat`: The format the file should be converted to.\n//\t- `srcFormat`: The format of the file to convert.\nfileConversionWithOutput, err := client.File.CreateConversion(outputFormat, srcFormat, body)\n\n// - OR -\n\n// CreateConversionWithBase64Helper will automatically base64 encode and decode the contents\n// of the file body.\n//\n// This function is a wrapper around the CreateConversion function.\nfileConversionWithOutput, err := client.File.CreateConversionWithBase64Helper(outputFormat, srcFormat, body)", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#FileService.CreateConversion" + "example": "// GetForUser: Get an API token for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It returns details of the requested API token for the user.\n//\n// Parameters:\n//\t- `token`: The API token.\naPIToken, err := client.APIToken.GetForUser(token)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APITokenService.GetForUser" } - } - }, - "/file/conversions": { - "get": { - "description": "This endpoint does not return the contents of the converted file (`output`). To get the contents use the `/file/conversions/{id}` endpoint.\nThis endpoint requires authentication by a KittyCAD employee.", - "operationId": "list_file_conversions", + }, + "options": { + "description": "This is necessary for some preflight requests, specifically DELETE.", + "operationId": "options_api_token_for_user", "parameters": [ { - "description": "Maximum number of items returned by a single call", - "in": "query", - "name": "limit", - "schema": { - "format": "uint32", - "minimum": 1, - "nullable": true, - "type": "integer" - }, - "style": "form" - }, - { - "description": "Token returned by previous call to retreive the subsequent page", - "in": "query", - "name": "page_token", + "description": "The API token.", + "in": "path", + "name": "token", + "required": true, "schema": { - "nullable": true, + "format": "uuid", "type": "string" }, - "style": "form" - }, - { - "in": "query", - "name": "sort_by", - "schema": { - "$ref": "#/components/schemas/CreatedAtSortMode" - }, - "style": "form" - }, - { - "description": "The status to filter by.", - "in": "query", - "name": "status", - "schema": { - "$ref": "#/components/schemas/FileConversionStatus" - }, - "style": "form" + "style": "simple" } ], "responses": { @@ -1919,7 +4310,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FileConversionResultsPage" + "enum": [ + null + ], + "title": "Null", + "type": "string" } } }, @@ -1966,39 +4361,22 @@ "$ref": "#/components/responses/Error" } }, - "summary": "List file conversions.", + "summary": "OPTIONS endpoint for API tokens.", "tags": [ - "file" - ], - "x-dropshot-pagination": true, - "x-go": { - "example": "// ListConversions: List file conversions.\n//\n// This endpoint does not return the contents of the converted file (`output`). To get the contents use the `/file/conversions/{id}` endpoint.\n// This endpoint requires authentication by a KittyCAD employee.\n//\n// To iterate over all pages, use the `ListConversionsAllPages` method, instead.\n//\n// Parameters:\n//\t- `limit`: Maximum number of items returned by a single call\n//\t- `pageToken`: Token returned by previous call to retreive the subsequent page\n//\t- `sortBy`\n//\t- `status`: The status to filter by.\nfileConversionResultsPage, err := client.File.ListConversions(limit, pageToken, sortBy, status)\n\n// - OR -\n\n// ListConversionsAllPages: List file conversions.\n//\n// This endpoint does not return the contents of the converted file (`output`). To get the contents use the `/file/conversions/{id}` endpoint.\n// This endpoint requires authentication by a KittyCAD employee.\n//\n// This method is a wrapper around the `ListConversions` method.\n// This method returns all the pages at once.\n//\n// Parameters:\n//\t- `sortBy`\n//\t- `status`: The status to filter by.\nFileConversion, err := client.File.ListConversionsAllPages(sortBy, status)", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#FileService.ListConversions" - } + "hidden" + ] } }, - "/file/conversions/{id}": { + "/user/extended": { "get": { - "description": "Get the status and output of an async file conversion.\nThis endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user.\nIf the user is not authenticated to view the specified file conversion, then it is not returned.\nOnly KittyCAD employees with the proper access can view file conversions for other users.", - "operationId": "get_file_conversion", - "parameters": [ - { - "description": "The ID of the file conversion.", - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - ], + "description": "Get the user information for the authenticated user.\nAlternatively, you can also use the `/users/me` endpoint.", + "operationId": "get_user_self_extended", "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FileConversionWithOutput" + "$ref": "#/components/schemas/ExtendedUser" } } }, @@ -2045,25 +4423,38 @@ "$ref": "#/components/responses/Error" } }, - "summary": "Get a file conversion.", + "summary": "Get extended information about your user.", "tags": [ - "file" + "users" ], "x-go": { - "example": "// GetConversion: Get a file conversion.\n//\n// Get the status and output of an async file conversion.\n// This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user.\n// If the user is not authenticated to view the specified file conversion, then it is not returned.\n// Only KittyCAD employees with the proper access can view file conversions for other users.\n//\n// Parameters:\n//\t- `id`: The ID of the file conversion.\nfileConversionWithOutput, err := client.File.GetConversion(id)\n\n// - OR -\n\n// GetConversionWithBase64Helper will automatically base64 encode and decode the contents\n// of the file body.\n//\n// This function is a wrapper around the GetConversion function.\nfileConversionWithOutput, err := client.File.GetConversionWithBase64Helper(id)", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#FileService.GetConversion" + "example": "// GetSelfExtended: Get extended information about your user.\n//\n// Get the user information for the authenticated user.\n// Alternatively, you can also use the `/users/me` endpoint.\nextendedUser, err := client.User.GetSelfExtended()", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#UserService.GetSelfExtended" } } }, - "/ping": { + "/user/file/conversions/{id}": { "get": { - "operationId": "ping", + "description": "Get the status and output of an async file conversion. If completed, the contents of the converted file (`output`) will be returned as a base64 encoded string.\nThis endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user.", + "operationId": "get_file_conversion_for_user", + "parameters": [ + { + "description": "The ID of the async operation.", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + }, + "style": "simple" + } + ], "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Pong" + "$ref": "#/components/schemas/AsyncApiCallOutput" } } }, @@ -2110,30 +4501,23 @@ "$ref": "#/components/responses/Error" } }, - "summary": "Return pong.", + "summary": "Get a file conversion for your user.", "tags": [ - "meta" + "file" ], "x-go": { - "example": "// Ping: Return pong.\npong, err := client.Meta.Ping()", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#MetaService.Ping" + "example": "// GetConversionForUser: Get a file conversion for your user.\n//\n// Get the status and output of an async file conversion. If completed, the contents of the converted file (`output`) will be returned as a base64 encoded string.\n// This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user.\n//\n// Parameters:\n//\t- `id`: The ID of the async operation.\nasyncAPICallOutput, err := client.File.GetConversionForUser(id)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#FileService.GetConversionForUser" } } }, - "/user": { - "get": { - "description": "Get the user information for the authenticated user.\nAlternatively, you can also use the `/users/me` endpoint.", - "operationId": "get_user_self", + "/user/payment": { + "delete": { + "description": "This includes billing address, phone, and name.\nThis endpoint requires authentication by any KittyCAD user. It deletes the payment information for the authenticated user.", + "operationId": "delete_payment_information_for_user", "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/User" - } - } - }, - "description": "successful operation", + "204": { + "description": "successful deletion", "headers": { "Access-Control-Allow-Credentials": { "description": "Access-Control-Allow-Credentials header.", @@ -2168,66 +4552,32 @@ "style": "simple" } } - }, - "4XX": { - "$ref": "#/components/responses/Error" - }, - "5XX": { - "$ref": "#/components/responses/Error" - } - }, - "summary": "Get your user.", - "tags": [ - "users" - ], - "x-go": { - "example": "// GetSelf: Get your user.\n//\n// Get the user information for the authenticated user.\n// Alternatively, you can also use the `/users/me` endpoint.\nuser, err := client.User.GetSelf()", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#UserService.GetSelf" - } - } - }, - "/user/api-calls": { - "get": { - "description": "This endpoint requires authentication by any KittyCAD user. It returns the API calls for the authenticated user.\nThe API calls are returned in order of creation, with the most recently created API calls first.", - "operationId": "user_list_api_calls", - "parameters": [ - { - "description": "Maximum number of items returned by a single call", - "in": "query", - "name": "limit", - "schema": { - "format": "uint32", - "minimum": 1, - "nullable": true, - "type": "integer" - }, - "style": "form" - }, - { - "description": "Token returned by previous call to retreive the subsequent page", - "in": "query", - "name": "page_token", - "schema": { - "nullable": true, - "type": "string" - }, - "style": "form" - }, - { - "in": "query", - "name": "sort_by", - "schema": { - "$ref": "#/components/schemas/CreatedAtSortMode" - }, - "style": "form" + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" } + }, + "summary": "Delete payment info for your user.", + "tags": [ + "payments" ], + "x-go": { + "example": "// DeleteInformationForUser: Delete payment info for your user.\n//\n// This includes billing address, phone, and name.\n// This endpoint requires authentication by any KittyCAD user. It deletes the payment information for the authenticated user.\nif err := client.Payment.DeleteInformationForUser(); err != nil {\n\tpanic(err)\n}", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#PaymentService.DeleteInformationForUser" + } + }, + "get": { + "description": "This includes billing address, phone, and name.\nThis endpoint requires authentication by any KittyCAD user. It gets the payment information for the authenticated user.", + "operationId": "get_payment_information_for_user", "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApiCallWithPriceResultsPage" + "$ref": "#/components/schemas/Customer" } } }, @@ -2274,39 +4624,28 @@ "$ref": "#/components/responses/Error" } }, - "summary": "List API calls for your user.", + "summary": "Get payment info about your user.", "tags": [ - "api-calls" + "payments" ], - "x-dropshot-pagination": true, "x-go": { - "example": "// UserList: List API calls for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It returns the API calls for the authenticated user.\n// The API calls are returned in order of creation, with the most recently created API calls first.\n//\n// To iterate over all pages, use the `UserListAllPages` method, instead.\n//\n// Parameters:\n//\t- `limit`: Maximum number of items returned by a single call\n//\t- `pageToken`: Token returned by previous call to retreive the subsequent page\n//\t- `sortBy`\naPICallWithPriceResultsPage, err := client.APICall.UserList(limit, pageToken, sortBy)\n\n// - OR -\n\n// UserListAllPages: List API calls for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It returns the API calls for the authenticated user.\n// The API calls are returned in order of creation, with the most recently created API calls first.\n//\n// This method is a wrapper around the `UserList` method.\n// This method returns all the pages at once.\n//\n// Parameters:\n//\t- `sortBy`\nAPICallWithPrice, err := client.APICall.UserListAllPages(sortBy)", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APICallService.UserList" + "example": "// GetInformationForUser: Get payment info about your user.\n//\n// This includes billing address, phone, and name.\n// This endpoint requires authentication by any KittyCAD user. It gets the payment information for the authenticated user.\ncustomer, err := client.Payment.GetInformationForUser()", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#PaymentService.GetInformationForUser" } - } - }, - "/user/api-calls/{id}": { - "get": { - "description": "This endpoint requires authentication by any KittyCAD user. It returns details of the requested API call for the user.", - "operationId": "get_api_call_for_user", - "parameters": [ - { - "description": "The ID of the API call.", - "in": "path", - "name": "id", - "required": true, - "schema": { - "type": "string" - }, - "style": "simple" - } - ], + }, + "options": { + "description": "This is necessary for some preflight requests, specifically DELETE and PUT.", + "operationId": "options_payment_information_for_user", "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApiCallWithPrice" + "enum": [ + null + ], + "title": "Null", + "type": "string" } } }, @@ -2353,62 +4692,34 @@ "$ref": "#/components/responses/Error" } }, - "summary": "Get an API call for a user.", + "summary": "OPTIONS endpoint for user payment information.", "tags": [ - "api-calls" - ], - "x-go": { - "example": "// GetForUser: Get an API call for a user.\n//\n// This endpoint requires authentication by any KittyCAD user. It returns details of the requested API call for the user.\n//\n// Parameters:\n//\t- `id`: The ID of the API call.\naPICallWithPrice, err := client.APICall.GetForUser(id)", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APICallService.GetForUser" - } - } - }, - "/user/api-tokens": { - "get": { - "description": "This endpoint requires authentication by any KittyCAD user. It returns the API tokens for the authenticated user.\nThe API tokens are returned in order of creation, with the most recently created API tokens first.", - "operationId": "list_api_tokens_for_user", - "parameters": [ - { - "description": "Maximum number of items returned by a single call", - "in": "query", - "name": "limit", - "schema": { - "format": "uint32", - "minimum": 1, - "nullable": true, - "type": "integer" - }, - "style": "form" - }, - { - "description": "Token returned by previous call to retreive the subsequent page", - "in": "query", - "name": "page_token", - "schema": { - "nullable": true, - "type": "string" - }, - "style": "form" + "hidden" + ] + }, + "post": { + "description": "This includes billing address, phone, and name.\nThis endpoint requires authentication by any KittyCAD user. It creates the payment information for the authenticated user.", + "operationId": "create_payment_information_for_user", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BillingInfo" + } + } }, - { - "in": "query", - "name": "sort_by", - "schema": { - "$ref": "#/components/schemas/CreatedAtSortMode" - }, - "style": "form" - } - ], + "required": true + }, "responses": { - "200": { + "201": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApiTokenResultsPage" + "$ref": "#/components/schemas/Customer" } } }, - "description": "successful operation", + "description": "successful creation", "headers": { "Access-Control-Allow-Credentials": { "description": "Access-Control-Allow-Credentials header.", @@ -2451,29 +4762,38 @@ "$ref": "#/components/responses/Error" } }, - "summary": "List API tokens for your user.", + "summary": "Create payment info for your user.", "tags": [ - "api-tokens" + "payments" ], - "x-dropshot-pagination": true, "x-go": { - "example": "// ListForUser: List API tokens for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It returns the API tokens for the authenticated user.\n// The API tokens are returned in order of creation, with the most recently created API tokens first.\n//\n// To iterate over all pages, use the `ListForUserAllPages` method, instead.\n//\n// Parameters:\n//\t- `limit`: Maximum number of items returned by a single call\n//\t- `pageToken`: Token returned by previous call to retreive the subsequent page\n//\t- `sortBy`\naPITokenResultsPage, err := client.APIToken.ListForUser(limit, pageToken, sortBy)\n\n// - OR -\n\n// ListForUserAllPages: List API tokens for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It returns the API tokens for the authenticated user.\n// The API tokens are returned in order of creation, with the most recently created API tokens first.\n//\n// This method is a wrapper around the `ListForUser` method.\n// This method returns all the pages at once.\n//\n// Parameters:\n//\t- `sortBy`\nAPIToken, err := client.APIToken.ListForUserAllPages(sortBy)", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APITokenService.ListForUser" + "example": "// CreateInformationForUser: Create payment info for your user.\n//\n// This includes billing address, phone, and name.\n// This endpoint requires authentication by any KittyCAD user. It creates the payment information for the authenticated user.\ncustomer, err := client.Payment.CreateInformationForUser(body)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#PaymentService.CreateInformationForUser" } }, - "post": { - "description": "This endpoint requires authentication by any KittyCAD user. It creates a new API token for the authenticated user.", - "operationId": "create_api_token_for_user", + "put": { + "description": "This includes billing address, phone, and name.\nThis endpoint requires authentication by any KittyCAD user. It updates the payment information for the authenticated user.", + "operationId": "update_payment_information_for_user", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BillingInfo" + } + } + }, + "required": true + }, "responses": { - "201": { + "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApiToken" + "$ref": "#/components/schemas/Customer" } } }, - "description": "successful creation", + "description": "successful operation", "headers": { "Access-Control-Allow-Credentials": { "description": "Access-Control-Allow-Credentials header.", @@ -2516,36 +4836,30 @@ "$ref": "#/components/responses/Error" } }, - "summary": "Create a new API token for your user.", + "summary": "Update payment info for your user.", "tags": [ - "api-tokens" + "payments" ], "x-go": { - "example": "// CreateForUser: Create a new API token for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It creates a new API token for the authenticated user.\naPIToken, err := client.APIToken.CreateForUser()", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APITokenService.CreateForUser" + "example": "// UpdateInformationForUser: Update payment info for your user.\n//\n// This includes billing address, phone, and name.\n// This endpoint requires authentication by any KittyCAD user. It updates the payment information for the authenticated user.\ncustomer, err := client.Payment.UpdateInformationForUser(body)", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#PaymentService.UpdateInformationForUser" } } }, - "/user/api-tokens/{token}": { - "delete": { - "description": "This endpoint requires authentication by any KittyCAD user. It deletes the requested API token for the user.\nThis endpoint does not actually delete the API token from the database. It merely marks the token as invalid. We still want to keep the token in the database for historical purposes.", - "operationId": "delete_api_token_for_user", - "parameters": [ - { - "description": "The API token.", - "in": "path", - "name": "token", - "required": true, - "schema": { - "format": "uuid", - "type": "string" - }, - "style": "simple" - } - ], + "/user/payment/intent": { + "post": { + "description": "This endpoint requires authentication by any KittyCAD user. It creates a new payment intent for the authenticated user.", + "operationId": "create_payment_intent_for_user", "responses": { - "204": { - "description": "successful deletion", + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PaymentIntent" + } + } + }, + "description": "successful creation", "headers": { "Access-Control-Allow-Credentials": { "description": "Access-Control-Allow-Credentials header.", @@ -2588,37 +4902,31 @@ "$ref": "#/components/responses/Error" } }, - "summary": "Delete an API token for your user.", + "summary": "Create a payment intent for your user.", "tags": [ - "api-tokens" + "payments", + "hidden" ], "x-go": { - "example": "// DeleteForUser: Delete an API token for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It deletes the requested API token for the user.\n// This endpoint does not actually delete the API token from the database. It merely marks the token as invalid. We still want to keep the token in the database for historical purposes.\n//\n// Parameters:\n//\t- `token`: The API token.\nif err := client.APIToken.DeleteForUser(token); err != nil {\n\tpanic(err)\n}", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APITokenService.DeleteForUser" + "example": "// CreateIntentForUser: Create a payment intent for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It creates a new payment intent for the authenticated user.\npaymentIntent, err := client.Payment.CreateIntentForUser()", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#PaymentService.CreateIntentForUser" } - }, + } + }, + "/user/payment/invoices": { "get": { - "description": "This endpoint requires authentication by any KittyCAD user. It returns details of the requested API token for the user.", - "operationId": "get_api_token_for_user", - "parameters": [ - { - "description": "The API token.", - "in": "path", - "name": "token", - "required": true, - "schema": { - "format": "uuid", - "type": "string" - }, - "style": "simple" - } - ], + "description": "This endpoint requires authentication by any KittyCAD user. It lists invoices for the authenticated user.", + "operationId": "list_invoices_for_user", "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ApiToken" + "items": { + "$ref": "#/components/schemas/Invoice" + }, + "title": "Array_of_Invoice", + "type": "array" } } }, @@ -2665,26 +4973,30 @@ "$ref": "#/components/responses/Error" } }, - "summary": "Get an API token for your user.", + "summary": "List invoices for your user.", "tags": [ - "api-tokens" + "payments" ], "x-go": { - "example": "// GetForUser: Get an API token for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It returns details of the requested API token for the user.\n//\n// Parameters:\n//\t- `token`: The API token.\naPIToken, err := client.APIToken.GetForUser(token)", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APITokenService.GetForUser" + "example": "// ListInvoicesForUser: List invoices for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It lists invoices for the authenticated user.\nInvoice, err := client.Payment.ListInvoicesForUser()", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#PaymentService.ListInvoicesForUser" } } }, - "/user/extended": { + "/user/payment/methods": { "get": { - "description": "Get the user information for the authenticated user.\nAlternatively, you can also use the `/users/me` endpoint.", - "operationId": "get_user_self_extended", + "description": "This endpoint requires authentication by any KittyCAD user. It lists payment methods for the authenticated user.", + "operationId": "list_payment_methods_for_user", "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ExtendedUser" + "items": { + "$ref": "#/components/schemas/PaymentMethod" + }, + "title": "Array_of_PaymentMethod", + "type": "array" } } }, @@ -2731,62 +5043,35 @@ "$ref": "#/components/responses/Error" } }, - "summary": "Get extended information about your user.", + "summary": "List payment methods for your user.", "tags": [ - "users" + "payments" ], "x-go": { - "example": "// GetSelfExtended: Get extended information about your user.\n//\n// Get the user information for the authenticated user.\n// Alternatively, you can also use the `/users/me` endpoint.\nextendedUser, err := client.User.GetSelfExtended()", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#UserService.GetSelfExtended" + "example": "// ListMethodsForUser: List payment methods for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It lists payment methods for the authenticated user.\nPaymentMethod, err := client.Payment.ListMethodsForUser()", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#PaymentService.ListMethodsForUser" } } }, - "/user/file/conversions": { - "get": { - "description": "This endpoint does not return the contents of the converted file (`output`). To get the contents use the `/file/conversions/{id}` endpoint.\nThis endpoint requires authentication by any KittyCAD user. It returns the API tokens for the authenticated user.\nThe file conversions are returned in order of creation, with the most recently created file conversions first.", - "operationId": "list_file_conversions_for_user", + "/user/payment/methods/{id}": { + "delete": { + "description": "This endpoint requires authentication by any KittyCAD user. It deletes the specified payment method for the authenticated user.", + "operationId": "delete_payment_method_for_user", "parameters": [ { - "description": "Maximum number of items returned by a single call", - "in": "query", - "name": "limit", - "schema": { - "format": "uint32", - "minimum": 1, - "nullable": true, - "type": "integer" - }, - "style": "form" - }, - { - "description": "Token returned by previous call to retreive the subsequent page", - "in": "query", - "name": "page_token", + "description": "The ID of the payment method.", + "in": "path", + "name": "id", + "required": true, "schema": { - "nullable": true, "type": "string" }, - "style": "form" - }, - { - "in": "query", - "name": "sort_by", - "schema": { - "$ref": "#/components/schemas/CreatedAtSortMode" - }, - "style": "form" + "style": "simple" } ], "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/FileConversionResultsPage" - } - } - }, - "description": "successful operation", + "204": { + "description": "successful deletion", "headers": { "Access-Control-Allow-Credentials": { "description": "Access-Control-Allow-Credentials header.", @@ -2829,24 +5114,22 @@ "$ref": "#/components/responses/Error" } }, - "summary": "List file conversions for your user.", + "summary": "Delete a payment method for your user.", "tags": [ - "file" + "payments", + "hidden" ], - "x-dropshot-pagination": true, "x-go": { - "example": "// ListConversionsForUser: List file conversions for your user.\n//\n// This endpoint does not return the contents of the converted file (`output`). To get the contents use the `/file/conversions/{id}` endpoint.\n// This endpoint requires authentication by any KittyCAD user. It returns the API tokens for the authenticated user.\n// The file conversions are returned in order of creation, with the most recently created file conversions first.\n//\n// To iterate over all pages, use the `ListConversionsForUserAllPages` method, instead.\n//\n// Parameters:\n//\t- `limit`: Maximum number of items returned by a single call\n//\t- `pageToken`: Token returned by previous call to retreive the subsequent page\n//\t- `sortBy`\nfileConversionResultsPage, err := client.File.ListConversionsForUser(limit, pageToken, sortBy)\n\n// - OR -\n\n// ListConversionsForUserAllPages: List file conversions for your user.\n//\n// This endpoint does not return the contents of the converted file (`output`). To get the contents use the `/file/conversions/{id}` endpoint.\n// This endpoint requires authentication by any KittyCAD user. It returns the API tokens for the authenticated user.\n// The file conversions are returned in order of creation, with the most recently created file conversions first.\n//\n// This method is a wrapper around the `ListConversionsForUser` method.\n// This method returns all the pages at once.\n//\n// Parameters:\n//\t- `sortBy`\nFileConversion, err := client.File.ListConversionsForUserAllPages(sortBy)", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#FileService.ListConversionsForUser" + "example": "// DeleteMethodForUser: Delete a payment method for your user.\n//\n// This endpoint requires authentication by any KittyCAD user. It deletes the specified payment method for the authenticated user.\n//\n// Parameters:\n//\t- `id`: The ID of the payment method.\nif err := client.Payment.DeleteMethodForUser(id); err != nil {\n\tpanic(err)\n}", + "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#PaymentService.DeleteMethodForUser" } - } - }, - "/user/file/conversions/{id}": { - "get": { - "description": "Get the status and output of an async file conversion. If completed, the contents of the converted file (`output`) will be returned as a base64 encoded string.\nThis endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user.", - "operationId": "get_file_conversion_for_user", + }, + "options": { + "description": "This is necessary for some preflight requests, specifically DELETE.", + "operationId": "options_payment_methods_for_user", "parameters": [ { - "description": "The ID of the file conversion.", + "description": "The ID of the payment method.", "in": "path", "name": "id", "required": true, @@ -2861,7 +5144,11 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FileConversionWithOutput" + "enum": [ + null + ], + "title": "Null", + "type": "string" } } }, @@ -2908,14 +5195,10 @@ "$ref": "#/components/responses/Error" } }, - "summary": "Get a file conversion for your user.", + "summary": "OPTIONS endpoint for user payment methods.", "tags": [ - "file" - ], - "x-go": { - "example": "// GetConversionForUser: Get a file conversion for your user.\n//\n// Get the status and output of an async file conversion. If completed, the contents of the converted file (`output`) will be returned as a base64 encoded string.\n// This endpoint requires authentication by any KittyCAD user. It returns details of the requested file conversion for the user.\n//\n// Parameters:\n//\t- `id`: The ID of the file conversion.\nfileConversionWithOutput, err := client.File.GetConversionForUser(id)", - "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#FileService.GetConversionForUser" - } + "hidden" + ] } }, "/user/session/{token}": { @@ -3015,7 +5298,7 @@ "style": "form" }, { - "description": "Token returned by previous call to retreive the subsequent page", + "description": "Token returned by previous call to retrieve the subsequent page", "in": "query", "name": "page_token", "schema": { @@ -3091,7 +5374,7 @@ ], "x-dropshot-pagination": true, "x-go": { - "example": "// List: List users.\n//\n// This endpoint required authentication by a KittyCAD employee. The users are returned in order of creation, with the most recently created users first.\n//\n// To iterate over all pages, use the `ListAllPages` method, instead.\n//\n// Parameters:\n//\t- `limit`: Maximum number of items returned by a single call\n//\t- `pageToken`: Token returned by previous call to retreive the subsequent page\n//\t- `sortBy`\nuserResultsPage, err := client.User.List(limit, pageToken, sortBy)\n\n// - OR -\n\n// ListAllPages: List users.\n//\n// This endpoint required authentication by a KittyCAD employee. The users are returned in order of creation, with the most recently created users first.\n//\n// This method is a wrapper around the `List` method.\n// This method returns all the pages at once.\n//\n// Parameters:\n//\t- `sortBy`\nUser, err := client.User.ListAllPages(sortBy)", + "example": "// List: List users.\n//\n// This endpoint required authentication by a KittyCAD employee. The users are returned in order of creation, with the most recently created users first.\n//\n// To iterate over all pages, use the `ListAllPages` method, instead.\n//\n// Parameters:\n//\t- `limit`: Maximum number of items returned by a single call\n//\t- `pageToken`: Token returned by previous call to retrieve the subsequent page\n//\t- `sortBy`\nuserResultsPage, err := client.User.List(limit, pageToken, sortBy)\n\n// - OR -\n\n// ListAllPages: List users.\n//\n// This endpoint required authentication by a KittyCAD employee. The users are returned in order of creation, with the most recently created users first.\n//\n// This method is a wrapper around the `List` method.\n// This method returns all the pages at once.\n//\n// Parameters:\n//\t- `sortBy`\nUser, err := client.User.ListAllPages(sortBy)", "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#UserService.List" } } @@ -3114,7 +5397,7 @@ "style": "form" }, { - "description": "Token returned by previous call to retreive the subsequent page", + "description": "Token returned by previous call to retrieve the subsequent page", "in": "query", "name": "page_token", "schema": { @@ -3190,7 +5473,7 @@ ], "x-dropshot-pagination": true, "x-go": { - "example": "// ListExtended: List users with extended information.\n//\n// This endpoint required authentication by a KittyCAD employee. The users are returned in order of creation, with the most recently created users first.\n//\n// To iterate over all pages, use the `ListExtendedAllPages` method, instead.\n//\n// Parameters:\n//\t- `limit`: Maximum number of items returned by a single call\n//\t- `pageToken`: Token returned by previous call to retreive the subsequent page\n//\t- `sortBy`\nextendedUserResultsPage, err := client.User.ListExtended(limit, pageToken, sortBy)\n\n// - OR -\n\n// ListExtendedAllPages: List users with extended information.\n//\n// This endpoint required authentication by a KittyCAD employee. The users are returned in order of creation, with the most recently created users first.\n//\n// This method is a wrapper around the `ListExtended` method.\n// This method returns all the pages at once.\n//\n// Parameters:\n//\t- `sortBy`\nExtendedUser, err := client.User.ListExtendedAllPages(sortBy)", + "example": "// ListExtended: List users with extended information.\n//\n// This endpoint required authentication by a KittyCAD employee. The users are returned in order of creation, with the most recently created users first.\n//\n// To iterate over all pages, use the `ListExtendedAllPages` method, instead.\n//\n// Parameters:\n//\t- `limit`: Maximum number of items returned by a single call\n//\t- `pageToken`: Token returned by previous call to retrieve the subsequent page\n//\t- `sortBy`\nextendedUserResultsPage, err := client.User.ListExtended(limit, pageToken, sortBy)\n\n// - OR -\n\n// ListExtendedAllPages: List users with extended information.\n//\n// This endpoint required authentication by a KittyCAD employee. The users are returned in order of creation, with the most recently created users first.\n//\n// This method is a wrapper around the `ListExtended` method.\n// This method returns all the pages at once.\n//\n// Parameters:\n//\t- `sortBy`\nExtendedUser, err := client.User.ListExtendedAllPages(sortBy)", "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#UserService.ListExtended" } } @@ -3379,7 +5662,7 @@ "style": "form" }, { - "description": "Token returned by previous call to retreive the subsequent page", + "description": "Token returned by previous call to retrieve the subsequent page", "in": "query", "name": "page_token", "schema": { @@ -3455,7 +5738,7 @@ ], "x-dropshot-pagination": true, "x-go": { - "example": "// ListForUser: List API calls for a user.\n//\n// This endpoint requires authentication by any KittyCAD user. It returns the API calls for the authenticated user if \"me\" is passed as the user id.\n// Alternatively, you can use the `/user/api-calls` endpoint to get the API calls for your user.\n// If the authenticated user is a KittyCAD employee, then the API calls are returned for the user specified by the user id.\n// The API calls are returned in order of creation, with the most recently created API calls first.\n//\n// To iterate over all pages, use the `ListForUserAllPages` method, instead.\n//\n// Parameters:\n//\t- `id`: The user ID.\n//\t- `limit`: Maximum number of items returned by a single call\n//\t- `pageToken`: Token returned by previous call to retreive the subsequent page\n//\t- `sortBy`\naPICallWithPriceResultsPage, err := client.APICall.ListForUser(id, limit, pageToken, sortBy)\n\n// - OR -\n\n// ListForUserAllPages: List API calls for a user.\n//\n// This endpoint requires authentication by any KittyCAD user. It returns the API calls for the authenticated user if \"me\" is passed as the user id.\n// Alternatively, you can use the `/user/api-calls` endpoint to get the API calls for your user.\n// If the authenticated user is a KittyCAD employee, then the API calls are returned for the user specified by the user id.\n// The API calls are returned in order of creation, with the most recently created API calls first.\n//\n// This method is a wrapper around the `ListForUser` method.\n// This method returns all the pages at once.\n//\n// Parameters:\n//\t- `id`: The user ID.\n//\t- `sortBy`\nAPICallWithPrice, err := client.APICall.ListForUserAllPages(id , sortBy)", + "example": "// ListForUser: List API calls for a user.\n//\n// This endpoint requires authentication by any KittyCAD user. It returns the API calls for the authenticated user if \"me\" is passed as the user id.\n// Alternatively, you can use the `/user/api-calls` endpoint to get the API calls for your user.\n// If the authenticated user is a KittyCAD employee, then the API calls are returned for the user specified by the user id.\n// The API calls are returned in order of creation, with the most recently created API calls first.\n//\n// To iterate over all pages, use the `ListForUserAllPages` method, instead.\n//\n// Parameters:\n//\t- `id`: The user ID.\n//\t- `limit`: Maximum number of items returned by a single call\n//\t- `pageToken`: Token returned by previous call to retrieve the subsequent page\n//\t- `sortBy`\naPICallWithPriceResultsPage, err := client.APICall.ListForUser(id, limit, pageToken, sortBy)\n\n// - OR -\n\n// ListForUserAllPages: List API calls for a user.\n//\n// This endpoint requires authentication by any KittyCAD user. It returns the API calls for the authenticated user if \"me\" is passed as the user id.\n// Alternatively, you can use the `/user/api-calls` endpoint to get the API calls for your user.\n// If the authenticated user is a KittyCAD employee, then the API calls are returned for the user specified by the user id.\n// The API calls are returned in order of creation, with the most recently created API calls first.\n//\n// This method is a wrapper around the `ListForUser` method.\n// This method returns all the pages at once.\n//\n// Parameters:\n//\t- `id`: The user ID.\n//\t- `sortBy`\nAPICallWithPrice, err := client.APICall.ListForUserAllPages(id , sortBy)", "libDocsLink": "https://pkg.go.dev/github.com/kittycad/kittycad.go/#APICallService.ListForUser" } } @@ -3476,6 +5759,13 @@ }, "name": "api-tokens" }, + { + "description": "Beta API endpoints. We will not charge for these endpoints while they are in beta.", + "externalDocs": { + "url": "https://docs.kittycad.io/api/beta" + }, + "name": "beta" + }, { "description": "CAD file operations. Create, get, and list CAD file conversions. More endpoints will be added here in the future as we build out transforms, etc on CAD models.", "externalDocs": { @@ -3483,6 +5773,13 @@ }, "name": "file" }, + { + "description": "Hidden API endpoints that should not show up in the docs.", + "externalDocs": { + "url": "https://docs.kittycad.io/api/hidden" + }, + "name": "hidden" + }, { "description": "Meta information about the API.", "externalDocs": { @@ -3490,6 +5787,13 @@ }, "name": "meta" }, + { + "description": "Operations around payments and billing.", + "externalDocs": { + "url": "https://docs.kittycad.io/api/payments" + }, + "name": "payments" + }, { "description": "Sessions allow users to call the API from their session cookie in the browser.", "externalDocs": { diff --git a/types.go b/types.go index d1a0863..5f3a2bc 100755 --- a/types.go +++ b/types.go @@ -2,6 +2,46 @@ package kittycad +// APICallStatus is the status of an async API call. +type APICallStatus string + +const ( + // APICallStatusQueued represents the APICallStatus `"Queued"`. + APICallStatusQueued APICallStatus = "Queued" + // APICallStatusUploaded represents the APICallStatus `"Uploaded"`. + APICallStatusUploaded APICallStatus = "Uploaded" + // APICallStatusInProgress represents the APICallStatus `"In Progress"`. + APICallStatusInProgress APICallStatus = "In Progress" + // APICallStatusCompleted represents the APICallStatus `"Completed"`. + APICallStatusCompleted APICallStatus = "Completed" + // APICallStatusFailed represents the APICallStatus `"Failed"`. + APICallStatusFailed APICallStatus = "Failed" +) + +// Address is an address. +type Address struct { + // City is the city component. + City string `json:"city,omitempty" yaml:"city,omitempty"` + // Country is the country component. + Country string `json:"country,omitempty" yaml:"country,omitempty"` + // CreatedAt is the time and date the address was created. + CreatedAt *JSONTime `json:"created_at,omitempty" yaml:"created_at,omitempty"` + // ID is the unique identifier of the address. + ID Uuid `json:"id,omitempty" yaml:"id,omitempty"` + // State is the state component. + State string `json:"state,omitempty" yaml:"state,omitempty"` + // Street1 is the first street component. + Street1 string `json:"street1,omitempty" yaml:"street1,omitempty"` + // Street2 is the second street component. + Street2 string `json:"street2,omitempty" yaml:"street2,omitempty"` + // UpdatedAt is the time and date the address was last updated. + UpdatedAt *JSONTime `json:"updated_at,omitempty" yaml:"updated_at,omitempty"` + // UserID is the user ID that this address belongs to. + UserID string `json:"user_id,omitempty" yaml:"user_id,omitempty"` + // Zip is the zip component. + Zip string `json:"zip,omitempty" yaml:"zip,omitempty"` +} + // APICallQueryGroup is a response for a query on the API call table that is grouped by something. type APICallQueryGroup struct { Count int `json:"count,omitempty" yaml:"count,omitempty"` @@ -108,6 +148,168 @@ type APITokenResultsPage struct { NextPage string `json:"next_page,omitempty" yaml:"next_page,omitempty"` } +// AsyncAPICallOutputFileConversion is a file conversion. +type AsyncAPICallOutputFileConversion struct { + // CompletedAt is the time and date the file conversion was completed. + CompletedAt *JSONTime `json:"completed_at,omitempty" yaml:"completed_at,omitempty"` + // CreatedAt is the time and date the file conversion was created. + CreatedAt *JSONTime `json:"created_at,omitempty" yaml:"created_at,omitempty"` + // ID is the unique identifier of the file conversion. + // + // This is the same as the API call ID. + ID Uuid `json:"id,omitempty" yaml:"id,omitempty"` + // Output is the converted file, if completed, base64 encoded. If the conversion failed, this field will show any errors. + Output string `json:"output,omitempty" yaml:"output,omitempty"` + // OutputFormat is the output format of the file conversion. + OutputFormat FileOutputFormat `json:"output_format,omitempty" yaml:"output_format,omitempty"` + // SrcFormat is the source format of the file conversion. + SrcFormat FileSourceFormat `json:"src_format,omitempty" yaml:"src_format,omitempty"` + // StartedAt is the time and date the file conversion was started. + StartedAt *JSONTime `json:"started_at,omitempty" yaml:"started_at,omitempty"` + // Status is the status of the file conversion. + Status APICallStatus `json:"status,omitempty" yaml:"status,omitempty"` + Type AsyncAPICallOutputType `json:"type,omitempty" yaml:"type,omitempty"` + // UpdatedAt is the time and date the file conversion was last updated. + UpdatedAt *JSONTime `json:"updated_at,omitempty" yaml:"updated_at,omitempty"` + // UserID is the user ID of the user who created the file conversion. + UserID string `json:"user_id,omitempty" yaml:"user_id,omitempty"` +} + +// AsyncAPICallOutputType is the type definition for a AsyncAPICallOutputType. +type AsyncAPICallOutputType string + +const ( + // AsyncAPICallOutputTypeFileConversion represents the AsyncAPICallOutputType `"FileConversion"`. + AsyncAPICallOutputTypeFileConversion AsyncAPICallOutputType = "FileConversion" +) + +// AsyncAPICallOutputFileMass is a file mass. +type AsyncAPICallOutputFileMass struct { + // CompletedAt is the time and date the mass was completed. + CompletedAt *JSONTime `json:"completed_at,omitempty" yaml:"completed_at,omitempty"` + // CreatedAt is the time and date the mass was created. + CreatedAt *JSONTime `json:"created_at,omitempty" yaml:"created_at,omitempty"` + // Error is the error the function returned, if any. + Error string `json:"error,omitempty" yaml:"error,omitempty"` + // ID is the unique identifier of the mass request. + // + // This is the same as the API call ID. + ID Uuid `json:"id,omitempty" yaml:"id,omitempty"` + // Mass is the resulting mass. + Mass float64 `json:"mass,omitempty" yaml:"mass,omitempty"` + // MaterialDensity is the material density as denoted by the user. + MaterialDensity float64 `json:"material_density,omitempty" yaml:"material_density,omitempty"` + // SrcFormat is the source format of the file. + SrcFormat FileSourceFormat `json:"src_format,omitempty" yaml:"src_format,omitempty"` + // StartedAt is the time and date the mass was started. + StartedAt *JSONTime `json:"started_at,omitempty" yaml:"started_at,omitempty"` + // Status is the status of the mass. + Status APICallStatus `json:"status,omitempty" yaml:"status,omitempty"` + Type AsyncAPICallOutputType `json:"type,omitempty" yaml:"type,omitempty"` + // UpdatedAt is the time and date the mass was last updated. + UpdatedAt *JSONTime `json:"updated_at,omitempty" yaml:"updated_at,omitempty"` + // UserID is the user ID of the user who created the mass. + UserID string `json:"user_id,omitempty" yaml:"user_id,omitempty"` +} + +const ( + // AsyncAPICallOutputTypeFileMass represents the AsyncAPICallOutputType `"FileMass"`. + AsyncAPICallOutputTypeFileMass AsyncAPICallOutputType = "FileMass" +) + +// AsyncAPICallOutputFileVolume is a file volume. +type AsyncAPICallOutputFileVolume struct { + // CompletedAt is the time and date the volume was completed. + CompletedAt *JSONTime `json:"completed_at,omitempty" yaml:"completed_at,omitempty"` + // CreatedAt is the time and date the volume was created. + CreatedAt *JSONTime `json:"created_at,omitempty" yaml:"created_at,omitempty"` + // Error is the error the function returned, if any. + Error string `json:"error,omitempty" yaml:"error,omitempty"` + // ID is the unique identifier of the volume request. + // + // This is the same as the API call ID. + ID Uuid `json:"id,omitempty" yaml:"id,omitempty"` + // SrcFormat is the source format of the file. + SrcFormat FileSourceFormat `json:"src_format,omitempty" yaml:"src_format,omitempty"` + // StartedAt is the time and date the volume was started. + StartedAt *JSONTime `json:"started_at,omitempty" yaml:"started_at,omitempty"` + // Status is the status of the volume. + Status APICallStatus `json:"status,omitempty" yaml:"status,omitempty"` + Type AsyncAPICallOutputType `json:"type,omitempty" yaml:"type,omitempty"` + // UpdatedAt is the time and date the volume was last updated. + UpdatedAt *JSONTime `json:"updated_at,omitempty" yaml:"updated_at,omitempty"` + // UserID is the user ID of the user who created the volume. + UserID string `json:"user_id,omitempty" yaml:"user_id,omitempty"` + // Volume is the resulting volume. + Volume float64 `json:"volume,omitempty" yaml:"volume,omitempty"` +} + +const ( + // AsyncAPICallOutputTypeFileVolume represents the AsyncAPICallOutputType `"FileVolume"`. + AsyncAPICallOutputTypeFileVolume AsyncAPICallOutputType = "FileVolume" +) + +// AsyncAPICallOutput is the output from the async API call. +type AsyncAPICallOutput struct { + CompletedAt *JSONTime `json:"completed_at,omitempty" yaml:"completed_at,omitempty"` + CreatedAt *JSONTime `json:"created_at,omitempty" yaml:"created_at,omitempty"` + ID Uuid `json:"id,omitempty" yaml:"id,omitempty"` + Output string `json:"output,omitempty" yaml:"output,omitempty"` + OutputFormat FileOutputFormat `json:"output_format,omitempty" yaml:"output_format,omitempty"` + SrcFormat FileSourceFormat `json:"src_format,omitempty" yaml:"src_format,omitempty"` + StartedAt *JSONTime `json:"started_at,omitempty" yaml:"started_at,omitempty"` + Status APICallStatus `json:"status,omitempty" yaml:"status,omitempty"` + Type string `json:"type,omitempty" yaml:"type,omitempty"` + UpdatedAt *JSONTime `json:"updated_at,omitempty" yaml:"updated_at,omitempty"` + UserID string `json:"user_id,omitempty" yaml:"user_id,omitempty"` + Error string `json:"error,omitempty" yaml:"error,omitempty"` + Mass float64 `json:"mass,omitempty" yaml:"mass,omitempty"` + MaterialDensity float64 `json:"material_density,omitempty" yaml:"material_density,omitempty"` + Volume float64 `json:"volume,omitempty" yaml:"volume,omitempty"` +} + +// BillingInfo is the billing information for payments. +type BillingInfo struct { + // Address is the address of the customer. + Address Address `json:"address,omitempty" yaml:"address,omitempty"` + // Name is the name of the customer. + Name string `json:"name,omitempty" yaml:"name,omitempty"` + // Phone is the phone for the customer. + Phone string `json:"phone,omitempty" yaml:"phone,omitempty"` +} + +// CacheMetadata is metadata about our cache. +// +// This is mostly used for internal purposes and debugging. +type CacheMetadata struct { + // Ok is if the cache returned an ok response from ping. + Ok bool `json:"ok,omitempty" yaml:"ok,omitempty"` +} + +// CardDetails is the card details of a payment method. +type CardDetails struct { + // Brand is card brand. + // + // Can be `amex`, `diners`, `discover`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + Brand string `json:"brand,omitempty" yaml:"brand,omitempty"` + // Checks is checks on Card address and CVC if provided. + Checks PaymentMethodCardChecks `json:"checks,omitempty" yaml:"checks,omitempty"` + // Country is two-letter ISO code representing the country of the card. + Country string `json:"country,omitempty" yaml:"country,omitempty"` + // ExpMonth is two-digit number representing the card's expiration month. + ExpMonth int `json:"exp_month,omitempty" yaml:"exp_month,omitempty"` + // ExpYear is four-digit number representing the card's expiration year. + ExpYear int `json:"exp_year,omitempty" yaml:"exp_year,omitempty"` + // Fingerprint is uniquely identifies this particular card number. + Fingerprint string `json:"fingerprint,omitempty" yaml:"fingerprint,omitempty"` + // Funding is card funding type. + // + // Can be `credit`, `debit`, `prepaid`, or `unknown`. + Funding string `json:"funding,omitempty" yaml:"funding,omitempty"` + // Last4 is the last four digits of the card. + Last4 string `json:"last4,omitempty" yaml:"last4,omitempty"` +} + // Cluster is cluster information. type Cluster struct { // Addr is the IP address of the cluster. @@ -124,6 +326,134 @@ type Cluster struct { Urls []string `json:"urls,omitempty" yaml:"urls,omitempty"` } +// CodeLanguage is the language code is written in. +type CodeLanguage string + +const ( + // CodeLanguageGo represents the CodeLanguage `"go"`. + CodeLanguageGo CodeLanguage = "go" + // CodeLanguageRust represents the CodeLanguage `"rust"`. + CodeLanguageRust CodeLanguage = "rust" + // CodeLanguagePython represents the CodeLanguage `"python"`. + CodeLanguagePython CodeLanguage = "python" + // CodeLanguageNode represents the CodeLanguage `"node"`. + CodeLanguageNode CodeLanguage = "node" +) + +// CodeOutput is output of the code being executed. +type CodeOutput struct { + // Output is the contents of the output file if it was passed. This is base64 encoded so we can ensure it is UTF-8 for JSON. + Output string `json:"output,omitempty" yaml:"output,omitempty"` + // Stderr is the stderr of the code. + Stderr string `json:"stderr,omitempty" yaml:"stderr,omitempty"` + // Stdout is the stdout of the code. + Stdout string `json:"stdout,omitempty" yaml:"stdout,omitempty"` +} + +// Connection is metadata about a pub-sub connection. +// +// This is mostly used for internal purposes and debugging. +type Connection struct { + // AuthTimeout is the auth timeout of the server. + AuthTimeout int `json:"auth_timeout,omitempty" yaml:"auth_timeout,omitempty"` + // Cluster is information about the cluster. + Cluster Cluster `json:"cluster,omitempty" yaml:"cluster,omitempty"` + // ConfigLoadTime is the time the configuration was loaded. + ConfigLoadTime *JSONTime `json:"config_load_time,omitempty" yaml:"config_load_time,omitempty"` + // Connections is the number of connections to the server. + Connections int `json:"connections,omitempty" yaml:"connections,omitempty"` + // Cores is the CPU core usage of the server. + Cores int `json:"cores,omitempty" yaml:"cores,omitempty"` + // Cpu is the CPU usage of the server. + Cpu float64 `json:"cpu,omitempty" yaml:"cpu,omitempty"` + // Gateway is information about the gateway. + Gateway Gateway `json:"gateway,omitempty" yaml:"gateway,omitempty"` + // GitCommit is the git commit. + GitCommit string `json:"git_commit,omitempty" yaml:"git_commit,omitempty"` + // Go is the go version. + Go string `json:"go,omitempty" yaml:"go,omitempty"` + // Gomaxprocs is `GOMAXPROCS` of the server. + Gomaxprocs int `json:"gomaxprocs,omitempty" yaml:"gomaxprocs,omitempty"` + // Host is the host of the server. + Host string `json:"host,omitempty" yaml:"host,omitempty"` + // HttpBasePath is the http base path of the server. + HttpBasePath string `json:"http_base_path,omitempty" yaml:"http_base_path,omitempty"` + // HttpHost is the http host of the server. + HttpHost string `json:"http_host,omitempty" yaml:"http_host,omitempty"` + // HttpPort is the http port of the server. + HttpPort int `json:"http_port,omitempty" yaml:"http_port,omitempty"` + // HttpReqStats is hTTP request statistics. + HttpReqStats int `json:"http_req_stats,omitempty" yaml:"http_req_stats,omitempty"` + // HttpsPort is the https port of the server. + HttpsPort int `json:"https_port,omitempty" yaml:"https_port,omitempty"` + // ID is the ID as known by the most recently connected server. + ID int `json:"id,omitempty" yaml:"id,omitempty"` + // InBytes is the count of inbound bytes for the server. + InBytes int `json:"in_bytes,omitempty" yaml:"in_bytes,omitempty"` + // InMsgs is the number of inbound messages for the server. + InMsgs int `json:"in_msgs,omitempty" yaml:"in_msgs,omitempty"` + // Ip is the client IP as known by the most recently connected server. + Ip string `json:"ip,omitempty" yaml:"ip,omitempty"` + // Jetstream is jetstream information. + Jetstream Jetstream `json:"jetstream,omitempty" yaml:"jetstream,omitempty"` + // Leaf is information about leaf nodes. + Leaf LeafNode `json:"leaf,omitempty" yaml:"leaf,omitempty"` + // Leafnodes is the number of leaf nodes for the server. + Leafnodes int `json:"leafnodes,omitempty" yaml:"leafnodes,omitempty"` + // MaxConnections is the max connections of the server. + MaxConnections int `json:"max_connections,omitempty" yaml:"max_connections,omitempty"` + // MaxControlLine is the max control line of the server. + MaxControlLine int `json:"max_control_line,omitempty" yaml:"max_control_line,omitempty"` + // MaxPayload is the max payload of the server. + MaxPayload int `json:"max_payload,omitempty" yaml:"max_payload,omitempty"` + // MaxPending is the max pending of the server. + MaxPending int `json:"max_pending,omitempty" yaml:"max_pending,omitempty"` + // Mem is the memory usage of the server. + Mem int `json:"mem,omitempty" yaml:"mem,omitempty"` + // Now is the time now. + Now *JSONTime `json:"now,omitempty" yaml:"now,omitempty"` + // OutBytes is the count of outbound bytes for the server. + OutBytes int `json:"out_bytes,omitempty" yaml:"out_bytes,omitempty"` + // OutMsgs is the number of outbound messages for the server. + OutMsgs int `json:"out_msgs,omitempty" yaml:"out_msgs,omitempty"` + // PingInterval is the ping interval of the server. + PingInterval int `json:"ping_interval,omitempty" yaml:"ping_interval,omitempty"` + // PingMax is the ping max of the server. + PingMax int `json:"ping_max,omitempty" yaml:"ping_max,omitempty"` + // Port is the port of the server. + Port int `json:"port,omitempty" yaml:"port,omitempty"` + // Proto is the protocol version. + Proto int `json:"proto,omitempty" yaml:"proto,omitempty"` + // Remotes is the number of remotes for the server. + Remotes int `json:"remotes,omitempty" yaml:"remotes,omitempty"` + // Routes is the number of routes for the server. + Routes int `json:"routes,omitempty" yaml:"routes,omitempty"` + // Rtt is the round trip time between this client and the server. + Rtt Duration `json:"rtt,omitempty" yaml:"rtt,omitempty"` + // ServerID is the server ID. + ServerID string `json:"server_id,omitempty" yaml:"server_id,omitempty"` + // ServerName is the server name. + ServerName string `json:"server_name,omitempty" yaml:"server_name,omitempty"` + // SlowConsumers is the number of slow consumers for the server. + SlowConsumers int `json:"slow_consumers,omitempty" yaml:"slow_consumers,omitempty"` + // Start is when the server was started. + Start *JSONTime `json:"start,omitempty" yaml:"start,omitempty"` + // Subscriptions is the number of subscriptions for the server. + Subscriptions int `json:"subscriptions,omitempty" yaml:"subscriptions,omitempty"` + // SystemAccount is the system account. + SystemAccount string `json:"system_account,omitempty" yaml:"system_account,omitempty"` + // TlsTimeout is the TLS timeout of the server. + TlsTimeout int `json:"tls_timeout,omitempty" yaml:"tls_timeout,omitempty"` + // TotalConnections is the total number of connections to the server. + TotalConnections int `json:"total_connections,omitempty" yaml:"total_connections,omitempty"` + // Uptime is the uptime of the server. + Uptime string `json:"uptime,omitempty" yaml:"uptime,omitempty"` + // Version is the version of the service. + Version string `json:"version,omitempty" yaml:"version,omitempty"` + // WriteDeadline is the write deadline of the server. + WriteDeadline int `json:"write_deadline,omitempty" yaml:"write_deadline,omitempty"` +} + // CreatedAtSortMode is supported set of sort modes for scanning by created_at only. // // Currently, we only support scanning in ascending order. @@ -136,6 +466,320 @@ const ( CreatedAtSortModeCreatedAtDescending CreatedAtSortMode = "created-at-descending" ) +// Currency is currency is the list of supported currencies. +// +// For more details see . +type Currency string + +const ( + // CurrencyAed represents the Currency `"aed"`. + CurrencyAed Currency = "aed" + // CurrencyAfn represents the Currency `"afn"`. + CurrencyAfn Currency = "afn" + // CurrencyAll represents the Currency `"all"`. + CurrencyAll Currency = "all" + // CurrencyAmd represents the Currency `"amd"`. + CurrencyAmd Currency = "amd" + // CurrencyAng represents the Currency `"ang"`. + CurrencyAng Currency = "ang" + // CurrencyAoa represents the Currency `"aoa"`. + CurrencyAoa Currency = "aoa" + // CurrencyArs represents the Currency `"ars"`. + CurrencyArs Currency = "ars" + // CurrencyAud represents the Currency `"aud"`. + CurrencyAud Currency = "aud" + // CurrencyAwg represents the Currency `"awg"`. + CurrencyAwg Currency = "awg" + // CurrencyAzn represents the Currency `"azn"`. + CurrencyAzn Currency = "azn" + // CurrencyBam represents the Currency `"bam"`. + CurrencyBam Currency = "bam" + // CurrencyBbd represents the Currency `"bbd"`. + CurrencyBbd Currency = "bbd" + // CurrencyBdt represents the Currency `"bdt"`. + CurrencyBdt Currency = "bdt" + // CurrencyBgn represents the Currency `"bgn"`. + CurrencyBgn Currency = "bgn" + // CurrencyBif represents the Currency `"bif"`. + CurrencyBif Currency = "bif" + // CurrencyBmd represents the Currency `"bmd"`. + CurrencyBmd Currency = "bmd" + // CurrencyBnd represents the Currency `"bnd"`. + CurrencyBnd Currency = "bnd" + // CurrencyBob represents the Currency `"bob"`. + CurrencyBob Currency = "bob" + // CurrencyBrl represents the Currency `"brl"`. + CurrencyBrl Currency = "brl" + // CurrencyBsd represents the Currency `"bsd"`. + CurrencyBsd Currency = "bsd" + // CurrencyBwp represents the Currency `"bwp"`. + CurrencyBwp Currency = "bwp" + // CurrencyBzd represents the Currency `"bzd"`. + CurrencyBzd Currency = "bzd" + // CurrencyCad represents the Currency `"cad"`. + CurrencyCad Currency = "cad" + // CurrencyCdf represents the Currency `"cdf"`. + CurrencyCdf Currency = "cdf" + // CurrencyChf represents the Currency `"chf"`. + CurrencyChf Currency = "chf" + // CurrencyClp represents the Currency `"clp"`. + CurrencyClp Currency = "clp" + // CurrencyCny represents the Currency `"cny"`. + CurrencyCny Currency = "cny" + // CurrencyCop represents the Currency `"cop"`. + CurrencyCop Currency = "cop" + // CurrencyCrc represents the Currency `"crc"`. + CurrencyCrc Currency = "crc" + // CurrencyCve represents the Currency `"cve"`. + CurrencyCve Currency = "cve" + // CurrencyCzk represents the Currency `"czk"`. + CurrencyCzk Currency = "czk" + // CurrencyDjf represents the Currency `"djf"`. + CurrencyDjf Currency = "djf" + // CurrencyDkk represents the Currency `"dkk"`. + CurrencyDkk Currency = "dkk" + // CurrencyDop represents the Currency `"dop"`. + CurrencyDop Currency = "dop" + // CurrencyDzd represents the Currency `"dzd"`. + CurrencyDzd Currency = "dzd" + // CurrencyEek represents the Currency `"eek"`. + CurrencyEek Currency = "eek" + // CurrencyEgp represents the Currency `"egp"`. + CurrencyEgp Currency = "egp" + // CurrencyEtb represents the Currency `"etb"`. + CurrencyEtb Currency = "etb" + // CurrencyEur represents the Currency `"eur"`. + CurrencyEur Currency = "eur" + // CurrencyFjd represents the Currency `"fjd"`. + CurrencyFjd Currency = "fjd" + // CurrencyFkp represents the Currency `"fkp"`. + CurrencyFkp Currency = "fkp" + // CurrencyGbp represents the Currency `"gbp"`. + CurrencyGbp Currency = "gbp" + // CurrencyGel represents the Currency `"gel"`. + CurrencyGel Currency = "gel" + // CurrencyGip represents the Currency `"gip"`. + CurrencyGip Currency = "gip" + // CurrencyGmd represents the Currency `"gmd"`. + CurrencyGmd Currency = "gmd" + // CurrencyGnf represents the Currency `"gnf"`. + CurrencyGnf Currency = "gnf" + // CurrencyGtq represents the Currency `"gtq"`. + CurrencyGtq Currency = "gtq" + // CurrencyGyd represents the Currency `"gyd"`. + CurrencyGyd Currency = "gyd" + // CurrencyHkd represents the Currency `"hkd"`. + CurrencyHkd Currency = "hkd" + // CurrencyHnl represents the Currency `"hnl"`. + CurrencyHnl Currency = "hnl" + // CurrencyHrk represents the Currency `"hrk"`. + CurrencyHrk Currency = "hrk" + // CurrencyHtg represents the Currency `"htg"`. + CurrencyHtg Currency = "htg" + // CurrencyHuf represents the Currency `"huf"`. + CurrencyHuf Currency = "huf" + // CurrencyIdr represents the Currency `"idr"`. + CurrencyIdr Currency = "idr" + // CurrencyIls represents the Currency `"ils"`. + CurrencyIls Currency = "ils" + // CurrencyInr represents the Currency `"inr"`. + CurrencyInr Currency = "inr" + // CurrencyIsk represents the Currency `"isk"`. + CurrencyIsk Currency = "isk" + // CurrencyJmd represents the Currency `"jmd"`. + CurrencyJmd Currency = "jmd" + // CurrencyJpy represents the Currency `"jpy"`. + CurrencyJpy Currency = "jpy" + // CurrencyKes represents the Currency `"kes"`. + CurrencyKes Currency = "kes" + // CurrencyKgs represents the Currency `"kgs"`. + CurrencyKgs Currency = "kgs" + // CurrencyKhr represents the Currency `"khr"`. + CurrencyKhr Currency = "khr" + // CurrencyKmf represents the Currency `"kmf"`. + CurrencyKmf Currency = "kmf" + // CurrencyKrw represents the Currency `"krw"`. + CurrencyKrw Currency = "krw" + // CurrencyKyd represents the Currency `"kyd"`. + CurrencyKyd Currency = "kyd" + // CurrencyKzt represents the Currency `"kzt"`. + CurrencyKzt Currency = "kzt" + // CurrencyLak represents the Currency `"lak"`. + CurrencyLak Currency = "lak" + // CurrencyLbp represents the Currency `"lbp"`. + CurrencyLbp Currency = "lbp" + // CurrencyLkr represents the Currency `"lkr"`. + CurrencyLkr Currency = "lkr" + // CurrencyLrd represents the Currency `"lrd"`. + CurrencyLrd Currency = "lrd" + // CurrencyLsl represents the Currency `"lsl"`. + CurrencyLsl Currency = "lsl" + // CurrencyLtl represents the Currency `"ltl"`. + CurrencyLtl Currency = "ltl" + // CurrencyLvl represents the Currency `"lvl"`. + CurrencyLvl Currency = "lvl" + // CurrencyMad represents the Currency `"mad"`. + CurrencyMad Currency = "mad" + // CurrencyMdl represents the Currency `"mdl"`. + CurrencyMdl Currency = "mdl" + // CurrencyMga represents the Currency `"mga"`. + CurrencyMga Currency = "mga" + // CurrencyMkd represents the Currency `"mkd"`. + CurrencyMkd Currency = "mkd" + // CurrencyMnt represents the Currency `"mnt"`. + CurrencyMnt Currency = "mnt" + // CurrencyMop represents the Currency `"mop"`. + CurrencyMop Currency = "mop" + // CurrencyMro represents the Currency `"mro"`. + CurrencyMro Currency = "mro" + // CurrencyMur represents the Currency `"mur"`. + CurrencyMur Currency = "mur" + // CurrencyMvr represents the Currency `"mvr"`. + CurrencyMvr Currency = "mvr" + // CurrencyMwk represents the Currency `"mwk"`. + CurrencyMwk Currency = "mwk" + // CurrencyMxn represents the Currency `"mxn"`. + CurrencyMxn Currency = "mxn" + // CurrencyMyr represents the Currency `"myr"`. + CurrencyMyr Currency = "myr" + // CurrencyMzn represents the Currency `"mzn"`. + CurrencyMzn Currency = "mzn" + // CurrencyNad represents the Currency `"nad"`. + CurrencyNad Currency = "nad" + // CurrencyNgn represents the Currency `"ngn"`. + CurrencyNgn Currency = "ngn" + // CurrencyNio represents the Currency `"nio"`. + CurrencyNio Currency = "nio" + // CurrencyNok represents the Currency `"nok"`. + CurrencyNok Currency = "nok" + // CurrencyNpr represents the Currency `"npr"`. + CurrencyNpr Currency = "npr" + // CurrencyNzd represents the Currency `"nzd"`. + CurrencyNzd Currency = "nzd" + // CurrencyPab represents the Currency `"pab"`. + CurrencyPab Currency = "pab" + // CurrencyPen represents the Currency `"pen"`. + CurrencyPen Currency = "pen" + // CurrencyPgk represents the Currency `"pgk"`. + CurrencyPgk Currency = "pgk" + // CurrencyPhp represents the Currency `"php"`. + CurrencyPhp Currency = "php" + // CurrencyPkr represents the Currency `"pkr"`. + CurrencyPkr Currency = "pkr" + // CurrencyPln represents the Currency `"pln"`. + CurrencyPln Currency = "pln" + // CurrencyPyg represents the Currency `"pyg"`. + CurrencyPyg Currency = "pyg" + // CurrencyQar represents the Currency `"qar"`. + CurrencyQar Currency = "qar" + // CurrencyRon represents the Currency `"ron"`. + CurrencyRon Currency = "ron" + // CurrencyRsd represents the Currency `"rsd"`. + CurrencyRsd Currency = "rsd" + // CurrencyRub represents the Currency `"rub"`. + CurrencyRub Currency = "rub" + // CurrencyRwf represents the Currency `"rwf"`. + CurrencyRwf Currency = "rwf" + // CurrencySar represents the Currency `"sar"`. + CurrencySar Currency = "sar" + // CurrencySbd represents the Currency `"sbd"`. + CurrencySbd Currency = "sbd" + // CurrencyScr represents the Currency `"scr"`. + CurrencyScr Currency = "scr" + // CurrencySek represents the Currency `"sek"`. + CurrencySek Currency = "sek" + // CurrencySgd represents the Currency `"sgd"`. + CurrencySgd Currency = "sgd" + // CurrencyShp represents the Currency `"shp"`. + CurrencyShp Currency = "shp" + // CurrencySll represents the Currency `"sll"`. + CurrencySll Currency = "sll" + // CurrencySos represents the Currency `"sos"`. + CurrencySos Currency = "sos" + // CurrencySrd represents the Currency `"srd"`. + CurrencySrd Currency = "srd" + // CurrencyStd represents the Currency `"std"`. + CurrencyStd Currency = "std" + // CurrencySvc represents the Currency `"svc"`. + CurrencySvc Currency = "svc" + // CurrencySzl represents the Currency `"szl"`. + CurrencySzl Currency = "szl" + // CurrencyThb represents the Currency `"thb"`. + CurrencyThb Currency = "thb" + // CurrencyTjs represents the Currency `"tjs"`. + CurrencyTjs Currency = "tjs" + // CurrencyTop represents the Currency `"top"`. + CurrencyTop Currency = "top" + // CurrencyTry represents the Currency `"try"`. + CurrencyTry Currency = "try" + // CurrencyTtd represents the Currency `"ttd"`. + CurrencyTtd Currency = "ttd" + // CurrencyTwd represents the Currency `"twd"`. + CurrencyTwd Currency = "twd" + // CurrencyTzs represents the Currency `"tzs"`. + CurrencyTzs Currency = "tzs" + // CurrencyUah represents the Currency `"uah"`. + CurrencyUah Currency = "uah" + // CurrencyUgx represents the Currency `"ugx"`. + CurrencyUgx Currency = "ugx" + // CurrencyUsd represents the Currency `"usd"`. + CurrencyUsd Currency = "usd" + // CurrencyUyu represents the Currency `"uyu"`. + CurrencyUyu Currency = "uyu" + // CurrencyUzs represents the Currency `"uzs"`. + CurrencyUzs Currency = "uzs" + // CurrencyVef represents the Currency `"vef"`. + CurrencyVef Currency = "vef" + // CurrencyVnd represents the Currency `"vnd"`. + CurrencyVnd Currency = "vnd" + // CurrencyVuv represents the Currency `"vuv"`. + CurrencyVuv Currency = "vuv" + // CurrencyWst represents the Currency `"wst"`. + CurrencyWst Currency = "wst" + // CurrencyXaf represents the Currency `"xaf"`. + CurrencyXaf Currency = "xaf" + // CurrencyXcd represents the Currency `"xcd"`. + CurrencyXcd Currency = "xcd" + // CurrencyXof represents the Currency `"xof"`. + CurrencyXof Currency = "xof" + // CurrencyXpf represents the Currency `"xpf"`. + CurrencyXpf Currency = "xpf" + // CurrencyYer represents the Currency `"yer"`. + CurrencyYer Currency = "yer" + // CurrencyZar represents the Currency `"zar"`. + CurrencyZar Currency = "zar" + // CurrencyZmw represents the Currency `"zmw"`. + CurrencyZmw Currency = "zmw" +) + +// Customer is the resource representing a payment "Customer". +type Customer struct { + // Address is the customer's address. + Address Address `json:"address,omitempty" yaml:"address,omitempty"` + // Balance is current balance, if any, being stored on the customer. + // + // If negative, the customer has credit to apply to their next invoice. If positive, the customer has an amount owed that will be added to their next invoice. The balance does not refer to any unpaid invoices; it solely takes into account amounts that have yet to be successfully applied to any invoice. This balance is only taken into account as invoices are finalized. + Balance int `json:"balance,omitempty" yaml:"balance,omitempty"` + // CreatedAt is time at which the object was created. + CreatedAt *JSONTime `json:"created_at,omitempty" yaml:"created_at,omitempty"` + // Currency is three-letter ISO code for the currency the customer can be charged in for recurring billing purposes. + Currency Currency `json:"currency,omitempty" yaml:"currency,omitempty"` + // Delinquent is when the customer's latest invoice is billed by charging automatically, `delinquent` is `true` if the invoice's latest charge failed. + // + // When the customer's latest invoice is billed by sending an invoice, `delinquent` is `true` if the invoice isn't paid by its due date. If an invoice is marked uncollectible by dunning, `delinquent` doesn't get reset to `false`. + Delinquent bool `json:"delinquent,omitempty" yaml:"delinquent,omitempty"` + // Email is the customer's email address. + Email string `json:"email,omitempty" yaml:"email,omitempty"` + // ID is unique identifier for the object. + ID string `json:"id,omitempty" yaml:"id,omitempty"` + // Metadata is set of key-value pairs. + Metadata string `json:"metadata,omitempty" yaml:"metadata,omitempty"` + // Name is the customer's full name or business name. + Name string `json:"name,omitempty" yaml:"name,omitempty"` + // Phone is the customer's phone number. + Phone string `json:"phone,omitempty" yaml:"phone,omitempty"` +} + // Duration is the type definition for a Duration. type Duration int @@ -149,10 +793,22 @@ type EngineMetadata struct { Fs FileSystemMetadata `json:"fs,omitempty" yaml:"fs,omitempty"` // GitHash is the git hash of the server. GitHash string `json:"git_hash,omitempty" yaml:"git_hash,omitempty"` - // Nats is metadata about our nats.io connection. - Nats NatsConnection `json:"nats,omitempty" yaml:"nats,omitempty"` + // Pubsub is metadata about our pub-sub connection. + Pubsub Connection `json:"pubsub,omitempty" yaml:"pubsub,omitempty"` } +// Environment is the environment the server is running in. +type Environment string + +const ( + // EnvironmentDEVELOPMENT represents the Environment `"DEVELOPMENT"`. + EnvironmentDEVELOPMENT Environment = "DEVELOPMENT" + // EnvironmentPREVIEW represents the Environment `"PREVIEW"`. + EnvironmentPREVIEW Environment = "PREVIEW" + // EnvironmentPRODUCTION represents the Environment `"PRODUCTION"`. + EnvironmentPRODUCTION Environment = "PRODUCTION" +) + // Error is error information from a response. type Error struct { ErrorCode string `json:"error_code,omitempty" yaml:"error_code,omitempty"` @@ -207,8 +863,6 @@ type ExtendedUserResultsPage struct { } // FileConversion is a file conversion. -// -// For now, in the database, we only store the file conversions if we performed it asynchronously. type FileConversion struct { // CompletedAt is the time and date the file conversion was completed. CompletedAt *JSONTime `json:"completed_at,omitempty" yaml:"completed_at,omitempty"` @@ -218,116 +872,116 @@ type FileConversion struct { // // This is the same as the API call ID. ID Uuid `json:"id,omitempty" yaml:"id,omitempty"` - // OutputFileLink is the link to the file conversion output in our blob storage. - OutputFileLink string `json:"output_file_link,omitempty" yaml:"output_file_link,omitempty"` + // Output is the converted file, if completed, base64 encoded. If the conversion failed, this field will show any errors. + Output string `json:"output,omitempty" yaml:"output,omitempty"` // OutputFormat is the output format of the file conversion. - OutputFormat FileConversionOutputFormat `json:"output_format,omitempty" yaml:"output_format,omitempty"` - // SrcFileLink is the link to the file conversion source in our blob storage. - SrcFileLink string `json:"src_file_link,omitempty" yaml:"src_file_link,omitempty"` + OutputFormat FileOutputFormat `json:"output_format,omitempty" yaml:"output_format,omitempty"` // SrcFormat is the source format of the file conversion. - SrcFormat FileConversionSourceFormat `json:"src_format,omitempty" yaml:"src_format,omitempty"` + SrcFormat FileSourceFormat `json:"src_format,omitempty" yaml:"src_format,omitempty"` // StartedAt is the time and date the file conversion was started. StartedAt *JSONTime `json:"started_at,omitempty" yaml:"started_at,omitempty"` // Status is the status of the file conversion. - Status FileConversionStatus `json:"status,omitempty" yaml:"status,omitempty"` + Status APICallStatus `json:"status,omitempty" yaml:"status,omitempty"` // UpdatedAt is the time and date the file conversion was last updated. UpdatedAt *JSONTime `json:"updated_at,omitempty" yaml:"updated_at,omitempty"` // UserID is the user ID of the user who created the file conversion. UserID string `json:"user_id,omitempty" yaml:"user_id,omitempty"` - // Worker is the worker node that is performing or performed the file conversion. - Worker string `json:"worker,omitempty" yaml:"worker,omitempty"` } -// FileConversionOutputFormat is the valid types of output file formats. -type FileConversionOutputFormat string - -const ( - // FileConversionOutputFormatStl represents the FileConversionOutputFormat `"stl"`. - FileConversionOutputFormatStl FileConversionOutputFormat = "stl" - // FileConversionOutputFormatObj represents the FileConversionOutputFormat `"obj"`. - FileConversionOutputFormatObj FileConversionOutputFormat = "obj" - // FileConversionOutputFormatDae represents the FileConversionOutputFormat `"dae"`. - FileConversionOutputFormatDae FileConversionOutputFormat = "dae" - // FileConversionOutputFormatStep represents the FileConversionOutputFormat `"step"`. - FileConversionOutputFormatStep FileConversionOutputFormat = "step" - // FileConversionOutputFormatFbx represents the FileConversionOutputFormat `"fbx"`. - FileConversionOutputFormatFbx FileConversionOutputFormat = "fbx" - // FileConversionOutputFormatFbxb represents the FileConversionOutputFormat `"fbxb"`. - FileConversionOutputFormatFbxb FileConversionOutputFormat = "fbxb" -) - -// FileConversionResultsPage is a single page of results -type FileConversionResultsPage struct { - // Items is list of items on this page of results - Items []FileConversion `json:"items,omitempty" yaml:"items,omitempty"` - // NextPage is token used to fetch the next page of results (if any) - NextPage string `json:"next_page,omitempty" yaml:"next_page,omitempty"` +// FileMass is a file mass result. +type FileMass struct { + // CompletedAt is the time and date the mass was completed. + CompletedAt *JSONTime `json:"completed_at,omitempty" yaml:"completed_at,omitempty"` + // CreatedAt is the time and date the mass was created. + CreatedAt *JSONTime `json:"created_at,omitempty" yaml:"created_at,omitempty"` + // Error is the error the function returned, if any. + Error string `json:"error,omitempty" yaml:"error,omitempty"` + // ID is the unique identifier of the mass request. + // + // This is the same as the API call ID. + ID Uuid `json:"id,omitempty" yaml:"id,omitempty"` + // Mass is the resulting mass. + Mass float64 `json:"mass,omitempty" yaml:"mass,omitempty"` + // MaterialDensity is the material density as denoted by the user. + MaterialDensity float64 `json:"material_density,omitempty" yaml:"material_density,omitempty"` + // SrcFormat is the source format of the file. + SrcFormat FileSourceFormat `json:"src_format,omitempty" yaml:"src_format,omitempty"` + // StartedAt is the time and date the mass was started. + StartedAt *JSONTime `json:"started_at,omitempty" yaml:"started_at,omitempty"` + // Status is the status of the mass. + Status APICallStatus `json:"status,omitempty" yaml:"status,omitempty"` + // UpdatedAt is the time and date the mass was last updated. + UpdatedAt *JSONTime `json:"updated_at,omitempty" yaml:"updated_at,omitempty"` + // UserID is the user ID of the user who created the mass. + UserID string `json:"user_id,omitempty" yaml:"user_id,omitempty"` } -// FileConversionSourceFormat is the valid types of source file formats. -type FileConversionSourceFormat string +// FileOutputFormat is the valid types of output file formats. +type FileOutputFormat string const ( - // FileConversionSourceFormatStl represents the FileConversionSourceFormat `"stl"`. - FileConversionSourceFormatStl FileConversionSourceFormat = "stl" - // FileConversionSourceFormatObj represents the FileConversionSourceFormat `"obj"`. - FileConversionSourceFormatObj FileConversionSourceFormat = "obj" - // FileConversionSourceFormatDae represents the FileConversionSourceFormat `"dae"`. - FileConversionSourceFormatDae FileConversionSourceFormat = "dae" - // FileConversionSourceFormatStep represents the FileConversionSourceFormat `"step"`. - FileConversionSourceFormatStep FileConversionSourceFormat = "step" - // FileConversionSourceFormatFbx represents the FileConversionSourceFormat `"fbx"`. - FileConversionSourceFormatFbx FileConversionSourceFormat = "fbx" + // FileOutputFormatStl represents the FileOutputFormat `"stl"`. + FileOutputFormatStl FileOutputFormat = "stl" + // FileOutputFormatObj represents the FileOutputFormat `"obj"`. + FileOutputFormatObj FileOutputFormat = "obj" + // FileOutputFormatDae represents the FileOutputFormat `"dae"`. + FileOutputFormatDae FileOutputFormat = "dae" + // FileOutputFormatStep represents the FileOutputFormat `"step"`. + FileOutputFormatStep FileOutputFormat = "step" + // FileOutputFormatFbx represents the FileOutputFormat `"fbx"`. + FileOutputFormatFbx FileOutputFormat = "fbx" + // FileOutputFormatFbxb represents the FileOutputFormat `"fbxb"`. + FileOutputFormatFbxb FileOutputFormat = "fbxb" ) -// FileConversionStatus is the status of a file conversion. -type FileConversionStatus string +// FileSourceFormat is the valid types of source file formats. +type FileSourceFormat string const ( - // FileConversionStatusQueued represents the FileConversionStatus `"Queued"`. - FileConversionStatusQueued FileConversionStatus = "Queued" - // FileConversionStatusUploaded represents the FileConversionStatus `"Uploaded"`. - FileConversionStatusUploaded FileConversionStatus = "Uploaded" - // FileConversionStatusInProgress represents the FileConversionStatus `"In Progress"`. - FileConversionStatusInProgress FileConversionStatus = "In Progress" - // FileConversionStatusCompleted represents the FileConversionStatus `"Completed"`. - FileConversionStatusCompleted FileConversionStatus = "Completed" - // FileConversionStatusFailed represents the FileConversionStatus `"Failed"`. - FileConversionStatusFailed FileConversionStatus = "Failed" + // FileSourceFormatStl represents the FileSourceFormat `"stl"`. + FileSourceFormatStl FileSourceFormat = "stl" + // FileSourceFormatObj represents the FileSourceFormat `"obj"`. + FileSourceFormatObj FileSourceFormat = "obj" + // FileSourceFormatDae represents the FileSourceFormat `"dae"`. + FileSourceFormatDae FileSourceFormat = "dae" + // FileSourceFormatStep represents the FileSourceFormat `"step"`. + FileSourceFormatStep FileSourceFormat = "step" + // FileSourceFormatFbx represents the FileSourceFormat `"fbx"`. + FileSourceFormatFbx FileSourceFormat = "fbx" ) -// FileConversionWithOutput is a file conversion as we ouput it to the user. -type FileConversionWithOutput struct { - // CompletedAt is the time and date the file conversion was completed. +// FileSystemMetadata is metadata about our file system. +// +// This is mostly used for internal purposes and debugging. +type FileSystemMetadata struct { + // Ok is if the file system passed a sanity check. + Ok bool `json:"ok,omitempty" yaml:"ok,omitempty"` +} + +// FileVolume is a file volume result. +type FileVolume struct { + // CompletedAt is the time and date the volume was completed. CompletedAt *JSONTime `json:"completed_at,omitempty" yaml:"completed_at,omitempty"` - // CreatedAt is the time and date the file conversion was created. + // CreatedAt is the time and date the volume was created. CreatedAt *JSONTime `json:"created_at,omitempty" yaml:"created_at,omitempty"` - // ID is the unique identifier of the file conversion. + // Error is the error the function returned, if any. + Error string `json:"error,omitempty" yaml:"error,omitempty"` + // ID is the unique identifier of the volume request. // // This is the same as the API call ID. ID Uuid `json:"id,omitempty" yaml:"id,omitempty"` - // Output is the converted file, if completed, base64 encoded. If the conversion failed, this field will show any errors. - Output string `json:"output,omitempty" yaml:"output,omitempty"` - // OutputFormat is the output format of the file conversion. - OutputFormat FileConversionOutputFormat `json:"output_format,omitempty" yaml:"output_format,omitempty"` - // SrcFormat is the source format of the file conversion. - SrcFormat FileConversionSourceFormat `json:"src_format,omitempty" yaml:"src_format,omitempty"` - // StartedAt is the time and date the file conversion was started. + // SrcFormat is the source format of the file. + SrcFormat FileSourceFormat `json:"src_format,omitempty" yaml:"src_format,omitempty"` + // StartedAt is the time and date the volume was started. StartedAt *JSONTime `json:"started_at,omitempty" yaml:"started_at,omitempty"` - // Status is the status of the file conversion. - Status FileConversionStatus `json:"status,omitempty" yaml:"status,omitempty"` - // UpdatedAt is the time and date the file conversion was last updated. + // Status is the status of the volume. + Status APICallStatus `json:"status,omitempty" yaml:"status,omitempty"` + // UpdatedAt is the time and date the volume was last updated. UpdatedAt *JSONTime `json:"updated_at,omitempty" yaml:"updated_at,omitempty"` - // UserID is the user ID of the user who created the file conversion. + // UserID is the user ID of the user who created the volume. UserID string `json:"user_id,omitempty" yaml:"user_id,omitempty"` -} - -// FileSystemMetadata is metadata about our file system. -// -// This is mostly used for internal purposes and debugging. -type FileSystemMetadata struct { - // Ok is if the file system passed a sanity check. - Ok bool `json:"ok,omitempty" yaml:"ok,omitempty"` + // Volume is the resulting volume. + Volume float64 `json:"volume,omitempty" yaml:"volume,omitempty"` } // Gateway is gateway information. @@ -344,6 +998,104 @@ type Gateway struct { TlsTimeout int `json:"tls_timeout,omitempty" yaml:"tls_timeout,omitempty"` } +// Invoice is an invoice. +type Invoice struct { + // AmountDue is final amount due at this time for this invoice. + // + // If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the `amount_due` may be 0. If there is a positive `starting_balance` for the invoice (the customer owes money), the `amount_due` will also take that into account. The charge that gets generated for the invoice will be for the amount specified in `amount_due`. + AmountDue int `json:"amount_due,omitempty" yaml:"amount_due,omitempty"` + // AmountPaid is the amount, in %s, that was paid. + AmountPaid int `json:"amount_paid,omitempty" yaml:"amount_paid,omitempty"` + // AmountRemaining is the amount remaining, in %s, that is due. + AmountRemaining int `json:"amount_remaining,omitempty" yaml:"amount_remaining,omitempty"` + // AttemptCount is number of payment attempts made for this invoice, from the perspective of the payment retry schedule. + // + // Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule. + AttemptCount int `json:"attempt_count,omitempty" yaml:"attempt_count,omitempty"` + // Attempted is whether an attempt has been made to pay the invoice. + // + // An invoice is not attempted until 1 hour after the `invoice.created` webhook, for example, so you might not want to display that invoice as unpaid to your users. + Attempted bool `json:"attempted,omitempty" yaml:"attempted,omitempty"` + // CreatedAt is time at which the object was created. + CreatedAt *JSONTime `json:"created_at,omitempty" yaml:"created_at,omitempty"` + // Currency is three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + Currency Currency `json:"currency,omitempty" yaml:"currency,omitempty"` + // Description is description of the invoice. + Description string `json:"description,omitempty" yaml:"description,omitempty"` + // ID is unique identifier for the object. + ID string `json:"id,omitempty" yaml:"id,omitempty"` + // InvoicePdf is the link to download the PDF for the invoice. + InvoicePdf string `json:"invoice_pdf,omitempty" yaml:"invoice_pdf,omitempty"` + // InvoiceUrl is the URL for the hosted invoice page, which allows customers to view and pay an invoice. + InvoiceUrl string `json:"invoice_url,omitempty" yaml:"invoice_url,omitempty"` + // Lines is the individual line items that make up the invoice. + // + // `lines` is sorted as follows: invoice items in reverse chronological order, followed by the subscription, if any. + Lines []InvoiceLineItem `json:"lines,omitempty" yaml:"lines,omitempty"` + // Metadata is set of key-value pairs. + Metadata string `json:"metadata,omitempty" yaml:"metadata,omitempty"` + // Number is a unique, identifying string that appears on emails sent to the customer for this invoice. + Number string `json:"number,omitempty" yaml:"number,omitempty"` + // Paid is whether payment was successfully collected for this invoice. + // + // An invoice can be paid (most commonly) with a charge or with credit from the customer's account balance. + Paid bool `json:"paid,omitempty" yaml:"paid,omitempty"` + // ReceiptNumber is this is the transaction number that appears on email receipts sent for this invoice. + ReceiptNumber string `json:"receipt_number,omitempty" yaml:"receipt_number,omitempty"` + // StatementDescriptor is extra information about an invoice for the customer's credit card statement. + StatementDescriptor string `json:"statement_descriptor,omitempty" yaml:"statement_descriptor,omitempty"` + // Status is the status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. + // + // [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview). + Status InvoiceStatus `json:"status,omitempty" yaml:"status,omitempty"` + // Subtotal is total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or tax is applied. + // + // Item discounts are already incorporated. + Subtotal int `json:"subtotal,omitempty" yaml:"subtotal,omitempty"` + // Tax is the amount of tax on this invoice. + // + // This is the sum of all the tax amounts on this invoice. + Tax int `json:"tax,omitempty" yaml:"tax,omitempty"` + // Total is total after discounts and taxes. + Total int `json:"total,omitempty" yaml:"total,omitempty"` +} + +// InvoiceLineItem is an invoice line item. +type InvoiceLineItem struct { + // Amount is the amount, in %s. + Amount int `json:"amount,omitempty" yaml:"amount,omitempty"` + // Currency is three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + Currency Currency `json:"currency,omitempty" yaml:"currency,omitempty"` + // Description is the description. + Description string `json:"description,omitempty" yaml:"description,omitempty"` + // ID is unique identifier for the object. + ID string `json:"id,omitempty" yaml:"id,omitempty"` + // InvoiceItem is the ID of the invoice item associated with this line item if any. + InvoiceItem string `json:"invoice_item,omitempty" yaml:"invoice_item,omitempty"` + // Metadata is set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + // + // Set of key-value pairs. + Metadata string `json:"metadata,omitempty" yaml:"metadata,omitempty"` +} + +// InvoiceStatus is an enum representing the possible values of an `Invoice`'s `status` field. +type InvoiceStatus string + +const ( + // InvoiceStatusDeleted represents the InvoiceStatus `"deleted"`. + InvoiceStatusDeleted InvoiceStatus = "deleted" + // InvoiceStatusDraft represents the InvoiceStatus `"draft"`. + InvoiceStatusDraft InvoiceStatus = "draft" + // InvoiceStatusOpen represents the InvoiceStatus `"open"`. + InvoiceStatusOpen InvoiceStatus = "open" + // InvoiceStatusPaid represents the InvoiceStatus `"paid"`. + InvoiceStatusPaid InvoiceStatus = "paid" + // InvoiceStatusUncollectible represents the InvoiceStatus `"uncollectible"`. + InvoiceStatusUncollectible InvoiceStatus = "uncollectible" + // InvoiceStatusVoid represents the InvoiceStatus `"void"`. + InvoiceStatusVoid InvoiceStatus = "void" +) + // Jetstream is jetstream information. type Jetstream struct { // Config is the Jetstream config. @@ -406,6 +1158,12 @@ type LeafNode struct { TlsTimeout int `json:"tls_timeout,omitempty" yaml:"tls_timeout,omitempty"` } +// LoginParams is the parameters passed to login. +type LoginParams struct { + // Session is the session token we should set as a cookie. + Session string `json:"session,omitempty" yaml:"session,omitempty"` +} + // MetaClusterInfo is jetstream statistics. type MetaClusterInfo struct { // ClusterSize is the size of the cluster. @@ -420,14 +1178,18 @@ type MetaClusterInfo struct { // // This is mostly used for internal purposes and debugging. type Metadata struct { + // Cache is metadata about our cache. + Cache CacheMetadata `json:"cache,omitempty" yaml:"cache,omitempty"` // Engine is metadata about our engine API connection. Engine EngineMetadata `json:"engine,omitempty" yaml:"engine,omitempty"` + // Environment is the environment we are running in. + Environment Environment `json:"environment,omitempty" yaml:"environment,omitempty"` // Fs is metadata about our file system. Fs FileSystemMetadata `json:"fs,omitempty" yaml:"fs,omitempty"` // GitHash is the git hash of the server. GitHash string `json:"git_hash,omitempty" yaml:"git_hash,omitempty"` - // Nats is metadata about our nats.io connection. - Nats NatsConnection `json:"nats,omitempty" yaml:"nats,omitempty"` + // Pubsub is metadata about our pub-sub connection. + Pubsub Connection `json:"pubsub,omitempty" yaml:"pubsub,omitempty"` } // Method is the Request Method (VERB) @@ -460,110 +1222,46 @@ const ( MethodEXTENSION Method = "EXTENSION" ) -// NatsConnection is metadata about a nats.io connection. -// -// This is mostly used for internal purposes and debugging. -type NatsConnection struct { - // AuthTimeout is the auth timeout of the server. - AuthTimeout int `json:"auth_timeout,omitempty" yaml:"auth_timeout,omitempty"` - // Cluster is information about the cluster. - Cluster Cluster `json:"cluster,omitempty" yaml:"cluster,omitempty"` - // ConfigLoadTime is the time the configuration was loaded. - ConfigLoadTime *JSONTime `json:"config_load_time,omitempty" yaml:"config_load_time,omitempty"` - // Connections is the number of connections to the server. - Connections int `json:"connections,omitempty" yaml:"connections,omitempty"` - // Cores is the CPU core usage of the server. - Cores int `json:"cores,omitempty" yaml:"cores,omitempty"` - // Cpu is the CPU usage of the server. - Cpu int `json:"cpu,omitempty" yaml:"cpu,omitempty"` - // Gateway is information about the gateway. - Gateway Gateway `json:"gateway,omitempty" yaml:"gateway,omitempty"` - // GitCommit is the git commit. - GitCommit string `json:"git_commit,omitempty" yaml:"git_commit,omitempty"` - // Go is the go version. - Go string `json:"go,omitempty" yaml:"go,omitempty"` - // Gomaxprocs is `GOMAXPROCS` of the server. - Gomaxprocs int `json:"gomaxprocs,omitempty" yaml:"gomaxprocs,omitempty"` - // Host is the host of the server. - Host string `json:"host,omitempty" yaml:"host,omitempty"` - // HttpBasePath is the http base path of the server. - HttpBasePath string `json:"http_base_path,omitempty" yaml:"http_base_path,omitempty"` - // HttpHost is the http host of the server. - HttpHost string `json:"http_host,omitempty" yaml:"http_host,omitempty"` - // HttpPort is the http port of the server. - HttpPort int `json:"http_port,omitempty" yaml:"http_port,omitempty"` - // HttpReqStats is hTTP request statistics. - HttpReqStats int `json:"http_req_stats,omitempty" yaml:"http_req_stats,omitempty"` - // HttpsPort is the https port of the server. - HttpsPort int `json:"https_port,omitempty" yaml:"https_port,omitempty"` - // ID is the ID as known by the most recently connected server. - ID int `json:"id,omitempty" yaml:"id,omitempty"` - // InBytes is the count of inbound bytes for the server. - InBytes int `json:"in_bytes,omitempty" yaml:"in_bytes,omitempty"` - // InMsgs is the number of inbound messages for the server. - InMsgs int `json:"in_msgs,omitempty" yaml:"in_msgs,omitempty"` - // Ip is the client IP as known by the most recently connected server. - Ip string `json:"ip,omitempty" yaml:"ip,omitempty"` - // Jetstream is jetstream information. - Jetstream Jetstream `json:"jetstream,omitempty" yaml:"jetstream,omitempty"` - // Leaf is information about leaf nodes. - Leaf LeafNode `json:"leaf,omitempty" yaml:"leaf,omitempty"` - // Leafnodes is the number of leaf nodes for the server. - Leafnodes int `json:"leafnodes,omitempty" yaml:"leafnodes,omitempty"` - // MaxConnections is the max connections of the server. - MaxConnections int `json:"max_connections,omitempty" yaml:"max_connections,omitempty"` - // MaxControlLine is the max control line of the server. - MaxControlLine int `json:"max_control_line,omitempty" yaml:"max_control_line,omitempty"` - // MaxPayload is the max payload of the server. - MaxPayload int `json:"max_payload,omitempty" yaml:"max_payload,omitempty"` - // MaxPending is the max pending of the server. - MaxPending int `json:"max_pending,omitempty" yaml:"max_pending,omitempty"` - // Mem is the memory usage of the server. - Mem int `json:"mem,omitempty" yaml:"mem,omitempty"` - // Now is the time now. - Now *JSONTime `json:"now,omitempty" yaml:"now,omitempty"` - // OutBytes is the count of outbound bytes for the server. - OutBytes int `json:"out_bytes,omitempty" yaml:"out_bytes,omitempty"` - // OutMsgs is the number of outbound messages for the server. - OutMsgs int `json:"out_msgs,omitempty" yaml:"out_msgs,omitempty"` - // PingInterval is the ping interval of the server. - PingInterval int `json:"ping_interval,omitempty" yaml:"ping_interval,omitempty"` - // PingMax is the ping max of the server. - PingMax int `json:"ping_max,omitempty" yaml:"ping_max,omitempty"` - // Port is the port of the server. - Port int `json:"port,omitempty" yaml:"port,omitempty"` - // Proto is the protocol version. - Proto int `json:"proto,omitempty" yaml:"proto,omitempty"` - // Remotes is the number of remotes for the server. - Remotes int `json:"remotes,omitempty" yaml:"remotes,omitempty"` - // Routes is the number of routes for the server. - Routes int `json:"routes,omitempty" yaml:"routes,omitempty"` - // Rtt is the round trip time between this client and the server. - Rtt Duration `json:"rtt,omitempty" yaml:"rtt,omitempty"` - // ServerID is the server ID. - ServerID string `json:"server_id,omitempty" yaml:"server_id,omitempty"` - // ServerName is the server name. - ServerName string `json:"server_name,omitempty" yaml:"server_name,omitempty"` - // SlowConsumers is the number of slow consumers for the server. - SlowConsumers int `json:"slow_consumers,omitempty" yaml:"slow_consumers,omitempty"` - // Start is when the server was started. - Start *JSONTime `json:"start,omitempty" yaml:"start,omitempty"` - // Subscriptions is the number of subscriptions for the server. - Subscriptions int `json:"subscriptions,omitempty" yaml:"subscriptions,omitempty"` - // SystemAccount is the system account. - SystemAccount string `json:"system_account,omitempty" yaml:"system_account,omitempty"` - // TlsTimeout is the TLS timeout of the server. - TlsTimeout int `json:"tls_timeout,omitempty" yaml:"tls_timeout,omitempty"` - // TotalConnections is the total number of connections to the server. - TotalConnections int `json:"total_connections,omitempty" yaml:"total_connections,omitempty"` - // Uptime is the uptime of the server. - Uptime string `json:"uptime,omitempty" yaml:"uptime,omitempty"` - // Version is the version of the service. - Version string `json:"version,omitempty" yaml:"version,omitempty"` - // WriteDeadline is the write deadline of the server. - WriteDeadline int `json:"write_deadline,omitempty" yaml:"write_deadline,omitempty"` +// PaymentIntent is a payment intent response. +type PaymentIntent struct { + // ClientSecret is the client secret is used for client-side retrieval using a publishable key. The client secret can be used to complete payment setup from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret. + ClientSecret string `json:"client_secret,omitempty" yaml:"client_secret,omitempty"` +} + +// PaymentMethod is a payment method. +type PaymentMethod struct { + // BillingInfo is the billing info for the payment method. + BillingInfo BillingInfo `json:"billing_info,omitempty" yaml:"billing_info,omitempty"` + // Card is the card, if it is one. For our purposes, this is the only type of payment method that we support. + Card CardDetails `json:"card,omitempty" yaml:"card,omitempty"` + // CreatedAt is time at which the object was created. + CreatedAt *JSONTime `json:"created_at,omitempty" yaml:"created_at,omitempty"` + // ID is unique identifier for the object. + ID string `json:"id,omitempty" yaml:"id,omitempty"` + // Metadata is set of key-value pairs. + Metadata string `json:"metadata,omitempty" yaml:"metadata,omitempty"` + // Type is the type of payment method. + Type PaymentMethodType `json:"type,omitempty" yaml:"type,omitempty"` +} + +// PaymentMethodCardChecks is card checks. +type PaymentMethodCardChecks struct { + // AddressLine1Check is if a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + AddressLine1Check string `json:"address_line1_check,omitempty" yaml:"address_line1_check,omitempty"` + // AddressPostalCodeCheck is if a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + AddressPostalCodeCheck string `json:"address_postal_code_check,omitempty" yaml:"address_postal_code_check,omitempty"` + // CvcCheck is if a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + CvcCheck string `json:"cvc_check,omitempty" yaml:"cvc_check,omitempty"` } +// PaymentMethodType is an enum representing the possible values of an `PaymentMethod`'s `type` field. +type PaymentMethodType string + +const ( + // PaymentMethodTypeCard represents the PaymentMethodType `"card"`. + PaymentMethodTypeCard PaymentMethodType = "card" +) + // Pong is the response from the `/ping` endpoint. type Pong struct { // Message is the pong response. @@ -591,6 +1289,22 @@ type Session struct { // StatusCode is the type definition for a StatusCode. type StatusCode int +// UpdateUser is the user-modifiable parts of a User. +type UpdateUser struct { + // Company is the user's company. + Company string `json:"company,omitempty" yaml:"company,omitempty"` + // Discord is the user's Discord handle. + Discord string `json:"discord,omitempty" yaml:"discord,omitempty"` + // FirstName is the user's first name. + FirstName string `json:"first_name,omitempty" yaml:"first_name,omitempty"` + // Github is the user's GitHub handle. + Github string `json:"github,omitempty" yaml:"github,omitempty"` + // LastName is the user's last name. + LastName string `json:"last_name,omitempty" yaml:"last_name,omitempty"` + // Phone is the user's phone number. + Phone string `json:"phone,omitempty" yaml:"phone,omitempty"` +} + // User is a user. type User struct { // Company is the user's company. @@ -644,38 +1358,213 @@ var APICallQueryGroupBys = []APICallQueryGroupBy{ APICallQueryGroupByUserId, } +// APICallStatuses is the collection of all APICallStatus values. +var APICallStatuses = []APICallStatus{ + APICallStatusCompleted, + APICallStatusFailed, + APICallStatusInProgress, + APICallStatusQueued, + APICallStatusUploaded, +} + +// AsyncAPICallOutputTypes is the collection of all AsyncAPICallOutputType values. +var AsyncAPICallOutputTypes = []AsyncAPICallOutputType{ + AsyncAPICallOutputTypeFileConversion, + AsyncAPICallOutputTypeFileMass, + AsyncAPICallOutputTypeFileVolume, +} + +// CodeLanguages is the collection of all CodeLanguage values. +var CodeLanguages = []CodeLanguage{ + CodeLanguageGo, + CodeLanguageNode, + CodeLanguagePython, + CodeLanguageRust, +} + // CreatedAtSortModes is the collection of all CreatedAtSortMode values. var CreatedAtSortModes = []CreatedAtSortMode{ CreatedAtSortModeCreatedAtAscending, CreatedAtSortModeCreatedAtDescending, } -// FileConversionOutputFormats is the collection of all FileConversionOutputFormat values. -var FileConversionOutputFormats = []FileConversionOutputFormat{ - FileConversionOutputFormatDae, - FileConversionOutputFormatFbx, - FileConversionOutputFormatFbxb, - FileConversionOutputFormatObj, - FileConversionOutputFormatStep, - FileConversionOutputFormatStl, +// Currencys is the collection of all Currency values. +var Currencys = []Currency{ + CurrencyAed, + CurrencyAfn, + CurrencyAll, + CurrencyAmd, + CurrencyAng, + CurrencyAoa, + CurrencyArs, + CurrencyAud, + CurrencyAwg, + CurrencyAzn, + CurrencyBam, + CurrencyBbd, + CurrencyBdt, + CurrencyBgn, + CurrencyBif, + CurrencyBmd, + CurrencyBnd, + CurrencyBob, + CurrencyBrl, + CurrencyBsd, + CurrencyBwp, + CurrencyBzd, + CurrencyCad, + CurrencyCdf, + CurrencyChf, + CurrencyClp, + CurrencyCny, + CurrencyCop, + CurrencyCrc, + CurrencyCve, + CurrencyCzk, + CurrencyDjf, + CurrencyDkk, + CurrencyDop, + CurrencyDzd, + CurrencyEek, + CurrencyEgp, + CurrencyEtb, + CurrencyEur, + CurrencyFjd, + CurrencyFkp, + CurrencyGbp, + CurrencyGel, + CurrencyGip, + CurrencyGmd, + CurrencyGnf, + CurrencyGtq, + CurrencyGyd, + CurrencyHkd, + CurrencyHnl, + CurrencyHrk, + CurrencyHtg, + CurrencyHuf, + CurrencyIdr, + CurrencyIls, + CurrencyInr, + CurrencyIsk, + CurrencyJmd, + CurrencyJpy, + CurrencyKes, + CurrencyKgs, + CurrencyKhr, + CurrencyKmf, + CurrencyKrw, + CurrencyKyd, + CurrencyKzt, + CurrencyLak, + CurrencyLbp, + CurrencyLkr, + CurrencyLrd, + CurrencyLsl, + CurrencyLtl, + CurrencyLvl, + CurrencyMad, + CurrencyMdl, + CurrencyMga, + CurrencyMkd, + CurrencyMnt, + CurrencyMop, + CurrencyMro, + CurrencyMur, + CurrencyMvr, + CurrencyMwk, + CurrencyMxn, + CurrencyMyr, + CurrencyMzn, + CurrencyNad, + CurrencyNgn, + CurrencyNio, + CurrencyNok, + CurrencyNpr, + CurrencyNzd, + CurrencyPab, + CurrencyPen, + CurrencyPgk, + CurrencyPhp, + CurrencyPkr, + CurrencyPln, + CurrencyPyg, + CurrencyQar, + CurrencyRon, + CurrencyRsd, + CurrencyRub, + CurrencyRwf, + CurrencySar, + CurrencySbd, + CurrencyScr, + CurrencySek, + CurrencySgd, + CurrencyShp, + CurrencySll, + CurrencySos, + CurrencySrd, + CurrencyStd, + CurrencySvc, + CurrencySzl, + CurrencyThb, + CurrencyTjs, + CurrencyTop, + CurrencyTry, + CurrencyTtd, + CurrencyTwd, + CurrencyTzs, + CurrencyUah, + CurrencyUgx, + CurrencyUsd, + CurrencyUyu, + CurrencyUzs, + CurrencyVef, + CurrencyVnd, + CurrencyVuv, + CurrencyWst, + CurrencyXaf, + CurrencyXcd, + CurrencyXof, + CurrencyXpf, + CurrencyYer, + CurrencyZar, + CurrencyZmw, } -// FileConversionSourceFormats is the collection of all FileConversionSourceFormat values. -var FileConversionSourceFormats = []FileConversionSourceFormat{ - FileConversionSourceFormatDae, - FileConversionSourceFormatFbx, - FileConversionSourceFormatObj, - FileConversionSourceFormatStep, - FileConversionSourceFormatStl, +// Environments is the collection of all Environment values. +var Environments = []Environment{ + EnvironmentDEVELOPMENT, + EnvironmentPREVIEW, + EnvironmentPRODUCTION, } -// FileConversionStatuses is the collection of all FileConversionStatus values. -var FileConversionStatuses = []FileConversionStatus{ - FileConversionStatusCompleted, - FileConversionStatusFailed, - FileConversionStatusInProgress, - FileConversionStatusQueued, - FileConversionStatusUploaded, +// FileOutputFormats is the collection of all FileOutputFormat values. +var FileOutputFormats = []FileOutputFormat{ + FileOutputFormatDae, + FileOutputFormatFbx, + FileOutputFormatFbxb, + FileOutputFormatObj, + FileOutputFormatStep, + FileOutputFormatStl, +} + +// FileSourceFormats is the collection of all FileSourceFormat values. +var FileSourceFormats = []FileSourceFormat{ + FileSourceFormatDae, + FileSourceFormatFbx, + FileSourceFormatObj, + FileSourceFormatStep, + FileSourceFormatStl, +} + +// InvoiceStatuses is the collection of all InvoiceStatus values. +var InvoiceStatuses = []InvoiceStatus{ + InvoiceStatusDeleted, + InvoiceStatusDraft, + InvoiceStatusOpen, + InvoiceStatusPaid, + InvoiceStatusUncollectible, + InvoiceStatusVoid, } // Methods is the collection of all Method values. @@ -691,3 +1580,8 @@ var Methods = []Method{ MethodPUT, MethodTRACE, } + +// PaymentMethodTypes is the collection of all PaymentMethodType values. +var PaymentMethodTypes = []PaymentMethodType{ + PaymentMethodTypeCard, +}