Struct PostmanClient

Source
pub struct PostmanClient { /* private fields */ }

Implementations§

Source§

impl PostmanClient

Source

pub fn from_env() -> Self

Source§

impl PostmanClient

Source

pub fn new(url: &str, authentication: PostmanAuthentication) -> Self

Source

pub fn with_authentication(self, authentication: PostmanAuthentication) -> Self

Source

pub fn authenticate<'a>(&self, r: RequestBuilder<'a>) -> RequestBuilder<'a>

Source

pub fn with_middleware<M: Middleware + 'static>(self, middleware: M) -> Self

Source

pub fn get_all_apis(&self) -> GetAllApisRequest<'_>

Get all APIs

Gets information about all APIs.

Source

pub fn create_api(&self) -> CreateApiRequest<'_>

Create an API

Creates an API.

Source

pub fn single_api(&self, api_id: &str) -> SingleApiRequest<'_>

Get an API

Gets information about an API.

Source

pub fn update_an_api(&self, api_id: &str) -> UpdateAnApiRequest<'_>

Update an API

Updates an API.

Source

pub fn delete_an_api(&self, api_id: &str) -> DeleteAnApiRequest<'_>

Delete an API

Deletes an API.

Source

pub fn get_all_api_versions(&self, api_id: &str) -> GetAllApiVersionsRequest<'_>

Get all API versions

Gets information about an API’s versions.

Source

pub fn create_api_version(&self, api_id: &str) -> CreateApiVersionRequest<'_>

Create an API version

Creates a new API version.

Source

pub fn get_an_api_version( &self, api_id: &str, api_version_id: &str, ) -> GetAnApiVersionRequest<'_>

Get an API version

Gets information about an API version.

Source

pub fn update_an_api_version( &self, api_id: &str, api_version_id: &str, ) -> UpdateAnApiVersionRequest<'_>

Update an API version

Updates an API version.

Source

pub fn delete_an_api_version( &self, api_id: &str, api_version_id: &str, ) -> DeleteAnApiVersionRequest<'_>

Delete an API version

Deletes an API version.

Source

pub fn get_contract_test_relations( &self, api_id: &str, api_version_id: &str, ) -> GetContractTestRelationsRequest<'_>

Get contract test relations

This endpoint is deprecated. Use the /apis/{apiId}/versions/{apiVersionId}/test endpoint.

Source

pub fn get_documentation_relations( &self, api_id: &str, api_version_id: &str, ) -> GetDocumentationRelationsRequest<'_>

Get documentation relations

Gets an API version’s documentation relations.

Source

pub fn get_environment_relations( &self, api_id: &str, api_version_id: &str, ) -> GetEnvironmentRelationsRequest<'_>

Get environment relations

Gets an API version’s environment relations.

Source

pub fn get_integration_test_relations( &self, api_id: &str, api_version_id: &str, ) -> GetIntegrationTestRelationsRequest<'_>

Get integration test relations

This endpoint is deprecated. Use the /apis/{apiId}/versions/{apiVersionId}/test endpoint.

Source

pub fn get_mock_server_relations( &self, api_id: &str, api_version_id: &str, ) -> GetMockServerRelationsRequest<'_>

Get mock server relations

Gets an API version’s mock server relations.

Source

pub fn get_monitor_relations( &self, api_id: &str, api_version_id: &str, ) -> GetMonitorRelationsRequest<'_>

Get monitor relations

Gets an API version’s monitor relations.

Source

pub fn get_linked_relations( &self, api_id: &str, api_version_id: &str, ) -> GetLinkedRelationsRequest<'_>

Get all linked relations

Gets all of an API version’s relations.

Source

pub fn create_relations( &self, api_id: &str, api_version_id: &str, ) -> CreateRelationsRequest<'_>

Create relations

Creates a new relation for an API version. This endpoint accepts multiple relation arrays in a single call.

Source

pub fn create_schema( &self, api_id: &str, api_version_id: &str, ) -> CreateSchemaRequest<'_>

Create a schema

Creates an API definition.

Source

pub fn get_schema( &self, api_id: &str, api_version_id: &str, schema_id: &str, ) -> GetSchemaRequest<'_>

Get a schema

Gets information about an API’s definition.

Source

pub fn update_schema( &self, api_id: &str, api_version_id: &str, schema_id: &str, ) -> UpdateSchemaRequest<'_>

Update a schema

Updates an API definition.

Source

