resources

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	CreatedBy   string    `json:"createdBy"`
	UpdatedBy   string    `json:"updatedBy"`
	Team        string    `json:"team"`
	ID          string    `json:"id"`
	Name        string    `json:"name"`
	Summary     string    `json:"summary"`
	Description string    `json:"description"`
	CreatedAt   time.Time `json:"createdAt"`
	UpdatedAt   time.Time `json:"updatedAt"`
}

API represents a single item in an APIListResponse.

func (API) Format

func (r API) Format() ([]string, []interface{})

Format returns column headers and values for the resource.

type APIListItem

type APIListItem struct {
	CreatedBy   string    `json:"createdBy"`
	UpdatedBy   string    `json:"updatedBy"`
	Team        string    `json:"team"`
	ID          string    `json:"id"`
	Name        string    `json:"name"`
	Summary     string    `json:"summary"`
	Description string    `json:"description"`
	CreatedAt   time.Time `json:"createdAt"`
	UpdatedAt   time.Time `json:"updatedAt"`
}

APIListItem represents a single item in an APIListResponse.

type APIListItems

type APIListItems []APIListItem

APIListItems is a slice of APIListItem

func (APIListItems) Format

func (r APIListItems) Format() ([]string, []interface{})

Format returns column headers and values for the resource.

type APIListResponse

type APIListResponse struct {
	APIs APIListItems `json:"apis"`
}

APIListResponse represents the top-level APIs response from the Postman API.

type APIRelations

type APIRelations struct {
	Documentation   map[string]LinkedCollection  `json:"documentation,omitempty"`
	Environment     map[string]LinkedEnvironment `json:"environment,omitempty"`
	ContractTest    map[string]LinkedCollection  `json:"contracttest,omitempty"`
	TestSuite       map[string]LinkedCollection  `json:"testsuite,omitempty"`
	IntegrationTest map[string]LinkedCollection  `json:"integrationtest,omitempty"`
	Mock            map[string]LinkedMock        `json:"mock,omitempty"`
	Monitor         map[string]LinkedMonitor     `json:"monitor,omitempty"`
}

APIRelations provides the top-level relations representation for APIs.

type APIRelationsResource

type APIRelationsResource struct {
	Relations APIRelations `json:"relations"`
}

APIRelationsResource provides the top-level wrapper for API Relations.

type APIResponse

type APIResponse struct {
	API API `json:"api"`
}

APIResponse is a single API representation in the Postman API.

type APISlice

type APISlice []*API

APISlice is a slice of API

func (APISlice) Format

func (r APISlice) Format() ([]string, []interface{})

Format returns column headers and values for the resource.

type APIVersion

type APIVersion struct {
	ID            string    `json:"id"`
	Name          string    `json:"name"`
	TransactionID string    `json:"transactionId"`
	CreatedAt     time.Time `json:"createdAt"`
	UpdatedAt     time.Time `json:"updatedAt"`
	API           string    `json:"api"`
	CreatedBy     string    `json:"createdBy"`
	UpdatedBy     string    `json:"updatedBy"`
	LastRevision  int64     `json:"lastRevision"`
	Schema        []string  `json:"schema"`
}

APIVersion represents a single item in an APIVersionListResponse.

func (APIVersion) Format

func (r APIVersion) Format() ([]string, []interface{})

Format returns column headers and values for the resource.

type APIVersionListItem

type APIVersionListItem struct {
	ID            string    `json:"id"`
	Name          string    `json:"name"`
	TransactionID string    `json:"transactionId"`
	CreatedAt     time.Time `json:"createdAt"`
	UpdatedAt     time.Time `json:"updatedAt"`
	API           string    `json:"api"`
	CreatedBy     string    `json:"createdBy"`
	UpdatedBy     string    `json:"updatedBy"`
	LastRevision  int64     `json:"lastRevision"`
}

APIVersionListItem represents a single item in an APIVersionListResponse.

type APIVersionListItems

type APIVersionListItems []APIVersionListItem

APIVersionListItems is a slice of APIVersionListItem

func (APIVersionListItems) Format

func (r APIVersionListItems) Format() ([]string, []interface{})

Format returns column headers and values for the resource.

type APIVersionListResponse

