api

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient

type APIClient struct {
	VanillaClient  *VanillaClient
	YugawareClient *client.APIClient
	APIKey         string
	CustomerID     string
}

APIClient struct to handle API calls

func NewAPIClient

func NewAPIClient(enableHTTPS bool, host string, apiKey string) (*APIClient, error)

NewAPIClient creates a wrapper for public and non-public APIs

type LoginRequest

type LoginRequest struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

LoginRequest to handle request body of REST API

type LoginResponse

type LoginResponse struct {
	AuthToken    string `json:"authToken"`
	CustomerUUID string `json:"customerUUID"`
	UserUUID     string `json:"userUUID"`
}

LoginResponse to handle response body of REST API

type ReleaseResponse

type ReleaseResponse struct {
	Success bool `json:"success"`
}

ReleaseResponse handles the resturn value of the releases endpoint

type VanillaClient

type VanillaClient struct {
	Client      *http.Client
	Host        string
	EnableHTTPS bool
}

VanillaClient struct used for accessing non-public APIs

func (*VanillaClient) Login

func (vc *VanillaClient) Login(ctx context.Context, email string, password string) (
	*LoginResponse, error)

Login calls REST API for logging into YBA

func (*VanillaClient) ReleaseImport

func (vc *VanillaClient) ReleaseImport(ctx context.Context, cUUID string, version string,
	s3 map[string]interface{}, gcs map[string]interface{}, https map[string]interface{},
	token string) (bool, error)

ReleaseImport uses REST API to call import release functionality

Jump to

Keyboard shortcuts

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