Documentation
¶
Overview ¶
Package postman provides a Go client for the Postman API.
It wraps an internal ogen-generated API client with a higher-level, hand- written surface that handles authentication and exposes convenient, domain-oriented services covering the Postman API.
Example:
client, err := postman.NewClient(postman.WithAPIKey("PMAK-..."))
if err != nil {
log.Fatal(err)
}
types, err := client.SecretScanner().SecretTypes(ctx)
Index ¶
- Constants
- Variables
- type APIError
- type Client
- func (c *Client) API() *api.Client
- func (c *Client) APISecurity() *apisecurity.Service
- func (c *Client) Analytics() *analytics.Service
- func (c *Client) AuditLogs() *auditlogs.Service
- func (c *Client) BaseURL() string
- func (c *Client) Billing() *billing.Service
- func (c *Client) CollectionAccessKeys() *collectionaccesskeys.Service
- func (c *Client) CollectionFolders() *collectionfolders.Service
- func (c *Client) CollectionItems() *collectionitems.Service
- func (c *Client) CollectionRequests() *collectionrequests.Service
- func (c *Client) CollectionResponses() *collectionresponses.Service
- func (c *Client) Collections() *collections.Service
- func (c *Client) Comments() *comments.Service
- func (c *Client) Components() *components.Service
- func (c *Client) Environments() *environments.Service
- func (c *Client) Groups() *groups.Service
- func (c *Client) Imports() *imports.Service
- func (c *Client) Mocks() *mocks.Service
- func (c *Client) Monitors() *monitors.Service
- func (c *Client) OAuth2() *oauth2.Service
- func (c *Client) Postbot() *postbot.Service
- func (c *Client) PrivateAPINetwork() *privateapinetwork.Service
- func (c *Client) PullRequests() *pullrequests.Service
- func (c *Client) SDKGen() *sdkgen.Service
- func (c *Client) Search() *search.Service
- func (c *Client) SecretScanner() *secretscanner.Service
- func (c *Client) ServiceAccounts() *serviceaccounts.Service
- func (c *Client) Specs() *specs.Service
- func (c *Client) Tags() *tags.Service
- func (c *Client) Teams() *teams.Service
- func (c *Client) Users() *users.Service
- func (c *Client) Webhooks() *webhooks.Service
- func (c *Client) Workspaces() *workspaces.Service
- type Option
Constants ¶
const ( // DefaultBaseURL is the default (US region) Postman API base URL. DefaultBaseURL = "https://api.postman.com" // EUBaseURL is the EU region Postman API base URL. EUBaseURL = "https://api.eu.postman.com" // EnvAPIKey is the environment variable read for the API key when one is not // supplied via WithAPIKey. EnvAPIKey = "POSTMAN_API_KEY" //nolint:gosec // G101: This is an environment variable name, not a credential )
const Version = "0.1.0"
Version is the SDK version.
Variables ¶
var ErrNoAPIKey = errors.New("postman: API key is required")
ErrNoAPIKey is returned by NewClient when no API key is configured.
Functions ¶
This section is empty.
Types ¶
type APIError ¶
type APIError = postmanerr.APIError
APIError is an error returned by the Postman API. It is an alias for postmanerr.APIError so callers can type-assert against a single type regardless of which service produced the error.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the top-level Postman API client.
func NewClient ¶
NewClient creates a new Postman client. The API key may be supplied via WithAPIKey or the POSTMAN_API_KEY environment variable.
func (*Client) API ¶
API returns the underlying ogen-generated client for advanced use cases not covered by the high-level services.
func (*Client) APISecurity ¶
func (c *Client) APISecurity() *apisecurity.Service
APISecurity returns the API Security validation service.
func (*Client) CollectionAccessKeys ¶
func (c *Client) CollectionAccessKeys() *collectionaccesskeys.Service
CollectionAccessKeys returns the Collection Access Keys service.
func (*Client) CollectionFolders ¶
func (c *Client) CollectionFolders() *collectionfolders.Service
CollectionFolders returns the Collection Folders comments service.
func (*Client) CollectionItems ¶
func (c *Client) CollectionItems() *collectionitems.Service
CollectionItems returns the Collection Items (folders/requests/responses) service.
func (*Client) CollectionRequests ¶
func (c *Client) CollectionRequests() *collectionrequests.Service
CollectionRequests returns the Collection Requests comments service.
func (*Client) CollectionResponses ¶
func (c *Client) CollectionResponses() *collectionresponses.Service
CollectionResponses returns the Collection Responses comments service.
func (*Client) Collections ¶
func (c *Client) Collections() *collections.Service
Collections returns the Collections service.
func (*Client) Components ¶
func (c *Client) Components() *components.Service
Components returns the API Spec Hub Components service.
func (*Client) Environments ¶
func (c *Client) Environments() *environments.Service
Environments returns the Environments service.
func (*Client) PrivateAPINetwork ¶
func (c *Client) PrivateAPINetwork() *privateapinetwork.Service
PrivateAPINetwork returns the Private API Network service.
func (*Client) PullRequests ¶
func (c *Client) PullRequests() *pullrequests.Service
PullRequests returns the Pull Requests service.
func (*Client) SecretScanner ¶
func (c *Client) SecretScanner() *secretscanner.Service
SecretScanner returns the Secret Scanner service.
func (*Client) ServiceAccounts ¶
func (c *Client) ServiceAccounts() *serviceaccounts.Service
ServiceAccounts returns the Service Accounts service.
func (*Client) Workspaces ¶
func (c *Client) Workspaces() *workspaces.Service
Workspaces returns the Workspaces service.
type Option ¶
type Option func(*clientOptions)
Option configures a Client.
func WithAPIKey ¶
WithAPIKey sets the Postman API key used for authentication.
func WithBaseURL ¶
WithBaseURL sets a custom API base URL (e.g. EUBaseURL).
func WithHTTPClient ¶
WithHTTPClient sets a custom HTTP client.
func WithTimeout ¶
WithTimeout sets the request timeout used when no custom HTTP client is set.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package analytics provides a high-level client for Postman's Analytics API.
|
Package analytics provides a high-level client for Postman's Analytics API. |
|
Package apisecurity provides a high-level client for Postman's API Security service.
|
Package apisecurity provides a high-level client for Postman's API Security service. |
|
Package auditlogs provides a high-level client for Postman's Audit Logs API.
|
Package auditlogs provides a high-level client for Postman's Audit Logs API. |
|
Package billing provides a high-level client for Postman's Billing API.
|
Package billing provides a high-level client for Postman's Billing API. |
|
Package collectionaccesskeys provides a high-level client for Postman's Collection Access Keys API.
|
Package collectionaccesskeys provides a high-level client for Postman's Collection Access Keys API. |
|
Package collectionfolders provides a high-level client for managing comments on folders within a Postman collection.
|
Package collectionfolders provides a high-level client for managing comments on folders within a Postman collection. |
|
Package collectionitems provides a high-level client for managing the individual items (folders, requests, and responses) nested inside a Postman collection.
|
Package collectionitems provides a high-level client for managing the individual items (folders, requests, and responses) nested inside a Postman collection. |
|
Package collectionrequests provides a high-level client for managing comments on requests within a Postman collection.
|
Package collectionrequests provides a high-level client for managing comments on requests within a Postman collection. |
|
Package collectionresponses provides a high-level client for managing comments on saved responses (examples) within a Postman collection.
|
Package collectionresponses provides a high-level client for managing comments on saved responses (examples) within a Postman collection. |
|
Package collections provides a high-level client for Postman's Collections API.
|
Package collections provides a high-level client for Postman's Collections API. |
|
Package comments provides a high-level client for Postman's Comments API.
|
Package comments provides a high-level client for Postman's Comments API. |
|
Package components provides a high-level client for Postman's API Spec Hub Components API.
|
Package components provides a high-level client for Postman's API Spec Hub Components API. |
|
Package environments provides a high-level client for Postman's Environments API.
|
Package environments provides a high-level client for Postman's Environments API. |
|
examples
|
|
|
secretscanner
command
Command secretscanner demonstrates the Postman Secret Scanner SDK.
|
Command secretscanner demonstrates the Postman Secret Scanner SDK. |
|
Package groups provides a high-level client for Postman's Groups API.
|
Package groups provides a high-level client for Postman's Groups API. |
|
Package imports provides a high-level client for Postman's Import API.
|
Package imports provides a high-level client for Postman's Import API. |
|
internal
|
|
|
api
Code generated by ogen, DO NOT EDIT.
|
Code generated by ogen, DO NOT EDIT. |
|
Package mocks provides a high-level client for Postman's Mock Server API.
|
Package mocks provides a high-level client for Postman's Mock Server API. |
|
Package monitors provides a high-level client for Postman's Monitors API.
|
Package monitors provides a high-level client for Postman's Monitors API. |
|
Package oauth2 provides a high-level client for Postman's OAuth 2.0 API.
|
Package oauth2 provides a high-level client for Postman's OAuth 2.0 API. |
|
Package postbot provides a high-level client for Postman's Postbot API.
|
Package postbot provides a high-level client for Postman's Postbot API. |
|
Package postmanerr defines error types shared across the postman-go SDK service packages.
|
Package postmanerr defines error types shared across the postman-go SDK service packages. |
|
Package privateapinetwork provides a high-level client for Postman's Private API Network API.
|
Package privateapinetwork provides a high-level client for Postman's Private API Network API. |
|
Package pullrequests provides a high-level client for Postman's Pull Requests API.
|
Package pullrequests provides a high-level client for Postman's Pull Requests API. |
|
Package sdkgen provides a high-level client for Postman's SDK Generation API.
|
Package sdkgen provides a high-level client for Postman's SDK Generation API. |
|
Package search provides a high-level client for Postman's Search API.
|
Package search provides a high-level client for Postman's Search API. |
|
Package secretscanner provides a high-level client for Postman's Secret Scanner API.
|
Package secretscanner provides a high-level client for Postman's Secret Scanner API. |
|
Package serviceaccounts provides a high-level client for Postman's Service Accounts API.
|
Package serviceaccounts provides a high-level client for Postman's Service Accounts API. |
|
Package specs provides a high-level client for Postman's API Spec Hub.
|
Package specs provides a high-level client for Postman's API Spec Hub. |
|
Package tags provides a high-level client for Postman's Tags API.
|
Package tags provides a high-level client for Postman's Tags API. |
|
Package teams provides a high-level client for Postman's Teams API.
|
Package teams provides a high-level client for Postman's Teams API. |
|
Package users provides a high-level client for retrieving information about the authenticated user and users on a Postman team.
|
Package users provides a high-level client for retrieving information about the authenticated user and users on a Postman team. |
|
Package webhooks provides a high-level client for Postman's Webhooks API.
|
Package webhooks provides a high-level client for Postman's Webhooks API. |
|
Package workspaces provides a high-level client for Postman's Workspaces API.
|
Package workspaces provides a high-level client for Postman's Workspaces API. |