type APIVersionListResponse struct {
	APIVersions APIVersionListItems `json:"versions"`
}

APIVersionListResponse represents the top-level API Versions response from the Postman API.

type APIVersionResponse

type APIVersionResponse struct {
	APIVersion APIVersion `json:"version"`
}

APIVersionResponse is a single APIVersion representation in the Postman APIVersion.

type APIVersionSlice

type APIVersionSlice []*APIVersion

APIVersionSlice is a slice of APIVersion.

func (APIVersionSlice) Format

func (r APIVersionSlice) Format() ([]string, []interface{})

Format returns column headers and values for the resource.

type Collection

type Collection struct {
	*gen.Collection
	Items *ItemTree
}

Collection represents a Postman Collection.

func (Collection) Format

func (c Collection) Format() ([]string, []interface{})

Format returns column headers and values for the resource.

func (*Collection) UnmarshalJSON

func (c *Collection) UnmarshalJSON(b []byte) error

UnmarshalJSON converts JSON to a struct.

type CollectionListItem

type CollectionListItem struct {
	ID    string `json:"id"`
	Name  string `json:"name"`
	Owner string `json:"owner"`
	UID   string `json:"uid"`
	Fork  *Fork  `json:"fork,omitempty"`
}

CollectionListItem represents a single item in a CollectionListResponse.

type CollectionListItems

type CollectionListItems []CollectionListItem

CollectionListItems is a slice of CollectionListItem

func (CollectionListItems) Format

func (r CollectionListItems) Format() ([]string, []interface{})

Format returns column headers and values for the resource.

type CollectionListResponse

type CollectionListResponse struct {
	Collections CollectionListItems `json:"collections"`
}

CollectionListResponse is the top-level struct representation of a collection list response in the Postman API.

type CollectionResponse

type CollectionResponse struct {
	Collection Collection `json:"collection"`
}

CollectionResponse is the top-level struct representation of a collection response from the Postman API.

type CollectionSlice

type CollectionSlice []*Collection

CollectionSlice is a slice of Collection.

func (CollectionSlice) Format

func (r CollectionSlice) Format() ([]string, []interface{})

Format returns column headers and values for the resource.

type Environment

type Environment struct {
	ID     string         `json:"id"`
	Name   string         `json:"name"`
	Values []KeyValuePair `json:"values"`
}

Environment represents the single environment response from the Postman API

func (Environment) Format

func (r Environment) Format() ([]string, []interface{})

Format returns column headers and values for the resource.

type EnvironmentListItem

type EnvironmentListItem struct {
	ID    string `json:"id"`
	Name  string `json:"name"`
	Owner string `json:"owner"`
	UID   string `json:"uid"`
}

EnvironmentListItem represents a single item in an EnvironmentListResponse.

type EnvironmentListItems

type EnvironmentListItems []EnvironmentListItem

EnvironmentListItems is a slice of EnvironmentListItem.

func (EnvironmentListItems) Format

func (r EnvironmentListItems) Format() ([]string, []interface{})

Format returns column headers and values for the resource.

type EnvironmentListResponse

type EnvironmentListResponse struct {
	Environments EnvironmentListItems `json:"environments"`
}

EnvironmentListResponse represents the top-level environments response from the Postman API.

type EnvironmentResponse

type EnvironmentResponse struct {
	Environment Environment `json:"environment"`
}

EnvironmentResponse is the top-level environment response from the Postman API.

type EnvironmentSlice

type EnvironmentSlice []*Environment

EnvironmentSlice is a slice of Environment.

func (EnvironmentSlice) Format

func (r EnvironmentSlice) Format() ([]string, []interface{})

Format returns column headers and values for the resource.

type Error

type Error struct {
	Name    string                 `json:"name"`
	Message string                 `json:"message"`
	Details map[string]interface{} `json:"details"`
}

Error is a struct representation of error details from a Postman API error.

func (*Error) String

func (e *Error) String() string

type ErrorResponse

type ErrorResponse struct {
	Error Error `json:"error"`
}

ErrorResponse is the struct representation of a Postman API error.

type Event

type Event struct {
	*gen.Event
}

Event represents an item event.

type Fork

type Fork struct {
	Label     string    `json:"label"`
	CreatedAt time.Time `json:"createdAt"`
	From      string    `json:"from"`
}

