|
| 1 | +# hyperstack.EmailOptInOutApi |
| 2 | + |
| 3 | +All URIs are relative to *https://infrahub-api.nexgencloud.com/v1* |
| 4 | + |
| 5 | +Method | HTTP request | Description |
| 6 | +------------- | ------------- | ------------- |
| 7 | +[**get_email_preferences_for_a_user**](EmailOptInOutApi.md#get_email_preferences_for_a_user) | **GET** /auth/email/opt-out | Get all email preferences for the authenticated user |
| 8 | +[**toggle_all_optional_email_preferences_for_the_user**](EmailOptInOutApi.md#toggle_all_optional_email_preferences_for_the_user) | **PUT** /auth/email/opt-out | Toggle all optional email preferences for the authenticated user |
| 9 | +[**update_email_preference_for_a_category_by_slug**](EmailOptInOutApi.md#update_email_preference_for_a_category_by_slug) | **PUT** /auth/email/opt-out/{slug} | Update email preference opted_in status for a category slug |
| 10 | + |
| 11 | + |
| 12 | +# **get_email_preferences_for_a_user** |
| 13 | +> EmailPreferencesResponse get_email_preferences_for_a_user() |
| 14 | +
|
| 15 | +Get all email preferences for the authenticated user |
| 16 | + |
| 17 | +Returns all email categories with the user's opt-in status. Categories without an explicit preference default to opted_in=true. |
| 18 | + |
| 19 | +### Example |
| 20 | + |
| 21 | +* Api Key Authentication (apiKey): |
| 22 | + |
| 23 | +```python |
| 24 | +import hyperstack |
| 25 | +from hyperstack.models.email_preferences_response import EmailPreferencesResponse |
| 26 | +from hyperstack.rest import ApiException |
| 27 | +from pprint import pprint |
| 28 | + |
| 29 | +# Defining the host is optional and defaults to https://infrahub-api.nexgencloud.com/v1 |
| 30 | +# See configuration.py for a list of all supported configuration parameters. |
| 31 | +configuration = hyperstack.Configuration( |
| 32 | + host = "https://infrahub-api.nexgencloud.com/v1" |
| 33 | +) |
| 34 | + |
| 35 | +# The client must configure the authentication and authorization parameters |
| 36 | +# in accordance with the API server security policy. |
| 37 | +# Examples for each auth method are provided below, use the example that |
| 38 | +# satisfies your auth use case. |
| 39 | + |
| 40 | +# Configure API key authorization: apiKey |
| 41 | +configuration.api_key['apiKey'] = os.environ["API_KEY"] |
| 42 | + |
| 43 | +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
| 44 | +# configuration.api_key_prefix['apiKey'] = 'Bearer' |
| 45 | + |
| 46 | +# Enter a context with an instance of the API client |
| 47 | +with hyperstack.ApiClient(configuration) as api_client: |
| 48 | + # Create an instance of the API class |
| 49 | + api_instance = hyperstack.EmailOptInOutApi(api_client) |
| 50 | + |
| 51 | + try: |
| 52 | + # Get all email preferences for the authenticated user |
| 53 | + api_response = api_instance.get_email_preferences_for_a_user() |
| 54 | + print("The response of EmailOptInOutApi->get_email_preferences_for_a_user:\n") |
| 55 | + pprint(api_response) |
| 56 | + except Exception as e: |
| 57 | + print("Exception when calling EmailOptInOutApi->get_email_preferences_for_a_user: %s\n" % e) |
| 58 | +``` |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | +### Parameters |
| 63 | + |
| 64 | +This endpoint does not need any parameter. |
| 65 | + |
| 66 | +### Return type |
| 67 | + |
| 68 | +[**EmailPreferencesResponse**](EmailPreferencesResponse.md) |
| 69 | + |
| 70 | +### Authorization |
| 71 | + |
| 72 | +[apiKey](../README.md#apiKey) |
| 73 | + |
| 74 | +### HTTP request headers |
| 75 | + |
| 76 | + - **Content-Type**: Not defined |
| 77 | + - **Accept**: application/json |
| 78 | + |
| 79 | +### HTTP response details |
| 80 | + |
| 81 | +| Status code | Description | Response headers | |
| 82 | +|-------------|-------------|------------------| |
| 83 | +**200** | Success | - | |
| 84 | +**401** | Unauthorized | - | |
| 85 | +**500** | Internal Server Error | - | |
| 86 | + |
| 87 | +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) |
| 88 | + |
| 89 | +# **toggle_all_optional_email_preferences_for_the_user** |
| 90 | +> UpdateEmailPreferenceResponse toggle_all_optional_email_preferences_for_the_user(payload) |
| 91 | +
|
| 92 | +Toggle all optional email preferences for the authenticated user |
| 93 | + |
| 94 | +Sets opted_in to the given value for every non-required, non-deleted email category. Required categories are not affected. |
| 95 | + |
| 96 | +### Example |
| 97 | + |
| 98 | +* Api Key Authentication (apiKey): |
| 99 | + |
| 100 | +```python |
| 101 | +import hyperstack |
| 102 | +from hyperstack.models.update_email_preference_input import UpdateEmailPreferenceInput |
| 103 | +from hyperstack.models.update_email_preference_response import UpdateEmailPreferenceResponse |
| 104 | +from hyperstack.rest import ApiException |
| 105 | +from pprint import pprint |
| 106 | + |
| 107 | +# Defining the host is optional and defaults to https://infrahub-api.nexgencloud.com/v1 |
| 108 | +# See configuration.py for a list of all supported configuration parameters. |
| 109 | +configuration = hyperstack.Configuration( |
| 110 | + host = "https://infrahub-api.nexgencloud.com/v1" |
| 111 | +) |
| 112 | + |
| 113 | +# The client must configure the authentication and authorization parameters |
| 114 | +# in accordance with the API server security policy. |
| 115 | +# Examples for each auth method are provided below, use the example that |
| 116 | +# satisfies your auth use case. |
| 117 | + |
| 118 | +# Configure API key authorization: apiKey |
| 119 | +configuration.api_key['apiKey'] = os.environ["API_KEY"] |
| 120 | + |
| 121 | +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
| 122 | +# configuration.api_key_prefix['apiKey'] = 'Bearer' |
| 123 | + |
| 124 | +# Enter a context with an instance of the API client |
| 125 | +with hyperstack.ApiClient(configuration) as api_client: |
| 126 | + # Create an instance of the API class |
| 127 | + api_instance = hyperstack.EmailOptInOutApi(api_client) |
| 128 | + payload = hyperstack.UpdateEmailPreferenceInput() # UpdateEmailPreferenceInput | |
| 129 | + |
| 130 | + try: |
| 131 | + # Toggle all optional email preferences for the authenticated user |
| 132 | + api_response = api_instance.toggle_all_optional_email_preferences_for_the_user(payload) |
| 133 | + print("The response of EmailOptInOutApi->toggle_all_optional_email_preferences_for_the_user:\n") |
| 134 | + pprint(api_response) |
| 135 | + except Exception as e: |
| 136 | + print("Exception when calling EmailOptInOutApi->toggle_all_optional_email_preferences_for_the_user: %s\n" % e) |
| 137 | +``` |
| 138 | + |
| 139 | + |
| 140 | + |
| 141 | +### Parameters |
| 142 | + |
| 143 | + |
| 144 | +Name | Type | Description | Notes |
| 145 | +------------- | ------------- | ------------- | ------------- |
| 146 | + **payload** | [**UpdateEmailPreferenceInput**](UpdateEmailPreferenceInput.md)| | |
| 147 | + |
| 148 | +### Return type |
| 149 | + |
| 150 | +[**UpdateEmailPreferenceResponse**](UpdateEmailPreferenceResponse.md) |
| 151 | + |
| 152 | +### Authorization |
| 153 | + |
| 154 | +[apiKey](../README.md#apiKey) |
| 155 | + |
| 156 | +### HTTP request headers |
| 157 | + |
| 158 | + - **Content-Type**: application/json |
| 159 | + - **Accept**: application/json |
| 160 | + |
| 161 | +### HTTP response details |
| 162 | + |
| 163 | +| Status code | Description | Response headers | |
| 164 | +|-------------|-------------|------------------| |
| 165 | +**200** | Success | - | |
| 166 | +**400** | Bad Request | - | |
| 167 | +**401** | Unauthorized | - | |
| 168 | +**500** | Internal Server Error | - | |
| 169 | + |
| 170 | +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) |
| 171 | + |
| 172 | +# **update_email_preference_for_a_category_by_slug** |
| 173 | +> UpdateEmailPreferenceResponse update_email_preference_for_a_category_by_slug(slug, payload) |
| 174 | +
|
| 175 | +Update email preference opted_in status for a category slug |
| 176 | + |
| 177 | +Updates the opted_in status for the given email category slug. If the slug belongs to a parent category (email_category_id is null), all non-deleted child categories are updated. If the slug belongs to a child category, only that category is updated. |
| 178 | + |
| 179 | +### Example |
| 180 | + |
| 181 | +* Api Key Authentication (apiKey): |
| 182 | + |
| 183 | +```python |
| 184 | +import hyperstack |
| 185 | +from hyperstack.models.update_email_preference_input import UpdateEmailPreferenceInput |
| 186 | +from hyperstack.models.update_email_preference_response import UpdateEmailPreferenceResponse |
| 187 | +from hyperstack.rest import ApiException |
| 188 | +from pprint import pprint |
| 189 | + |
| 190 | +# Defining the host is optional and defaults to https://infrahub-api.nexgencloud.com/v1 |
| 191 | +# See configuration.py for a list of all supported configuration parameters. |
| 192 | +configuration = hyperstack.Configuration( |
| 193 | + host = "https://infrahub-api.nexgencloud.com/v1" |
| 194 | +) |
| 195 | + |
| 196 | +# The client must configure the authentication and authorization parameters |
| 197 | +# in accordance with the API server security policy. |
| 198 | +# Examples for each auth method are provided below, use the example that |
| 199 | +# satisfies your auth use case. |
| 200 | + |
| 201 | +# Configure API key authorization: apiKey |
| 202 | +configuration.api_key['apiKey'] = os.environ["API_KEY"] |
| 203 | + |
| 204 | +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
| 205 | +# configuration.api_key_prefix['apiKey'] = 'Bearer' |
| 206 | + |
| 207 | +# Enter a context with an instance of the API client |
| 208 | +with hyperstack.ApiClient(configuration) as api_client: |
| 209 | + # Create an instance of the API class |
| 210 | + api_instance = hyperstack.EmailOptInOutApi(api_client) |
| 211 | + slug = 'slug_example' # str | |
| 212 | + payload = hyperstack.UpdateEmailPreferenceInput() # UpdateEmailPreferenceInput | |
| 213 | + |
| 214 | + try: |
| 215 | + # Update email preference opted_in status for a category slug |
| 216 | + api_response = api_instance.update_email_preference_for_a_category_by_slug(slug, payload) |
| 217 | + print("The response of EmailOptInOutApi->update_email_preference_for_a_category_by_slug:\n") |
| 218 | + pprint(api_response) |
| 219 | + except Exception as e: |
| 220 | + print("Exception when calling EmailOptInOutApi->update_email_preference_for_a_category_by_slug: %s\n" % e) |
| 221 | +``` |
| 222 | + |
| 223 | + |
| 224 | + |
| 225 | +### Parameters |
| 226 | + |
| 227 | + |
| 228 | +Name | Type | Description | Notes |
| 229 | +------------- | ------------- | ------------- | ------------- |
| 230 | + **slug** | **str**| | |
| 231 | + **payload** | [**UpdateEmailPreferenceInput**](UpdateEmailPreferenceInput.md)| | |
| 232 | + |
| 233 | +### Return type |
| 234 | + |
| 235 | +[**UpdateEmailPreferenceResponse**](UpdateEmailPreferenceResponse.md) |
| 236 | + |
| 237 | +### Authorization |
| 238 | + |
| 239 | +[apiKey](../README.md#apiKey) |
| 240 | + |
| 241 | +### HTTP request headers |
| 242 | + |
| 243 | + - **Content-Type**: application/json |
| 244 | + - **Accept**: application/json |
| 245 | + |
| 246 | +### HTTP response details |
| 247 | + |
| 248 | +| Status code | Description | Response headers | |
| 249 | +|-------------|-------------|------------------| |
| 250 | +**200** | Success | - | |
| 251 | +**400** | Bad Request | - | |
| 252 | +**401** | Unauthorized | - | |
| 253 | +**404** | Email category not found | - | |
| 254 | +**500** | Internal Server Error | - | |
| 255 | + |
| 256 | +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) |
| 257 | + |
0 commit comments