# OperationPoliciesApi

All URIs are relative to *https://apis.wso2.com/api/am/publisher/v3*

Method | HTTP request | Description
------------- | ------------- | -------------
[**addCommonOperationPolicy**](OperationPoliciesApi.md#addCommonOperationPolicy) | **POST** /operation-policies | Add a new common operation policy
[**deleteCommonOperationPolicyByPolicyId**](OperationPoliciesApi.md#deleteCommonOperationPolicyByPolicyId) | **DELETE** /operation-policies/{operationPolicyId} | Delete a common operation policy
[**exportOperationPolicySpecificationSchema**](OperationPoliciesApi.md#exportOperationPolicySpecificationSchema) | **GET** /operation-policies/specification/schema | Export the operation policies specification schema.
[**getAllCommonOperationPolicies**](OperationPoliciesApi.md#getAllCommonOperationPolicies) | **GET** /operation-policies | Get all common operation policies to all the APIs 
[**getCommonOperationPolicyByPolicyId**](OperationPoliciesApi.md#getCommonOperationPolicyByPolicyId) | **GET** /operation-policies/{operationPolicyId} | Get the details of a common operation policy by providing policy ID
[**getCommonOperationPolicyContentByPolicyId**](OperationPoliciesApi.md#getCommonOperationPolicyContentByPolicyId) | **GET** /operation-policies/{operationPolicyId}/content | Download a common operation policy


<a name="addCommonOperationPolicy"></a>
# **addCommonOperationPolicy**
> OperationPolicyDataDTO addCommonOperationPolicy(policySpecFile, synapsePolicyDefinitionFile, ccPolicyDefinitionFile)

Add a new common operation policy

This operation can be used to add a new common operation policy. 

### Example
```java
// Import classes:
import org.wso2.am.integration.clients.publisher.api.ApiClient;
import org.wso2.am.integration.clients.publisher.api.ApiException;
import org.wso2.am.integration.clients.publisher.api.Configuration;
import org.wso2.am.integration.clients.publisher.api.auth.*;
import org.wso2.am.integration.clients.publisher.api.models.*;
import org.wso2.am.integration.clients.publisher.api.v1.OperationPoliciesApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://apis.wso2.com/api/am/publisher/v3");
    
    // Configure OAuth2 access token for authorization: OAuth2Security
    OAuth OAuth2Security = (OAuth) defaultClient.getAuthentication("OAuth2Security");
    OAuth2Security.setAccessToken("YOUR ACCESS TOKEN");

    OperationPoliciesApi apiInstance = new OperationPoliciesApi(defaultClient);
    File policySpecFile = new File("/path/to/file"); // File | Operation policy specification to upload
    File synapsePolicyDefinitionFile = new File("/path/to/file"); // File | Operation policy definition of synapse gateway to upload
    File ccPolicyDefinitionFile = new File("/path/to/file"); // File | Operation policy definition of choreo connect to upload
    try {
      OperationPolicyDataDTO result = apiInstance.addCommonOperationPolicy(policySpecFile, synapsePolicyDefinitionFile, ccPolicyDefinitionFile);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling OperationPoliciesApi#addCommonOperationPolicy");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **policySpecFile** | **File**| Operation policy specification to upload | [optional]
 **synapsePolicyDefinitionFile** | **File**| Operation policy definition of synapse gateway to upload | [optional]
 **ccPolicyDefinitionFile** | **File**| Operation policy definition of choreo connect to upload | [optional]

### Return type

[**OperationPolicyDataDTO**](OperationPolicyDataDTO.md)

### Authorization

[OAuth2Security](../README.md#OAuth2Security)

### HTTP request headers

 - **Content-Type**: multipart/form-data
 - **Accept**: application/json

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**201** | OK. Shared operation policy uploaded  |  * Location - The URL of the uploaded mediation policy of the API.  <br>  * Content-Type - The content type of the body.  <br>  |
**400** | Bad Request. Invalid request or validation error. |  -  |
**404** | Not Found. The specified resource does not exist. |  -  |

<a name="deleteCommonOperationPolicyByPolicyId"></a>
# **deleteCommonOperationPolicyByPolicyId**
> deleteCommonOperationPolicyByPolicyId(operationPolicyId)

Delete a common operation policy

This operation can be used to delete an existing common opreation policy by providing the Id of the policy. 

### Example
```java
// Import classes:
import org.wso2.am.integration.clients.publisher.api.ApiClient;
import org.wso2.am.integration.clients.publisher.api.ApiException;
import org.wso2.am.integration.clients.publisher.api.Configuration;
import org.wso2.am.integration.clients.publisher.api.auth.*;
import org.wso2.am.integration.clients.publisher.api.models.*;
import org.wso2.am.integration.clients.publisher.api.v1.OperationPoliciesApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://apis.wso2.com/api/am/publisher/v3");
    
    // Configure OAuth2 access token for authorization: OAuth2Security
    OAuth OAuth2Security = (OAuth) defaultClient.getAuthentication("OAuth2Security");
    OAuth2Security.setAccessToken("YOUR ACCESS TOKEN");

    OperationPoliciesApi apiInstance = new OperationPoliciesApi(defaultClient);
    String operationPolicyId = "operationPolicyId_example"; // String | Operation policy Id 
    try {
      apiInstance.deleteCommonOperationPolicyByPolicyId(operationPolicyId);
    } catch (ApiException e) {
      System.err.println("Exception when calling OperationPoliciesApi#deleteCommonOperationPolicyByPolicyId");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **operationPolicyId** | **String**| Operation policy Id  |

### Return type

null (empty response body)

### Authorization

[OAuth2Security](../README.md#OAuth2Security)

### HTTP request headers

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

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | OK. Resource successfully deleted.  |  -  |
**403** | Forbidden. The request must be conditional but no condition has been specified. |  -  |
**404** | Not Found. The specified resource does not exist. |  -  |

<a name="exportOperationPolicySpecificationSchema"></a>
# **exportOperationPolicySpecificationSchema**
> String exportOperationPolicySpecificationSchema()

Export the operation policies specification schema.

This operation can be used to export the operation-policy-specification-schema.json used in deployment. 

### Example
```java
// Import classes:
import org.wso2.am.integration.clients.publisher.api.ApiClient;
import org.wso2.am.integration.clients.publisher.api.ApiException;
import org.wso2.am.integration.clients.publisher.api.Configuration;
import org.wso2.am.integration.clients.publisher.api.auth.*;
import org.wso2.am.integration.clients.publisher.api.models.*;
import org.wso2.am.integration.clients.publisher.api.v1.OperationPoliciesApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://apis.wso2.com/api/am/publisher/v3");
    
    // Configure OAuth2 access token for authorization: OAuth2Security
    OAuth OAuth2Security = (OAuth) defaultClient.getAuthentication("OAuth2Security");
    OAuth2Security.setAccessToken("YOUR ACCESS TOKEN");

    OperationPoliciesApi apiInstance = new OperationPoliciesApi(defaultClient);
    try {
      String result = apiInstance.exportOperationPolicySpecificationSchema();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling OperationPoliciesApi#exportOperationPolicySpecificationSchema");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

### Parameters
This endpoint does not need any parameter.

### Return type

**String**

### Authorization

[OAuth2Security](../README.md#OAuth2Security)

### HTTP request headers

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

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | OK. Operation policy specification schema exported successfully.  |  * Content-Type - The content type of the body.  <br>  |
**403** | Forbidden. The request must be conditional but no condition has been specified. |  -  |
**404** | Not Found. The specified resource does not exist. |  -  |
**500** | Internal Server Error. |  -  |

<a name="getAllCommonOperationPolicies"></a>
# **getAllCommonOperationPolicies**
> OperationPolicyDataListDTO getAllCommonOperationPolicies(limit, offset, query)

Get all common operation policies to all the APIs 

This operation provides you a list of all common operation policies that can be used by any API 

### Example
```java
// Import classes:
import org.wso2.am.integration.clients.publisher.api.ApiClient;
import org.wso2.am.integration.clients.publisher.api.ApiException;
import org.wso2.am.integration.clients.publisher.api.Configuration;
import org.wso2.am.integration.clients.publisher.api.auth.*;
import org.wso2.am.integration.clients.publisher.api.models.*;
import org.wso2.am.integration.clients.publisher.api.v1.OperationPoliciesApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://apis.wso2.com/api/am/publisher/v3");
    
    // Configure OAuth2 access token for authorization: OAuth2Security
    OAuth OAuth2Security = (OAuth) defaultClient.getAuthentication("OAuth2Security");
    OAuth2Security.setAccessToken("YOUR ACCESS TOKEN");

    OperationPoliciesApi apiInstance = new OperationPoliciesApi(defaultClient);
    Integer limit = 25; // Integer | Maximum size of resource array to return. 
    Integer offset = 0; // Integer | Starting point within the complete list of items qualified. 
    String query = "query_example"; // String | -Not supported yet-
    try {
      OperationPolicyDataListDTO result = apiInstance.getAllCommonOperationPolicies(limit, offset, query);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling OperationPoliciesApi#getAllCommonOperationPolicies");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **limit** | **Integer**| Maximum size of resource array to return.  | [optional] [default to 25]
 **offset** | **Integer**| Starting point within the complete list of items qualified.  | [optional] [default to 0]
 **query** | **String**| -Not supported yet- | [optional]

### Return type

[**OperationPolicyDataListDTO**](OperationPolicyDataListDTO.md)

### Authorization

[OAuth2Security](../README.md#OAuth2Security)

### HTTP request headers

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

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | OK. List of qualifying policies is returned.  |  * Content-Type - The content type of the body. <br>  |
**406** | Not Acceptable. The requested media type is not supported. |  -  |

<a name="getCommonOperationPolicyByPolicyId"></a>
# **getCommonOperationPolicyByPolicyId**
> OperationPolicyDataDTO getCommonOperationPolicyByPolicyId(operationPolicyId)

Get the details of a common operation policy by providing policy ID

This operation can be used to retrieve a particular common operation policy. 

### Example
```java
// Import classes:
import org.wso2.am.integration.clients.publisher.api.ApiClient;
import org.wso2.am.integration.clients.publisher.api.ApiException;
import org.wso2.am.integration.clients.publisher.api.Configuration;
import org.wso2.am.integration.clients.publisher.api.auth.*;
import org.wso2.am.integration.clients.publisher.api.models.*;
import org.wso2.am.integration.clients.publisher.api.v1.OperationPoliciesApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://apis.wso2.com/api/am/publisher/v3");
    
    // Configure OAuth2 access token for authorization: OAuth2Security
    OAuth OAuth2Security = (OAuth) defaultClient.getAuthentication("OAuth2Security");
    OAuth2Security.setAccessToken("YOUR ACCESS TOKEN");

    OperationPoliciesApi apiInstance = new OperationPoliciesApi(defaultClient);
    String operationPolicyId = "operationPolicyId_example"; // String | Operation policy Id 
    try {
      OperationPolicyDataDTO result = apiInstance.getCommonOperationPolicyByPolicyId(operationPolicyId);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling OperationPoliciesApi#getCommonOperationPolicyByPolicyId");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **operationPolicyId** | **String**| Operation policy Id  |

### Return type

[**OperationPolicyDataDTO**](OperationPolicyDataDTO.md)

### Authorization

[OAuth2Security](../README.md#OAuth2Security)

### HTTP request headers

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

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | OK. Operation policy returned.  |  * Content-Type - The content type of the body.  <br>  |
**404** | Not Found. The specified resource does not exist. |  -  |
**406** | Not Acceptable. The requested media type is not supported. |  -  |

<a name="getCommonOperationPolicyContentByPolicyId"></a>
# **getCommonOperationPolicyContentByPolicyId**
> File getCommonOperationPolicyContentByPolicyId(operationPolicyId)

Download a common operation policy

This operation can be used to download a selected common operation policy. 

### Example
```java
// Import classes:
import org.wso2.am.integration.clients.publisher.api.ApiClient;
import org.wso2.am.integration.clients.publisher.api.ApiException;
import org.wso2.am.integration.clients.publisher.api.Configuration;
import org.wso2.am.integration.clients.publisher.api.auth.*;
import org.wso2.am.integration.clients.publisher.api.models.*;
import org.wso2.am.integration.clients.publisher.api.v1.OperationPoliciesApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://apis.wso2.com/api/am/publisher/v3");
    
    // Configure OAuth2 access token for authorization: OAuth2Security
    OAuth OAuth2Security = (OAuth) defaultClient.getAuthentication("OAuth2Security");
    OAuth2Security.setAccessToken("YOUR ACCESS TOKEN");

    OperationPoliciesApi apiInstance = new OperationPoliciesApi(defaultClient);
    String operationPolicyId = "operationPolicyId_example"; // String | Operation policy Id 
    try {
      File result = apiInstance.getCommonOperationPolicyContentByPolicyId(operationPolicyId);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling OperationPoliciesApi#getCommonOperationPolicyContentByPolicyId");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **operationPolicyId** | **String**| Operation policy Id  |

### Return type

[**File**](File.md)

### Authorization

[OAuth2Security](../README.md#OAuth2Security)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/zip, application/json

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | OK. Operation policy returned.  |  * Content-Type - The content type of the body.  <br>  |
**404** | Not Found. The specified resource does not exist. |  -  |