Fork represents fork metadata for a collection.

type FormattedAPIRelationItem

type FormattedAPIRelationItem struct {
	ID   string
	Name string
	Type string
}

FormattedAPIRelationItem returns a list item version of an APIRelation.

type FormattedAPIRelationItems

type FormattedAPIRelationItems []FormattedAPIRelationItem

FormattedAPIRelationItems is a slice of FormattedAPIRelationItem

func NewFormattedAPIRelationItems

func NewFormattedAPIRelationItems(r *APIRelations) FormattedAPIRelationItems

NewFormattedAPIRelationItems returns a new human-readable view of API Relations.

func (FormattedAPIRelationItems) Format

func (r FormattedAPIRelationItems) Format() ([]string, []interface{})

Format returns column headers and values for the resource.

type Formatter

type Formatter interface {
	// Format returns column headers and values for the resource.
	Format() ([]string, []interface{})
}

Formatter represents a resource that provides print formatting information.

type Item

type Item struct {
	*gen.Item
	Events []Event
}

Item represents an item (request) in a Collection.

func (*Item) UnmarshalJSON

func (item *Item) UnmarshalJSON(b []byte) error

UnmarshalJSON converts JSON to a struct.

type ItemGroup

type ItemGroup struct {
	*gen.ItemGroup
	Events []Event
}

ItemGroup represents a folder in a Collection.

type ItemTree

type ItemTree struct {
	Root ItemTreeNode
}

ItemTree represents a folder/request structure in a Collection

func NewItemTree

func NewItemTree() *ItemTree

NewItemTree creates a new tree for storing items.

type ItemTreeNode

type ItemTreeNode struct {
	*ItemGroup
	Branches *[]ItemTreeNode
	Items    *[]Item
}

ItemTreeNode represents a group of items or a single item in a tree.

func (*ItemTreeNode) AddBranch

func (b *ItemTreeNode) AddBranch(br ItemTreeNode) ItemTreeNode

AddBranch adds a branch to a tree.

func (*ItemTreeNode) AddItem

func (b *ItemTreeNode) AddItem(item Item) Item

AddItem adds a single item to a tree node.

func (*ItemTreeNode) MakeGroup

func (b *ItemTreeNode) MakeGroup(group ItemGroup) ItemGroup

MakeGroup makes the current node an item group.

type KeyValuePair

type KeyValuePair struct {
	Key     string `json:"key"`
	Value   string `json:"value"`
	Enabled bool   `json:"enabled"`
}

KeyValuePair represents a key and value in the Postman API.

type LinkedCollection

