pub struct PostmanClient { /* private fields */ }
Implementations§
Source§impl PostmanClient
impl PostmanClient
Source§impl PostmanClient
impl PostmanClient
pub fn new(url: &str, authentication: PostmanAuthentication) -> Self
pub fn with_authentication(self, authentication: PostmanAuthentication) -> Self
pub fn authenticate<'a>(&self, r: RequestBuilder<'a>) -> RequestBuilder<'a>
pub fn with_middleware<M: Middleware + 'static>(self, middleware: M) -> Self
Sourcepub fn get_all_apis(&self) -> GetAllApisRequest<'_>
pub fn get_all_apis(&self) -> GetAllApisRequest<'_>
Get all APIs
Gets information about all APIs.
Sourcepub fn create_api(&self) -> CreateApiRequest<'_>
pub fn create_api(&self) -> CreateApiRequest<'_>
Create an API
Creates an API.
Sourcepub fn single_api(&self, api_id: &str) -> SingleApiRequest<'_>
pub fn single_api(&self, api_id: &str) -> SingleApiRequest<'_>
Get an API
Gets information about an API.
Sourcepub fn update_an_api(&self, api_id: &str) -> UpdateAnApiRequest<'_>
pub fn update_an_api(&self, api_id: &str) -> UpdateAnApiRequest<'_>
Update an API
Updates an API.
Sourcepub fn delete_an_api(&self, api_id: &str) -> DeleteAnApiRequest<'_>
pub fn delete_an_api(&self, api_id: &str) -> DeleteAnApiRequest<'_>
Delete an API
Deletes an API.
Sourcepub fn get_all_api_versions(&self, api_id: &str) -> GetAllApiVersionsRequest<'_>
pub fn get_all_api_versions(&self, api_id: &str) -> GetAllApiVersionsRequest<'_>
Get all API versions
Gets information about an API’s versions.
Sourcepub fn create_api_version(&self, api_id: &str) -> CreateApiVersionRequest<'_>
pub fn create_api_version(&self, api_id: &str) -> CreateApiVersionRequest<'_>
Create an API version
Creates a new API version.
Sourcepub fn get_an_api_version(
&self,
api_id: &str,
api_version_id: &str,
) -> GetAnApiVersionRequest<'_>
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.
Sourcepub fn update_an_api_version(
&self,
api_id: &str,
api_version_id: &str,
) -> UpdateAnApiVersionRequest<'_>
pub fn update_an_api_version( &self, api_id: &str, api_version_id: &str, ) -> UpdateAnApiVersionRequest<'_>
Update an API version
Updates an API version.
Sourcepub fn delete_an_api_version(
&self,
api_id: &str,
api_version_id: &str,
) -> DeleteAnApiVersionRequest<'_>
pub fn delete_an_api_version( &self, api_id: &str, api_version_id: &str, ) -> DeleteAnApiVersionRequest<'_>
Delete an API version
Deletes an API version.
Sourcepub fn get_contract_test_relations(
&self,
api_id: &str,
api_version_id: &str,
) -> GetContractTestRelationsRequest<'_>
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.
Sourcepub fn get_documentation_relations(
&self,
api_id: &str,
api_version_id: &str,
) -> GetDocumentationRelationsRequest<'_>
pub fn get_documentation_relations( &self, api_id: &str, api_version_id: &str, ) -> GetDocumentationRelationsRequest<'_>
Get documentation relations
Gets an API version’s documentation relations.
Sourcepub fn get_environment_relations(
&self,
api_id: &str,
api_version_id: &str,
) -> GetEnvironmentRelationsRequest<'_>
pub fn get_environment_relations( &self, api_id: &str, api_version_id: &str, ) -> GetEnvironmentRelationsRequest<'_>
Get environment relations
Gets an API version’s environment relations.
Sourcepub fn get_integration_test_relations(
&self,
api_id: &str,
api_version_id: &str,
) -> GetIntegrationTestRelationsRequest<'_>
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.
Sourcepub fn get_mock_server_relations(
&self,
api_id: &str,
api_version_id: &str,
) -> GetMockServerRelationsRequest<'_>
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.
Sourcepub fn get_monitor_relations(
&self,
api_id: &str,
api_version_id: &str,
) -> GetMonitorRelationsRequest<'_>
pub fn get_monitor_relations( &self, api_id: &str, api_version_id: &str, ) -> GetMonitorRelationsRequest<'_>
Get monitor relations
Gets an API version’s monitor relations.
Sourcepub fn get_linked_relations(
&self,
api_id: &str,
api_version_id: &str,
) -> GetLinkedRelationsRequest<'_>
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.
Sourcepub fn create_relations(
&self,
api_id: &str,
api_version_id: &str,
) -> CreateRelationsRequest<'_>
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.
Sourcepub fn create_schema(
&self,
api_id: &str,
api_version_id: &str,
) -> CreateSchemaRequest<'_>
pub fn create_schema( &self, api_id: &str, api_version_id: &str, ) -> CreateSchemaRequest<'_>
Create a schema
Creates an API definition.
Sourcepub fn get_schema(
&self,
api_id: &str,
api_version_id: &str,
schema_id: &str,
) -> GetSchemaRequest<'_>
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.
Sourcepub fn update_schema(
&self,
api_id: &str,
api_version_id: &str,
schema_id: &str,
) -> UpdateSchemaRequest<'_>
pub fn update_schema( &self, api_id: &str, api_version_id: &str, schema_id: &str, ) -> UpdateSchemaRequest<'_>
Update a schema
Updates an API definition.
Sourcepub fn create_collection_from_schema(
&self,
args: CreateCollectionFromSchemaRequired<'_>,
) -> CreateCollectionFromSchemaRequest<'_>
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.
Sourcepub fn get_test_relations(
&self,
api_id: &str,
api_version_id: &str,
) -> GetTestRelationsRequest<'_>
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.
Sourcepub fn get_test_suite_relations(
&self,
api_id: &str,
api_version_id: &str,
) -> GetTestSuiteRelationsRequest<'_>
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.
Sourcepub fn sync_relations_with_schema(
&self,
args: SyncRelationsWithSchemaRequired<'_>,
) -> SyncRelationsWithSchemaRequest<'_>
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.
Sourcepub fn all_collections(&self) -> AllCollectionsRequest<'_>
pub fn all_collections(&self) -> AllCollectionsRequest<'_>
Get all collections
Gets all of your collections. The response includes all of your subscribed collections.
Sourcepub fn create_collection(&self) -> CreateCollectionRequest<'_>
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 thedefinitions.info
entry.item
object — Use thedefinitions.items
entry.
- For all other possible values, refer to the collection.json schema file.
Sourcepub fn create_a_fork(
&self,
workspace: &str,
collection_uid: &str,
) -> CreateAForkRequest<'_>
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.
Sourcepub fn merge_a_fork(&self) -> MergeAForkRequest<'_>
pub fn merge_a_fork(&self) -> MergeAForkRequest<'_>
Merge a fork
Merges a forked collection back into its destination collection.
Sourcepub fn single_collection(
&self,
collection_uid: &str,
) -> SingleCollectionRequest<'_>
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.
Sourcepub fn update_collection(
&self,
collection_uid: &str,
) -> UpdateCollectionRequest<'_>
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 thedefinitions.info
entry.item
object — Use thedefinitions.items
entry.
- For all other possible values, refer to the collection.json schema file.
Sourcepub fn delete_collection(
&self,
collection_uid: &str,
) -> DeleteCollectionRequest<'_>
pub fn delete_collection( &self, collection_uid: &str, ) -> DeleteCollectionRequest<'_>
Delete a collection
Deletes a collection.
Sourcepub fn all_environments(&self) -> AllEnvironmentsRequest<'_>
pub fn all_environments(&self) -> AllEnvironmentsRequest<'_>
Get all environments
Gets information about all of your environments.
Sourcepub fn create_environment(&self) -> CreateEnvironmentRequest<'_>
pub fn create_environment(&self) -> CreateEnvironmentRequest<'_>
Create an environment
Creates an environment.
Sourcepub fn single_environment(
&self,
environment_uid: &str,
) -> SingleEnvironmentRequest<'_>
pub fn single_environment( &self, environment_uid: &str, ) -> SingleEnvironmentRequest<'_>
Get an environment
Gets information about an environment.
Sourcepub fn update_environment(
&self,
environment_uid: &str,
) -> UpdateEnvironmentRequest<'_>
pub fn update_environment( &self, environment_uid: &str, ) -> UpdateEnvironmentRequest<'_>
Update an environment
Updates an environment.
Sourcepub fn delete_environment(
&self,
environment_uid: &str,
) -> DeleteEnvironmentRequest<'_>
pub fn delete_environment( &self, environment_uid: &str, ) -> DeleteEnvironmentRequest<'_>
Delete an environment
Deletes an environment.
Sourcepub fn import_exported_data(&self) -> ImportExportedDataRequest<'_>
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.
Sourcepub fn import_external_api_specification(
&self,
body: Value,
) -> ImportExternalApiSpecificationRequest<'_>
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.
Sourcepub fn api_key_owner(&self) -> ApiKeyOwnerRequest<'_>
pub fn api_key_owner(&self) -> ApiKeyOwnerRequest<'_>
Get authenticated user
Gets information about the authenticated user.
Sourcepub fn all_mocks(&self) -> AllMocksRequest<'_>
pub fn all_mocks(&self) -> AllMocksRequest<'_>
Get all mock servers
Gets all mock servers.
Sourcepub fn create_mock(&self) -> CreateMockRequest<'_>
pub fn create_mock(&self) -> CreateMockRequest<'_>
Create a mock server
Creates a mock server in a collection.
Sourcepub fn single_mock(&self, mock_uid: &str) -> SingleMockRequest<'_>
pub fn single_mock(&self, mock_uid: &str) -> SingleMockRequest<'_>
Get a mock server
Gets information about a mock server.
Sourcepub fn update_mock(&self, mock_uid: &str) -> UpdateMockRequest<'_>
pub fn update_mock(&self, mock_uid: &str) -> UpdateMockRequest<'_>
Update a mock server
Updates a mock server.
Sourcepub fn delete_mock(&self, mock_uid: &str) -> DeleteMockRequest<'_>
pub fn delete_mock(&self, mock_uid: &str) -> DeleteMockRequest<'_>
Delete a mock server
Deletes a mock server.
Sourcepub fn publish_mock(&self, mock_uid: &str) -> PublishMockRequest<'_>
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.
Sourcepub fn unpublish_mock(&self, mock_uid: &str) -> UnpublishMockRequest<'_>
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.
Sourcepub fn all_monitors(&self) -> AllMonitorsRequest<'_>
pub fn all_monitors(&self) -> AllMonitorsRequest<'_>
Get all monitors
Gets all monitors.
Sourcepub fn create_monitor(&self) -> CreateMonitorRequest<'_>
pub fn create_monitor(&self) -> CreateMonitorRequest<'_>
Create a monitor
Creates a monitor.
Sourcepub fn single_monitor(&self, monitor_uid: &str) -> SingleMonitorRequest<'_>
pub fn single_monitor(&self, monitor_uid: &str) -> SingleMonitorRequest<'_>
Get a monitor
Gets information about a monitor.
Sourcepub fn update_monitor(&self, monitor_uid: &str) -> UpdateMonitorRequest<'_>
pub fn update_monitor(&self, monitor_uid: &str) -> UpdateMonitorRequest<'_>
Update a monitor
Updates a monitor.
Sourcepub fn delete_monitor(&self, monitor_uid: &str) -> DeleteMonitorRequest<'_>
pub fn delete_monitor(&self, monitor_uid: &str) -> DeleteMonitorRequest<'_>
Delete a monitor
Deletes a monitor.
Sourcepub fn run_a_monitor(&self, monitor_uid: &str) -> RunAMonitorRequest<'_>
pub fn run_a_monitor(&self, monitor_uid: &str) -> RunAMonitorRequest<'_>
Run a monitor
Runs a monitor and returns its run results.
Sourcepub fn get_resource_types(&self) -> GetResourceTypesRequest<'_>
pub fn get_resource_types(&self) -> GetResourceTypesRequest<'_>
Get resource types
Gets all the resource types supported by Postman’s SCIM API.
Sourcepub fn service_provider_config(&self) -> ServiceProviderConfigRequest<'_>
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.
Sourcepub fn fetch_all_user_resource(&self) -> FetchAllUserResourceRequest<'_>
pub fn fetch_all_user_resource(&self) -> FetchAllUserResourceRequest<'_>
Get all user resources
Gets information about all Postman team members.
Sourcepub fn create_user(&self) -> CreateUserRequest<'_>
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.
Sourcepub fn fetch_user_resource(&self, user_id: &str) -> FetchUserResourceRequest<'_>
pub fn fetch_user_resource(&self, user_id: &str) -> FetchUserResourceRequest<'_>
Get user resource
Gets information about a Postman team member.
Sourcepub fn update_user_information(
&self,
user_id: &str,
) -> UpdateUserInformationRequest<'_>
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.
Sourcepub fn update_user_state(&self, user_id: &str) -> UpdateUserStateRequest<'_>
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.
Sourcepub fn schema_security_validation(&self) -> SchemaSecurityValidationRequest<'_>
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.
Sourcepub fn create_webhook(&self) -> CreateWebhookRequest<'_>
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.
Sourcepub fn all_workspaces(&self) -> AllWorkspacesRequest<'_>
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.
Sourcepub fn create_workspace(&self) -> CreateWorkspaceRequest<'_>
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.
Sourcepub fn single_workspace(&self, workspace_id: &str) -> SingleWorkspaceRequest<'_>
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.
Sourcepub fn update_workspace(&self, workspace_id: &str) -> UpdateWorkspaceRequest<'_>
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.
Sourcepub fn delete_workspace(&self, workspace_id: &str) -> DeleteWorkspaceRequest<'_>
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.