Skip to content

Latest commit

 

History

History
324 lines (221 loc) · 10.2 KB

File metadata and controls

324 lines (221 loc) · 10.2 KB

workplace_client.SubscriptionsApi

All URIs are relative to https://workplace-console.truehost.cloud/api

Method HTTP request Description
emails_create POST /subscriptions/ Create a new emails
subscriptions_list GET /subscriptions/ List subscriptions
subscriptions_read GET /subscriptions/{context_id}/ Get subscription details
update_subscription_status POST /subscriptions/{context_id}/ Update subscription status

emails_create

StandardResponse emails_create(workplace_create_emails)

Create a new emails

Create a new emails, it will also create a new subscription for the domain if emails list is not empty and new_subscription is true

Example

  • Bearer (JWT) Authentication (BearerAuth):
import workplace_client
from workplace_client.models.standard_response import StandardResponse
from workplace_client.models.workplace_create_emails import WorkplaceCreateEmails
from workplace_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://workplace-console.truehost.cloud/api
# See configuration.py for a list of all supported configuration parameters.
configuration = workplace_client.Configuration(
    host = "https://workplace-console.truehost.cloud/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): BearerAuth
configuration = workplace_client.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with workplace_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = workplace_client.SubscriptionsApi(api_client)
    workplace_create_emails = workplace_client.WorkplaceCreateEmails() # WorkplaceCreateEmails | 

    try:
        # Create a new emails
        api_response = api_instance.emails_create(workplace_create_emails)
        print("The response of SubscriptionsApi->emails_create:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling SubscriptionsApi->emails_create: %s\n" % e)

Parameters

Name Type Description Notes
workplace_create_emails WorkplaceCreateEmails

Return type

StandardResponse

Authorization

BearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

subscriptions_list

object subscriptions_list()

List subscriptions

Get list of subscriptions

Example

  • Bearer (JWT) Authentication (BearerAuth):
import workplace_client
from workplace_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://workplace-console.truehost.cloud/api
# See configuration.py for a list of all supported configuration parameters.
configuration = workplace_client.Configuration(
    host = "https://workplace-console.truehost.cloud/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): BearerAuth
configuration = workplace_client.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with workplace_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = workplace_client.SubscriptionsApi(api_client)

    try:
        # List subscriptions
        api_response = api_instance.subscriptions_list()
        print("The response of SubscriptionsApi->subscriptions_list:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling SubscriptionsApi->subscriptions_list: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

object

Authorization

BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 List of subscriptions -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

subscriptions_read

SubscriptionsReadResponse subscriptions_read(context_id)

Get subscription details

Get subscription details

Example

  • Bearer (JWT) Authentication (BearerAuth):
import workplace_client
from workplace_client.models.subscriptions_read_response import SubscriptionsReadResponse
from workplace_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://workplace-console.truehost.cloud/api
# See configuration.py for a list of all supported configuration parameters.
configuration = workplace_client.Configuration(
    host = "https://workplace-console.truehost.cloud/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): BearerAuth
configuration = workplace_client.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with workplace_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = workplace_client.SubscriptionsApi(api_client)
    context_id = 'context_id_example' # str | 

    try:
        # Get subscription details
        api_response = api_instance.subscriptions_read(context_id)
        print("The response of SubscriptionsApi->subscriptions_read:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling SubscriptionsApi->subscriptions_read: %s\n" % e)

Parameters

Name Type Description Notes
context_id str

Return type

SubscriptionsReadResponse

Authorization

BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Subscription details -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_subscription_status

StandardResponse update_subscription_status(context_id, service_action)

Update subscription status

Update subscription status, delete, suspend, unsuspend, etc...

Example

  • Bearer (JWT) Authentication (BearerAuth):
import workplace_client
from workplace_client.models.service_action import ServiceAction
from workplace_client.models.standard_response import StandardResponse
from workplace_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://workplace-console.truehost.cloud/api
# See configuration.py for a list of all supported configuration parameters.
configuration = workplace_client.Configuration(
    host = "https://workplace-console.truehost.cloud/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): BearerAuth
configuration = workplace_client.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with workplace_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = workplace_client.SubscriptionsApi(api_client)
    context_id = 'context_id_example' # str | 
    service_action = workplace_client.ServiceAction() # ServiceAction | 

    try:
        # Update subscription status
        api_response = api_instance.update_subscription_status(context_id, service_action)
        print("The response of SubscriptionsApi->update_subscription_status:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling SubscriptionsApi->update_subscription_status: %s\n" % e)

Parameters

Name Type Description Notes
context_id str
service_action ServiceAction

Return type

StandardResponse

Authorization

BearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success -

[Back to top] [Back to API list] [Back to Model list] [Back to README]