type LinkedCollection struct {
	ID        string    `json:"id"`
	Name      string    `json:"name"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

LinkedCollection describes a single linked collection representation.

type LinkedEnvironment

type LinkedEnvironment struct {
	ID        string    `json:"id"`
	Name      string    `json:"name"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

LinkedEnvironment describes a single linked collection representation.

type LinkedMock

type LinkedMock struct {
	ID        string    `json:"id"`
	Name      string    `json:"name"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
	URL       string    `json:"url"`
}

LinkedMock describes a single linked collection representation.

type LinkedMonitor

type LinkedMonitor struct {
	ID        string    `json:"id"`
	Name      string    `json:"name"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

LinkedMonitor describes a single linked collection representation.

type Mock

type Mock struct {
	ID          string     `json:"id"`
	Owner       string     `json:"owner"`
	UID         string     `json:"uid"`
	Collection  string     `json:"collection"`
	MockURL     string     `json:"mockUrl"`
	Name        string     `json:"name"`
	Config      MockConfig `json:"config"`
	Environment string     `json:"environment"`
}

Mock represents a representation of a mock server from the Postman API.

func (Mock) Format

func (r Mock) Format() ([]string, []interface{})

Format returns column headers and values for the resource.

type MockConfig

type MockConfig struct {
	Headers          []interface{} `json:"headers"`
	MatchBody        bool          `json:"matchBody"`
	MatchQueryParams bool          `json:"matchQueryParams"`
	MatchWildcards   bool          `json:"matchWildcards"`
}

MockConfig represents the configuration of a mock server.

type MockListItem

type MockListItem struct {
	ID          string     `json:"id"`
	Owner       string     `json:"owner"`
	UID         string     `json:"uid"`
	Collection  string     `json:"collection"`
	MockURL     string     `json:"mockUrl"`
	Name        string     `json:"name"`
	Config      MockConfig `json:"config"`
	Environment string     `json:"environment"`
}

MockListItem represents a mock in a list of all mocks.

type MockListItems

type MockListItems []MockListItem

MockListItems is a slice of MockListItem.

func (MockListItems) Format

func (r MockListItems) Format() ([]string, []interface{})

Format returns column headers and values for the resource.

type MockListResponse

type MockListResponse struct {
	Mocks MockListItems `json:"mocks"`
}

MockListResponse represents the top-level mocks response from the Postman API.

type MockResponse

type MockResponse struct {
	Mock Mock `json:"mock"`
}

MockResponse is the top-level mock response from the Postman API.

type MockSlice

type MockSlice []*Mock

MockSlice is a slice of Mock.

func (MockSlice) Format

func (r MockSlice) Format() ([]string, []interface{})

Format returns column headers and values for the resource.

type Monitor

type Monitor struct {
	ID             string         `json:"id"`
	Name           string         `json:"name"`
	UID            string         `json:"uid"`
	Owner          string         `json:"owner"`
	CollectionUID  string         `json:"collectionUid"`
	EnvironmentUID string         `json:"environmentUid"`
	Options        MonitorOptions `json:"options"`
	Notifications  Notifications  `json:"notifications"`
	Distribution   []interface{}  `json:"distribution"`
	Schedule       Schedule       `json:"schedule"`
}

Monitor represents the single monitor response from the Postman API

func (Monitor) Format

func (r Monitor) Format() ([]string, []interface{})

Format returns column headers and values for the resource.

func (*Monitor) UnmarshalJSON

func (r *Monitor) UnmarshalJSON(data []byte) error

UnmarshalJSON sets the receiver to a copy of data.

type MonitorListItem

type MonitorListItem struct {
	ID    string `json:"id"`
	Name  string `json:"name"`
	UID   string `json:"uid"`
	Owner string `json:"owner"`
}

MonitorListItem represents a single item in an MonitorListResponse.

func (*MonitorListItem) UnmarshalJSON

func (m *MonitorListItem) UnmarshalJSON(data []byte) error

UnmarshalJSON sets the receiver to a copy of data.

type MonitorListItems

type MonitorListItems []MonitorListItem

MonitorListItems is a slice of MonitorListItem.

func (MonitorListItems) Format

func (r MonitorListItems) Format() ([]string, []interface{})

Format returns column headers and values for the resource.

type MonitorListResponse

type MonitorListResponse struct {
	Monitors MonitorListItems `json:"monitors"`
}

MonitorListResponse represents the top-level monitors response from the Postman API.

type MonitorOptions

type MonitorOptions struct {
	StrictSSL       bool `json:"strictSSL"`
	FollowRedirects bool `json:"followRedirects"`
	RequestTimeout  *int `json:"requestTimeout"`
	RequestDelay    int  `json:"requestDelay"`
}

MonitorOptions list options for a monitor.

type MonitorResponse

type MonitorResponse struct {
	Monitor Monitor `json:"monitor"`
}

MonitorResponse is the top-level monitor response from the Postman API.

type MonitorSlice

type MonitorSlice []*Monitor

MonitorSlice is a slice of Monitor.

func (MonitorSlice) Format

func (r MonitorSlice) Format() ([]string, []interface{})

Format returns column headers and values for the resource.

type Notifications

type Notifications struct {
	OnError   []OnError   `json:"onError"`
	OnFailure []OnFailure `json:"onFailure"`
}

Notifications represents a communication structure for notifications.

type OnError

type OnError struct {
	Email string `json:"email"`
}

OnError represents a communication mechanism for errors.

type OnFailure

type OnFailure struct {
	Email string `json:"email"`
}

OnFailure represents a communication mechanism for failures.

type ResourceType

type ResourceType int

ResourceType represents the resource type.

const (
	CollectionType ResourceType = iota
	EnvironmentType
	MockType
	MonitorType
	APIType
	APIVersionType
	APIRelationsType
	SchemaType
	WorkspaceType
	UserType
)

Resource types.

func (ResourceType) String

func (r ResourceType) String() string

String returns a string version of the ResourceType.

type Schedule

type Schedule struct {
	Cron     string    `json:"cron"`
	Timezone string    `json:"timezone"`
	NextRun  time.Time `json:"nextRun"`
}

Schedule represents when the monitor is scheduled to run.

type Schema

type Schema struct {
	APIVersion string    `json:"apiVersion"`
	CreatedBy  string    `json:"createdBy"`
	UpdatedBy  string    `json:"updatedBy"`
	ID         string    `json:"id"`
	Type       string    `json:"type"`
	Language   string    `json:"language"`
	CreatedAt  time.Time `json:"createdAt"`
	UpdatedAt  time.Time `json:"updatedAt"`
	Schema     string    `json:"schema"`
}

Schema represents an API schema from the Postman API

func (Schema) Format

func (r Schema) Format() ([]string, []interface{})

Format returns column headers and values for the resource.

type SchemaResponse

type SchemaResponse struct {
	Schema Schema `json:"schema"`
}

SchemaResponse represents the top-level schema response in the Postman API.

type User

type User struct {
	ID string `json:"id"`
}

User represents the user info associated with a user request in the Postman API.

func (User) Format

func (r User) Format() ([]string, []interface{})

Format returns column headers and values for the resource.

func (*User) UnmarshalJSON

func (r *User) UnmarshalJSON(data []byte) error

UnmarshalJSON sets the receiver to a copy of data.

type UserResponse

type UserResponse struct {
	User User `json:"user"`
}

UserResponse represents the top-level struct of a user response in the Postman API.

type Workspace

type Workspace struct {
	ID           string                         `json:"id"`
	Name         string                         `json:"name"`
	Type         string                         `json:"type"`
	Description  string                         `json:"description"`
	Collections  []WorkspaceCollectionListItem  `json:"collections"`
	Environments []WorkspaceEnvironmentListItem `json:"environments"`
	Mocks        []WorkspaceMockListItem        `json:"mocks"`
	Monitors     []WorkspaceMonitorListItem     `json:"monitors"`
}

Workspace represents the single workspace response from the Postman API

func (Workspace) Format

func (r Workspace) Format() ([]string, []interface{})

Format returns column headers and values for the resource.

type WorkspaceCollectionListItem added in v1.1.5

type WorkspaceCollectionListItem struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	UID  string `json:"uid"`
}

WorkspaceCollectionListItem represents a single collection item in a Workspace.

type WorkspaceEnvironmentListItem added in v1.1.5

type WorkspaceEnvironmentListItem struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	UID  string `json:"uid"`
}

