requests

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	Cmd *cobra.Command

	Method  string
	Profile *config.Profile

	Parameters RequestParameters

	// SuppressOutput is used by `trigger` to hide output
	SuppressOutput bool

	DarkStyle bool

	APIBaseURL string

	Livemode bool
	// contains filtered or unexported fields
}

Base encapsulates the required information needed to make requests to the API

func (*Base) InitFlags

func (rb *Base) InitFlags()

InitFlags initialize shared flags for all requests commands

func (*Base) MakeRequest

func (rb *Base) MakeRequest(apiKey, path string, params *RequestParameters, errOnStatus bool) ([]byte, error)

MakeRequest will make a request to the Stripe API with the specific variables given to it

func (*Base) RunRequestsCmd

func (rb *Base) RunRequestsCmd(cmd *cobra.Command, args []string) error

RunRequestsCmd is the interface exposed for the CLI to run network requests through

type RequestParameters added in v0.2.1

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

RequestParameters captures the structure of the parameters that can be sent to Stripe

func (*RequestParameters) AppendData added in v0.5.0

func (r *RequestParameters) AppendData(data []string)

AppendData appends data to the request parameters.

func (*RequestParameters) SetStripeAccount added in v1.3.1

func (r *RequestParameters) SetStripeAccount(value string)

SetStripeAccount sets the value for the `Stripe-Account` header.

type WebhookEndpoint

type WebhookEndpoint struct {
	Application   string   `json:"application"`
	EnabledEvents []string `json:"enabled_events"`
	URL           string   `json:"url"`
}

WebhookEndpoint contains the data for each webhook endpoint

type WebhookEndpointList

type WebhookEndpointList struct {
	Data []WebhookEndpoint `json:"data"`
}

WebhookEndpointList contains the list of webhook endpoints for the account

func WebhookEndpointsList added in v0.9.0

func WebhookEndpointsList(baseURL, apiVersion, apiKey string, profile *config.Profile) WebhookEndpointList

WebhookEndpointsList returns all the webhook endpoints on a users' account

Jump to

Keyboard shortcuts

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