github.com/safedep/dry@v0.0.0-20241016050132-a15651f0548b/apiguard/tykgen/docs/PoliciesApi.md (about) 1 # {{classname}} 2 3 All URIs are relative to *http://localhost/* 4 5 Method | HTTP request | Description 6 ------------- | ------------- | ------------- 7 [**AddPolicy**](PoliciesApi.md#AddPolicy) | **Post** /tyk/policies | Create a Policy 8 [**DeletePolicy**](PoliciesApi.md#DeletePolicy) | **Delete** /tyk/policies/{polID} | Delete a Policy 9 [**GetPolicy**](PoliciesApi.md#GetPolicy) | **Get** /tyk/policies/{polID} | Get a Policy 10 [**ListPolicies**](PoliciesApi.md#ListPolicies) | **Get** /tyk/policies | List Policies 11 [**UpdatePolicy**](PoliciesApi.md#UpdatePolicy) | **Put** /tyk/policies/{polID} | Update a Policy 12 13 # **AddPolicy** 14 > ApiModifyKeySuccess AddPolicy(ctx, optional) 15 Create a Policy 16 17 You can create a Policy in your Tyk Instance 18 19 ### Required Parameters 20 21 Name | Type | Description | Notes 22 ------------- | ------------- | ------------- | ------------- 23 **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. 24 **optional** | ***PoliciesApiAddPolicyOpts** | optional parameters | nil if no parameters 25 26 ### Optional Parameters 27 Optional parameters are passed through a pointer to a PoliciesApiAddPolicyOpts struct 28 Name | Type | Description | Notes 29 ------------- | ------------- | ------------- | ------------- 30 **body** | [**optional.Interface of Policy**](Policy.md)| | 31 32 ### Return type 33 34 [**ApiModifyKeySuccess**](apiModifyKeySuccess.md) 35 36 ### Authorization 37 38 [api_key](../README.md#api_key) 39 40 ### HTTP request headers 41 42 - **Content-Type**: application/json 43 - **Accept**: application/json 44 45 [[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) 46 47 # **DeletePolicy** 48 > ApiModifyKeySuccess DeletePolicy(ctx, polID) 49 Delete a Policy 50 51 Delete a policy by ID in your Tyk instance. 52 53 ### Required Parameters 54 55 Name | Type | Description | Notes 56 ------------- | ------------- | ------------- | ------------- 57 **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. 58 **polID** | **string**| The policy ID | 59 60 ### Return type 61 62 [**ApiModifyKeySuccess**](apiModifyKeySuccess.md) 63 64 ### Authorization 65 66 [api_key](../README.md#api_key) 67 68 ### HTTP request headers 69 70 - **Content-Type**: Not defined 71 - **Accept**: application/json 72 73 [[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) 74 75 # **GetPolicy** 76 > Policy GetPolicy(ctx, polID) 77 Get a Policy 78 79 You can retrieve details of a single policy by ID in your Tyk instance. Returns an array policies. 80 81 ### Required Parameters 82 83 Name | Type | Description | Notes 84 ------------- | ------------- | ------------- | ------------- 85 **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. 86 **polID** | **string**| The policy ID | 87 88 ### Return type 89 90 [**Policy**](Policy.md) 91 92 ### Authorization 93 94 [api_key](../README.md#api_key) 95 96 ### HTTP request headers 97 98 - **Content-Type**: Not defined 99 - **Accept**: application/json 100 101 [[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) 102 103 # **ListPolicies** 104 > []Policy ListPolicies(ctx, ) 105 List Policies 106 107 You can retrieve all the policies in your Tyk instance. Returns an array policies. 108 109 ### Required Parameters 110 This endpoint does not need any parameter. 111 112 ### Return type 113 114 [**[]Policy**](Policy.md) 115 116 ### Authorization 117 118 [api_key](../README.md#api_key) 119 120 ### HTTP request headers 121 122 - **Content-Type**: Not defined 123 - **Accept**: application/json 124 125 [[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) 126 127 # **UpdatePolicy** 128 > ApiModifyKeySuccess UpdatePolicy(ctx, polID, optional) 129 Update a Policy 130 131 You can update a Policy in your Tyk Instance by ID 132 133 ### Required Parameters 134 135 Name | Type | Description | Notes 136 ------------- | ------------- | ------------- | ------------- 137 **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. 138 **polID** | **string**| The policy ID | 139 **optional** | ***PoliciesApiUpdatePolicyOpts** | optional parameters | nil if no parameters 140 141 ### Optional Parameters 142 Optional parameters are passed through a pointer to a PoliciesApiUpdatePolicyOpts struct 143 Name | Type | Description | Notes 144 ------------- | ------------- | ------------- | ------------- 145 146 **body** | [**optional.Interface of Policy**](Policy.md)| | 147 148 ### Return type 149 150 [**ApiModifyKeySuccess**](apiModifyKeySuccess.md) 151 152 ### Authorization 153 154 [api_key](../README.md#api_key) 155 156 ### HTTP request headers 157 158 - **Content-Type**: application/json 159 - **Accept**: application/json 160 161 [[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) 162