WorkspaceEnvironmentListItem represents a single environment item in a Workspace.

type WorkspaceListItem

type WorkspaceListItem struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	Type string `json:"type"`
}

WorkspaceListItem represents a single item in an WorkspaceListResponse.

type WorkspaceListItems

type WorkspaceListItems []WorkspaceListItem

WorkspaceListItems is a slice of WorkspaceListItem.

func (WorkspaceListItems) Format

func (r WorkspaceListItems) Format() ([]string, []interface{})

Format returns column headers and values for the resource.

type WorkspaceListResponse

type WorkspaceListResponse struct {
	Workspaces WorkspaceListItems `json:"workspaces"`
}

WorkspaceListResponse represents the top-level workspaces response from the Postman API.

type WorkspaceMockListItem added in v1.1.5

type WorkspaceMockListItem struct {
	ID string `json:"id"`
}

WorkspaceMockListItem represents a single mock item in a Workspace.

type WorkspaceMonitorListItem added in v1.1.5

type WorkspaceMonitorListItem struct {
	ID string `json:"id"`
}

WorkspaceMonitorListItem represents a single monitor item in a Workspace.

type WorkspaceResponse

type WorkspaceResponse struct {
	Workspace Workspace `json:"workspace"`
}

WorkspaceResponse is the top-level workspace response from the Postman API.

type WorkspaceSlice

type WorkspaceSlice []*Workspace

WorkspaceSlice is a slice of Workspace.

func (WorkspaceSlice) Format

func (r WorkspaceSlice) Format() ([]string, []interface{})

Format returns column headers and values for the resource.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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