forked from salesforce/anypoint-client-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from mulesoft-anypoint/dev
API Manager Policy Client
- Loading branch information
Showing
91 changed files
with
15,343 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,5 +24,4 @@ model_duration.go | |
model_period.go | ||
model_recipient.go | ||
response.go | ||
test/api_default_test.go | ||
utils.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Compiled Object files, Static and Dynamic libs (Shared Objects) | ||
*.o | ||
*.a | ||
*.so | ||
|
||
# Folders | ||
_obj | ||
_test | ||
|
||
# Architecture specific extensions/prefixes | ||
*.[568vq] | ||
[568vq].out | ||
|
||
*.cgo1.go | ||
*.cgo2.c | ||
_cgo_defun.c | ||
_cgo_gotypes.go | ||
_cgo_export.* | ||
|
||
_testmain.go | ||
|
||
*.exe | ||
*.test | ||
*.prof |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# OpenAPI Generator Ignore | ||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator | ||
|
||
# Use this file to prevent files from being overwritten by the generator. | ||
# The patterns follow closely to .gitignore or .dockerignore. | ||
|
||
# As an example, the C# client generator defines ApiClient.cs. | ||
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: | ||
#ApiClient.cs | ||
|
||
# You can match any string of characters against a directory, file or extension with a single asterisk (*): | ||
#foo/*/qux | ||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux | ||
|
||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**): | ||
#foo/**/qux | ||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux | ||
|
||
# You can also negate patterns with an exclamation (!). | ||
# For example, you can ignore all files in a docs folder with the file extension .md: | ||
#docs/*.md | ||
# Then explicitly reverse the ignore rule for a single file: | ||
#!docs/README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
.gitignore | ||
.openapi-generator-ignore | ||
.travis.yml | ||
README.md | ||
api/openapi.yaml | ||
api_default.go | ||
client.go | ||
configuration.go | ||
docs/ApimPolicy.md | ||
docs/ApimPolicyBody.md | ||
docs/ApimPolicyCollection.md | ||
docs/ApimPolicyFull.md | ||
docs/ApimPolicyFullCollecion.md | ||
docs/ApimPolicyFullTemplate.md | ||
docs/Audit.md | ||
docs/AuditCreated.md | ||
docs/AutomatedPolicy.md | ||
docs/AutomatedPolicyCollection.md | ||
docs/AutomatedPolicyRuleOfApplication.md | ||
docs/DefaultApi.md | ||
docs/ErrorsResponse.md | ||
docs/ErrorsResponseErrorsInner.md | ||
docs/ExchangePolicyTemplate.md | ||
docs/ExchangePolicyTemplateAllVersionsInner.md | ||
docs/ExchangePolicyTemplateIdentityManagement.md | ||
docs/GetOrgAutomatedPolicies404Response.md | ||
docs/ImplementationAsset.md | ||
docs/PointcutDataItem.md | ||
docs/PolicyConfiguration.md | ||
docs/PolicyConfigurationConfigurationInner.md | ||
git_push.sh | ||
go.mod | ||
go.sum | ||
model_apim_policy.go | ||
model_apim_policy_body.go | ||
model_apim_policy_collection.go | ||
model_apim_policy_full.go | ||
model_apim_policy_full_collecion.go | ||
model_apim_policy_full_template.go | ||
model_audit.go | ||
model_audit_created.go | ||
model_automated_policy.go | ||
model_automated_policy_collection.go | ||
model_automated_policy_rule_of_application.go | ||
model_errors_response.go | ||
model_errors_response_errors_inner.go | ||
model_exchange_policy_template.go | ||
model_exchange_policy_template_all_versions_inner.go | ||
model_exchange_policy_template_identity_management.go | ||
model_get_org_automated_policies_404_response.go | ||
model_implementation_asset.go | ||
model_pointcut_data_item.go | ||
model_policy_configuration.go | ||
model_policy_configuration_configuration_inner.go | ||
response.go | ||
test/api_default_test.go | ||
utils.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
6.6.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
language: go | ||
|
||
install: | ||
- go get -d -v . | ||
|
||
script: | ||
- go build -v ./ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
# Go API client for apim_policy | ||
|
||
API Manager Policy API | ||
|
||
## Overview | ||
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. | ||
|
||
- API version: 1.0.0 | ||
- Package version: 1.0.0 | ||
- Build package: org.openapitools.codegen.languages.GoClientCodegen | ||
|
||
## Installation | ||
|
||
Install the following dependencies: | ||
|
||
```shell | ||
go get github.com/stretchr/testify/assert | ||
go get golang.org/x/net/context | ||
``` | ||
|
||
Put the package under your project folder and add the following in import: | ||
|
||
```golang | ||
import apim_policy "github.com/mulesoft-anypoint/anypoint-client-go/apim_policy" | ||
``` | ||
|
||
To use a proxy, set the environment variable `HTTP_PROXY`: | ||
|
||
```golang | ||
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") | ||
``` | ||
|
||
## Configuration of Server URL | ||
|
||
Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. | ||
|
||
### Select Server Configuration | ||
|
||
For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. | ||
|
||
```golang | ||
ctx := context.WithValue(context.Background(), apim_policy.ContextServerIndex, 1) | ||
``` | ||
|
||
### Templated Server URL | ||
|
||
Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. | ||
|
||
```golang | ||
ctx := context.WithValue(context.Background(), apim_policy.ContextServerVariables, map[string]string{ | ||
"basePath": "v2", | ||
}) | ||
``` | ||
|
||
Note, enum values are always validated and all unused variables are silently ignored. | ||
|
||
### URLs Configuration per Operation | ||
|
||
Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. | ||
An operation is uniquely identified by `"{classname}Service.{nickname}"` string. | ||
Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. | ||
|
||
```golang | ||
ctx := context.WithValue(context.Background(), apim_policy.ContextOperationServerIndices, map[string]int{ | ||
"{classname}Service.{nickname}": 2, | ||
}) | ||
ctx = context.WithValue(context.Background(), apim_policy.ContextOperationServerVariables, map[string]map[string]string{ | ||
"{classname}Service.{nickname}": { | ||
"port": "8443", | ||
}, | ||
}) | ||
``` | ||
|
||
## Documentation for API Endpoints | ||
|
||
All URIs are relative to *https://anypoint.mulesoft.com/apimanager* | ||
|
||
Class | Method | HTTP request | Description | ||
------------ | ------------- | ------------- | ------------- | ||
*DefaultApi* | [**DeleteApimPolicy**](docs/DefaultApi.md#deleteapimpolicy) | **Delete** /api/v1/organizations/{orgId}/environments/{envId}/apis/{apiId}/policies/{apiPolicyId} | Delete a specific api manager instance policy. | ||
*DefaultApi* | [**DisableApimPolicy**](docs/DefaultApi.md#disableapimpolicy) | **Post** /xapi/v1/organizations/{orgId}/environments/{envId}/apis/{apiId}/policies/{apiPolicyId}/disable | Disable a specific api manager instance policy. | ||
*DefaultApi* | [**EnableApimPolicy**](docs/DefaultApi.md#enableapimpolicy) | **Post** /xapi/v1/organizations/{orgId}/environments/{envId}/apis/{apiId}/policies/{apiPolicyId}/enable | Enable a specific api manager instance policy. | ||
*DefaultApi* | [**GetApimPolicies**](docs/DefaultApi.md#getapimpolicies) | **Get** /api/v1/organizations/{orgId}/environments/{envId}/apis/{apiId}/policies | Retrieve all of api manager instance policies. | ||
*DefaultApi* | [**GetApimPolicy**](docs/DefaultApi.md#getapimpolicy) | **Get** /api/v1/organizations/{orgId}/environments/{envId}/apis/{apiId}/policies/{apiPolicyId} | Retrieve a specific api manager instance policy. | ||
*DefaultApi* | [**GetOrgAutomatedPolicies**](docs/DefaultApi.md#getorgautomatedpolicies) | **Get** /api/v1/organizations/{orgId}/automated-policies | Retrieve all automated policies of a given organization | ||
*DefaultApi* | [**GetOrgCustomPolicyTemplates**](docs/DefaultApi.md#getorgcustompolicytemplates) | **Get** /api/v1/organizations/{orgId}/custom-policy-templates | Retrieve all or part of custom policy templates of a given organization | ||
*DefaultApi* | [**GetOrgExchangePolicyTemplateDetails**](docs/DefaultApi.md#getorgexchangepolicytemplatedetails) | **Get** /xapi/v1/organizations/{orgId}/exchange-policy-templates/{groupId}/{assetId}/{assetVersion} | Retrieve details of exchange policy template of a given organization | ||
*DefaultApi* | [**GetOrgExchangePolicyTemplates**](docs/DefaultApi.md#getorgexchangepolicytemplates) | **Get** /xapi/v1/organizations/{orgId}/exchange-policy-templates | Retrieve all or part of exchange policy templates of a given organization | ||
*DefaultApi* | [**PatchApimPolicy**](docs/DefaultApi.md#patchapimpolicy) | **Patch** /api/v1/organizations/{orgId}/environments/{envId}/apis/{apiId}/policies/{apiPolicyId} | Update a specific api manager instance policy. | ||
*DefaultApi* | [**PostApimPolicy**](docs/DefaultApi.md#postapimpolicy) | **Post** /api/v1/organizations/{orgId}/environments/{envId}/apis/{apiId}/policies | Create an api manager instance policy. | ||
|
||
|
||
## Documentation For Models | ||
|
||
- [ApimPolicy](docs/ApimPolicy.md) | ||
- [ApimPolicyBody](docs/ApimPolicyBody.md) | ||
- [ApimPolicyCollection](docs/ApimPolicyCollection.md) | ||
- [ApimPolicyFull](docs/ApimPolicyFull.md) | ||
- [ApimPolicyFullCollecion](docs/ApimPolicyFullCollecion.md) | ||
- [ApimPolicyFullTemplate](docs/ApimPolicyFullTemplate.md) | ||
- [Audit](docs/Audit.md) | ||
- [AuditCreated](docs/AuditCreated.md) | ||
- [AutomatedPolicy](docs/AutomatedPolicy.md) | ||
- [AutomatedPolicyCollection](docs/AutomatedPolicyCollection.md) | ||
- [AutomatedPolicyRuleOfApplication](docs/AutomatedPolicyRuleOfApplication.md) | ||
- [ErrorsResponse](docs/ErrorsResponse.md) | ||
- [ErrorsResponseErrorsInner](docs/ErrorsResponseErrorsInner.md) | ||
- [ExchangePolicyTemplate](docs/ExchangePolicyTemplate.md) | ||
- [ExchangePolicyTemplateAllVersionsInner](docs/ExchangePolicyTemplateAllVersionsInner.md) | ||
- [ExchangePolicyTemplateIdentityManagement](docs/ExchangePolicyTemplateIdentityManagement.md) | ||
- [GetOrgAutomatedPolicies404Response](docs/GetOrgAutomatedPolicies404Response.md) | ||
- [ImplementationAsset](docs/ImplementationAsset.md) | ||
- [PointcutDataItem](docs/PointcutDataItem.md) | ||
- [PolicyConfiguration](docs/PolicyConfiguration.md) | ||
- [PolicyConfigurationConfigurationInner](docs/PolicyConfigurationConfigurationInner.md) | ||
|
||
|
||
## Documentation For Authorization | ||
|
||
|
||
Authentication schemes defined for the API: | ||
### bearerAuth | ||
|
||
- **Type**: HTTP Bearer token authentication | ||
|
||
Example | ||
|
||
```golang | ||
auth := context.WithValue(context.Background(), sw.ContextAccessToken, "BEARER_TOKEN_STRING") | ||
r, err := client.Service.Operation(auth, args) | ||
``` | ||
|
||
|
||
## Documentation for Utility Methods | ||
|
||
Due to the fact that model structure members are all pointers, this package contains | ||
a number of utility functions to easily obtain pointers to values of basic types. | ||
Each of these functions takes a value of the given basic type and returns a pointer to it: | ||
|
||
* `PtrBool` | ||
* `PtrInt` | ||
* `PtrInt32` | ||
* `PtrInt64` | ||
* `PtrFloat` | ||
* `PtrFloat32` | ||
* `PtrFloat64` | ||
* `PtrString` | ||
* `PtrTime` | ||
|
||
## Author | ||
|
||
|
||
|
Oops, something went wrong.