pub fn create_collection_from_schema( &self, args: CreateCollectionFromSchemaRequired<'_>, ) -> CreateCollectionFromSchemaRequest<'_>

Create collection from a schema

Creates a collection and links it to an API as one or multiple relations.

Source

pub fn get_test_relations( &self, api_id: &str, api_version_id: &str, ) -> GetTestRelationsRequest<'_>

Get all test relations

Gets all of an API version’s test relations.

Source

pub fn get_test_suite_relations( &self, api_id: &str, api_version_id: &str, ) -> GetTestSuiteRelationsRequest<'_>

Get test suite relations

This endpoint is deprecated. Use the /apis/{apiId}/versions/{apiVersionId}/test endpoint.

Source

pub fn sync_relations_with_schema( &self, args: SyncRelationsWithSchemaRequired<'_>, ) -> SyncRelationsWithSchemaRequest<'_>

Sync API relations with definition

Syncs an API version’s relation with the API’s definition.

Source

pub fn all_collections(&self) -> AllCollectionsRequest<'_>

Get all collections

Gets all of your collections. The response includes all of your subscribed collections.

Source

pub fn create_collection(&self) -> CreateCollectionRequest<'_>

Create a collection

Creates a collection using the Postman Collection v2 schema format.

Note:

  • For a complete list of available property values for this endpoint, use the following references available in the collection.json schema file:
    • info object — Use the definitions.info entry.
    • item object — Use the definitions.items entry.
  • For all other possible values, refer to the collection.json schema file.
Source

pub fn create_a_fork( &self, workspace: &str, collection_uid: &str, ) -> CreateAForkRequest<'_>

Create a fork

Creates a fork from an existing collection into a workspace.

Source

pub fn merge_a_fork(&self) -> MergeAForkRequest<'_>

Merge a fork

Merges a forked collection back into its destination collection.

Source

pub fn single_collection( &self, collection_uid: &str, ) -> SingleCollectionRequest<'_>

Get a collection

Gets information about a collection. For a complete list of this endpoint’s possible values, use the collection.json schema file.

Source

pub fn update_collection( &self, collection_uid: &str, ) -> UpdateCollectionRequest<'_>

Update a collection

Updates a collection using the Postman Collection v2 schema format.

Use caution when using this endpoint. The system will replace the existing collection with the values passed in the request body.

Note:

  • For a complete list of available property values for this endpoint, use the following references available in the collection.json schema file:
    • info object — Use the definitions.info entry.
    • item object — Use the definitions.items entry.
  • For all other possible values, refer to the collection.json schema file.
Source

pub fn delete_collection( &self, collection_uid: &str, ) -> DeleteCollectionRequest<'_>

Delete a collection

Deletes a collection.

Source

pub fn all_environments(&self) -> AllEnvironmentsRequest<'_>

Get all environments

Gets information about all of your environments.

Source

pub fn create_environment(&self) -> CreateEnvironmentRequest<'_>

Create an environment

Creates an environment.

Source

pub fn single_environment( &self, environment_uid: &str, ) -> SingleEnvironmentRequest<'_>

Get an environment

Gets information about an environment.

Source

pub fn update_environment( &self, environment_uid: &str, ) -> UpdateEnvironmentRequest<'_>

Update an environment

Updates an environment.

Source

pub fn delete_environment( &self, environment_uid: &str, ) -> DeleteEnvironmentRequest<'_>

Delete an environment

Deletes an environment.

Source

pub fn import_exported_data(&self) -> ImportExportedDataRequest<'_>

Import an exported Postman data dump file

This endpoint is deprecated.

Imports exported Postman data. This endpoint only accepts export data dump files.

For more information, read our Exporting data dumps documentation.

Source

pub fn import_external_api_specification( &self, body: Value, ) -> ImportExternalApiSpecificationRequest<'_>

Import an OpenAPI definition

Imports an OpenAPI definition into Postman as a new Postman Collection.

Source

pub fn api_key_owner(&self) -> ApiKeyOwnerRequest<'_>

Get authenticated user

Gets information about the authenticated user.

Source

pub fn all_mocks(&self) -> AllMocksRequest<'_>

Get all mock servers

Gets all mock servers.

Source

pub fn create_mock(&self) -> CreateMockRequest<'_>

Create a mock server

Creates a mock server in a collection.

Source

pub fn single_mock(&self, mock_uid: &str) -> SingleMockRequest<'_>

Get a mock server

Gets information about a mock server.

Source

pub fn update_mock(&self, mock_uid: &str) -> UpdateMockRequest<'_>

Update a mock server

Updates a mock server.

Source

pub fn delete_mock(&self, mock_uid: &str) -> DeleteMockRequest<'_>

Delete a mock server

Deletes a mock server.

Source

pub fn publish_mock(&self, mock_uid: &str) -> PublishMockRequest<'_>

Publish a mock server

Publishes a mock server. Publishing a mock server sets its Access Control configuration setting to public.

Source

pub fn unpublish_mock(&self, mock_uid: &str) -> UnpublishMockRequest<'_>

Unpublish a mock server

Unpublishes a mock server. Unpublishing a mock server sets its Access Control configuration setting to private.

Source

pub fn all_monitors(&self) -> AllMonitorsRequest<'_>

Get all monitors

Gets all monitors.

Source

pub fn create_monitor(&self) -> CreateMonitorRequest<'_>

Create a monitor

Creates a monitor.

Source

pub fn single_monitor(&self, monitor_uid: &str) -> SingleMonitorRequest<'_>

Get a monitor

Gets information about a monitor.

Source

pub fn update_monitor(&self, monitor_uid: &str) -> UpdateMonitorRequest<'_>

Update a monitor

Updates a monitor.

Source

pub fn delete_monitor(&self, monitor_uid: &str) -> DeleteMonitorRequest<'_>

Delete a monitor

Deletes a monitor.

Source

pub fn run_a_monitor(&self, monitor_uid: &str) -> RunAMonitorRequest<'_>

Run a monitor

Runs a monitor and returns its run results.

Source

pub fn get_resource_types(&self) -> GetResourceTypesRequest<'_>

Get resource types

Gets all the resource types supported by Postman’s SCIM API.

Source

pub fn service_provider_config(&self) -> ServiceProviderConfigRequest<'_>

Get service provider configuration

Gets the Postman SCIM API configuration information. This includes a list of supported operations.

Source

pub fn fetch_all_user_resource(&self) -> FetchAllUserResourceRequest<'_>

Get all user resources

Gets information about all Postman team members.

Source

pub fn create_user(&self) -> CreateUserRequest<'_>

Create a user

Creates a new user account in Postman and adds the user to your organization’s Postman team. If the account does not already exist, this also activates the user so they can authenticate in to your Postman team.

If the account already exists, the system sends the user an email invite to join the Postman team. The user joins the team once they accept the invite.

By default, the system assigns new users the developer role. You can update user roles in Postman.

Source

pub fn fetch_user_resource(&self, user_id: &str) -> FetchUserResourceRequest<'_>

Get user resource

Gets information about a Postman team member.

Source

pub fn update_user_information( &self, user_id: &str, ) -> UpdateUserInformationRequest<'_>

Update a user

Updates a user’s first and last name in Postman.

Note:

You can only use the SCIM API to update a user’s first and last name. You cannot update any other user attributes with the API.

Source

pub fn update_user_state(&self, user_id: &str) -> UpdateUserStateRequest<'_>

Update a user’s state

Updates a user’s active state in Postman.

§Reactivating users

By setting the active property from false to true, this reactivates an account. This allows the account to authenticate in to Postman and adds the account back on to your Postman team.

Source

pub fn schema_security_validation(&self) -> SchemaSecurityValidationRequest<'_>

Schema security validation

Performs a security analysis on the given definition and returns any issues. This can help you understand their impact and provides solutions to help you resolve the errors. You can include this endpoint to your CI/CD process to automate schema validation.

For more information, read our API definition warnings documentation.

Note:

The maximum allowed size of the definition is 10 MB.

Source

pub fn create_webhook(&self) -> CreateWebhookRequest<'_>

Create a webhook

Creates a webhook that triggers a collection with a custom payload. You can get the webhook’s URL from the webhookUrl property in the endpoint’s response.

Source

pub fn all_workspaces(&self) -> AllWorkspacesRequest<'_>

Get all workspaces

Gets all workspaces. The response includes your workspaces and any workspaces that you have access to.

Note:

This endpoint’s response contains the visibility field. Visibility determines who can access the workspace:

  • only-me — Applies to the My Workspace workspace.
  • personal — Only you can access the workspace.
  • team — All team members can access the workspace.
  • private-team — Only invited team members can access the workspace.
  • public — Everyone can access the workspace.
Source

pub fn create_workspace(&self) -> CreateWorkspaceRequest<'_>

Create a workspace

Creates a new workspace.

§Important:

We deprecated linking collections or environments between workspaces. We do not recommend that you do this.

If you have a linked collection or environment, note the following:

  • The endpoint does not create a clone of a collection or environment.
  • Any changes you make to a linked collection or environment changes them in all workspaces.
  • If you delete a collection or environment linked between workspaces, the system deletes it in all the workspaces.
Source

pub fn single_workspace(&self, workspace_id: &str) -> SingleWorkspaceRequest<'_>

Get a workspace

Gets information about a workspace.

Note:

This endpoint’s response contains the visibility field. Visibility determines who can access the workspace:

  • only-me — Applies to the My Workspace workspace.
  • personal — Only you can access the workspace.
  • team — All team members can access the workspace.
  • private-team — Only invited team members can access the workspace.
  • public — Everyone can access the workspace.
Source

pub fn update_workspace(&self, workspace_id: &str) -> UpdateWorkspaceRequest<'_>

Update a workspace

Updates a workspace.

Note:

You can change a workspace’s type from personal to team, but you cannot change a workspace from team to personal.

§Important:

We deprecated linking collections or environments between workspaces. We do not recommend that you do this.

If you have a linked collection or environment, note the following:

  • The endpoint does not create a clone of a collection or environment.
  • Any changes you make to a linked collection or environment changes them in all workspaces.
  • If you delete a collection or environment linked between workspaces, the system deletes it in all the workspaces.
Source

pub fn delete_workspace(&self, workspace_id: &str) -> DeleteWorkspaceRequest<'_>

Delete a workspace

Deletes an existing workspace.

§Important:

If you delete a workspace that has a linked collection or environment with another workspace, this will delete the collection and environment in all workspaces.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more