md-validator-client 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 87924755757ddb12b4b98cd442d52d23608366dddc3ddf8d25c408851fe82203
4
+ data.tar.gz: c585a69dadd03bc376bc7c53054300ae3b22d6aab1b57ff2f891839e4729cdf1
5
+ SHA512:
6
+ metadata.gz: 48f113221d7046ca7e310bb31284f0dad868c4de48e5ac699751169af09c8e10f85ceb0f5a8d880880de01d65c2e741aaaa7008b8a3500f599a18ab8d0117a69
7
+ data.tar.gz: 327ad5785c2221fca37165226cd29a5e8cb331787f2e823449d0d4b6bfd30b22a0be29920fa2c206ad21147fe53821167b0c71adeaef0238ef3faa6474353e61
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ group :development, :test do
6
+ gem 'rake', '~> 12.3.3'
7
+ end
@@ -0,0 +1,89 @@
1
+ # md-validator-client
2
+
3
+ ValidatorClient - the Ruby gem for the Metadata Validation API
4
+
5
+ API for the metadata validation service.
6
+
7
+ This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
8
+
9
+ - API version: 1.0.0
10
+ - Package version: 1.0.1
11
+ - Build package: io.swagger.codegen.languages.RubyClientCodegen
12
+
13
+ ## Installation
14
+
15
+ ### Build a gem
16
+
17
+ To build the Ruby code into a gem:
18
+
19
+ ```shell
20
+ gem build md-validator-client.gemspec
21
+ ```
22
+
23
+ Then either install the gem locally:
24
+
25
+ ```shell
26
+ gem install ./md-validator-client-1.0.1.gem
27
+ ```
28
+ (for development, run `gem install --dev ./md-validator-client-1.0.1.gem` to install the development dependencies)
29
+
30
+ or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
31
+
32
+ Finally add this to the Gemfile:
33
+
34
+ gem 'md-validator-client', '~> 1.0.1'
35
+
36
+ ### Install from Git
37
+
38
+ If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
39
+
40
+ gem 'md-validator-client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
41
+
42
+ ### Include the Ruby code directly
43
+
44
+ Include the Ruby code directly using `-I` as follows:
45
+
46
+ ```shell
47
+ ruby -Ilib script.rb
48
+ ```
49
+
50
+ ## Getting Started
51
+
52
+ Please follow the [installation](#installation) procedure and then run the following code:
53
+ ```ruby
54
+ # Load the gem
55
+ require 'md-validator-client'
56
+
57
+ api_instance = ValidatorClient::ValidationApi.new
58
+
59
+ begin
60
+ #lists available validators
61
+ result = api_instance.get_validators
62
+ p result
63
+ rescue ValidatorClient::ApiError => e
64
+ puts "Exception when calling ValidationApi->get_validators: #{e}"
65
+ end
66
+
67
+ ```
68
+
69
+ ## Documentation for API Endpoints
70
+
71
+ All URIs are relative to *http://localhost*
72
+
73
+ Class | Method | HTTP request | Description
74
+ ------------ | ------------- | ------------- | -------------
75
+ *ValidatorClient::ValidationApi* | [**get_validators**](docs/ValidationApi.md#get_validators) | **GET** /validators | lists available validators
76
+ *ValidatorClient::ValidationApi* | [**validate**](docs/ValidationApi.md#validate) | **POST** /validators/{validator_id}/validate | performs a validation
77
+
78
+
79
+ ## Documentation for Models
80
+
81
+ - [ValidatorClient::InlineResponse404](docs/InlineResponse404.md)
82
+ - [ValidatorClient::Status](docs/Status.md)
83
+ - [ValidatorClient::Validator](docs/Validator.md)
84
+
85
+
86
+ ## Documentation for Authorization
87
+
88
+ All endpoints do not require authorization.
89
+
@@ -0,0 +1,8 @@
1
+ begin
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+ task default: :spec
6
+ rescue LoadError
7
+ # no rspec available
8
+ end
@@ -0,0 +1,9 @@
1
+ # ValidatorClient::InlineResponse404
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **foo** | **String** | |
7
+ **bar** | **String** | |
8
+
9
+
@@ -0,0 +1,10 @@
1
+ # ValidatorClient::Status
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **status** | **String** | the subclass of `StatusMetadata` |
7
+ **component_id** | **String** | the component identifier (bean ID) of the component that created the `StatusMetadata` object |
8
+ **message** | **String** | |
9
+
10
+
@@ -0,0 +1,99 @@
1
+ # ValidatorClient::ValidationApi
2
+
3
+ All URIs are relative to *http://localhost*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**get_validators**](ValidationApi.md#get_validators) | **GET** /validators | lists available validators
8
+ [**validate**](ValidationApi.md#validate) | **POST** /validators/{validator_id}/validate | performs a validation
9
+
10
+
11
+ # **get_validators**
12
+ > Array<Validator> get_validators
13
+
14
+ lists available validators
15
+
16
+ Lists all of the available validator pipelines.
17
+
18
+ ### Example
19
+ ```ruby
20
+ # load the gem
21
+ require 'md-validator-client'
22
+
23
+ api_instance = ValidatorClient::ValidationApi.new
24
+
25
+ begin
26
+ #lists available validators
27
+ result = api_instance.get_validators
28
+ p result
29
+ rescue ValidatorClient::ApiError => e
30
+ puts "Exception when calling ValidationApi->get_validators: #{e}"
31
+ end
32
+ ```
33
+
34
+ ### Parameters
35
+ This endpoint does not need any parameter.
36
+
37
+ ### Return type
38
+
39
+ [**Array<Validator>**](Validator.md)
40
+
41
+ ### Authorization
42
+
43
+ No authorization required
44
+
45
+ ### HTTP request headers
46
+
47
+ - **Content-Type**: Not defined
48
+ - **Accept**: application/json
49
+
50
+
51
+
52
+ # **validate**
53
+ > Array<Status> validate(validator_id, metadata)
54
+
55
+ performs a validation
56
+
57
+ ### Example
58
+ ```ruby
59
+ # load the gem
60
+ require 'md-validator-client'
61
+
62
+ api_instance = ValidatorClient::ValidationApi.new
63
+
64
+ validator_id = 'validator_id_example' # String | An identifier for the validation to be performed.
65
+
66
+ metadata = 'metadata_example' # String | The metadata to be validated.
67
+
68
+
69
+ begin
70
+ #performs a validation
71
+ result = api_instance.validate(validator_id, metadata)
72
+ p result
73
+ rescue ValidatorClient::ApiError => e
74
+ puts "Exception when calling ValidationApi->validate: #{e}"
75
+ end
76
+ ```
77
+
78
+ ### Parameters
79
+
80
+ Name | Type | Description | Notes
81
+ ------------- | ------------- | ------------- | -------------
82
+ **validator_id** | **String**| An identifier for the validation to be performed. |
83
+ **metadata** | **String**| The metadata to be validated. |
84
+
85
+ ### Return type
86
+
87
+ [**Array<Status>**](Status.md)
88
+
89
+ ### Authorization
90
+
91
+ No authorization required
92
+
93
+ ### HTTP request headers
94
+
95
+ - **Content-Type**: application/xml+samlmetadata
96
+ - **Accept**: application/json
97
+
98
+
99
+
@@ -0,0 +1,9 @@
1
+ # ValidatorClient::Validator
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **validator_id** | **String** | |
7
+ **description** | **String** | |
8
+
9
+
@@ -0,0 +1,55 @@
1
+ #!/bin/sh
2
+ #
3
+ # Generated by: https://github.com/swagger-api/swagger-codegen.git
4
+ #
5
+ # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
6
+ #
7
+ # Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
8
+
9
+ git_user_id=$1
10
+ git_repo_id=$2
11
+ release_note=$3
12
+
13
+ if [ "$git_user_id" = "" ]; then
14
+ git_user_id="GIT_USER_ID"
15
+ echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
16
+ fi
17
+
18
+ if [ "$git_repo_id" = "" ]; then
19
+ git_repo_id="GIT_REPO_ID"
20
+ echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
21
+ fi
22
+
23
+ if [ "$release_note" = "" ]; then
24
+ release_note="Minor update"
25
+ echo "[INFO] No command line input provided. Set \$release_note to $release_note"
26
+ fi
27
+
28
+ # Initialize the local directory as a Git repository
29
+ git init
30
+
31
+ # Adds the files in the local repository and stages them for commit.
32
+ git add .
33
+
34
+ # Commits the tracked changes and prepares them to be pushed to a remote repository.
35
+ git commit -m "$release_note"
36
+
37
+ # Sets the new remote
38
+ git_remote=`git remote`
39
+ if [ "$git_remote" = "" ]; then # git remote not defined
40
+
41
+ if [ "$GIT_TOKEN" = "" ]; then
42
+ echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
43
+ git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
44
+ else
45
+ git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
46
+ fi
47
+
48
+ fi
49
+
50
+ git pull origin master
51
+
52
+ # Pushes (Forces) the changes in the local repository up to the remote repository
53
+ echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
54
+ git push origin master 2>&1 | grep -v 'To https'
55
+
@@ -0,0 +1,43 @@
1
+ =begin
2
+ #Metadata Validation API
3
+
4
+ #API for the metadata validation service.
5
+
6
+ OpenAPI spec version: 1.0.0
7
+ Contact: ian@iay.org.uk
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.15
10
+
11
+ =end
12
+
13
+ # Common files
14
+ require 'md-validator-client/api_client'
15
+ require 'md-validator-client/api_error'
16
+ require 'md-validator-client/version'
17
+ require 'md-validator-client/configuration'
18
+
19
+ # Models
20
+ require 'md-validator-client/models/inline_response_404'
21
+ require 'md-validator-client/models/status'
22
+ require 'md-validator-client/models/validator'
23
+
24
+ # APIs
25
+ require 'md-validator-client/api/validation_api'
26
+
27
+ module ValidatorClient
28
+ class << self
29
+ # Customize default settings for the SDK using block.
30
+ # ValidatorClient.configure do |config|
31
+ # config.username = "xxx"
32
+ # config.password = "xxx"
33
+ # end
34
+ # If no block given, return the default Configuration object.
35
+ def configure
36
+ if block_given?
37
+ yield(Configuration.default)
38
+ else
39
+ Configuration.default
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,127 @@
1
+ =begin
2
+ #Metadata Validation API
3
+
4
+ #API for the metadata validation service.
5
+
6
+ OpenAPI spec version: 1.0.0
7
+ Contact: ian@iay.org.uk
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.15
10
+
11
+ =end
12
+
13
+ require 'uri'
14
+
15
+ module ValidatorClient
16
+ class ValidationApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # lists available validators
23
+ # Lists all of the available validator pipelines.
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [Array<Validator>]
26
+ def get_validators(opts = {})
27
+ data, _status_code, _headers = get_validators_with_http_info(opts)
28
+ data
29
+ end
30
+
31
+ # lists available validators
32
+ # Lists all of the available validator pipelines.
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(Array<Validator>, Fixnum, Hash)>] Array<Validator> data, response status code and response headers
35
+ def get_validators_with_http_info(opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: ValidationApi.get_validators ...'
38
+ end
39
+ # resource path
40
+ local_var_path = '/validators'
41
+
42
+ # query parameters
43
+ query_params = {}
44
+
45
+ # header parameters
46
+ header_params = {}
47
+ # HTTP header 'Accept' (if needed)
48
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
49
+
50
+ # form parameters
51
+ form_params = {}
52
+
53
+ # http body (model)
54
+ post_body = nil
55
+ auth_names = []
56
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
57
+ :header_params => header_params,
58
+ :query_params => query_params,
59
+ :form_params => form_params,
60
+ :body => post_body,
61
+ :auth_names => auth_names,
62
+ :return_type => 'Array<Validator>')
63
+ if @api_client.config.debugging
64
+ @api_client.config.logger.debug "API called: ValidationApi#get_validators\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
65
+ end
66
+ return data, status_code, headers
67
+ end
68
+ # performs a validation
69
+ # @param validator_id An identifier for the validation to be performed.
70
+ # @param metadata The metadata to be validated.
71
+ # @param [Hash] opts the optional parameters
72
+ # @return [Array<Status>]
73
+ def validate(validator_id, metadata, opts = {})
74
+ data, _status_code, _headers = validate_with_http_info(validator_id, metadata, opts)
75
+ data
76
+ end
77
+
78
+ # performs a validation
79
+ # @param validator_id An identifier for the validation to be performed.
80
+ # @param metadata The metadata to be validated.
81
+ # @param [Hash] opts the optional parameters
82
+ # @return [Array<(Array<Status>, Fixnum, Hash)>] Array<Status> data, response status code and response headers
83
+ def validate_with_http_info(validator_id, metadata, opts = {})
84
+ if @api_client.config.debugging
85
+ @api_client.config.logger.debug 'Calling API: ValidationApi.validate ...'
86
+ end
87
+ # verify the required parameter 'validator_id' is set
88
+ if @api_client.config.client_side_validation && validator_id.nil?
89
+ fail ArgumentError, "Missing the required parameter 'validator_id' when calling ValidationApi.validate"
90
+ end
91
+ # verify the required parameter 'metadata' is set
92
+ if @api_client.config.client_side_validation && metadata.nil?
93
+ fail ArgumentError, "Missing the required parameter 'metadata' when calling ValidationApi.validate"
94
+ end
95
+ # resource path
96
+ local_var_path = '/validators/{validator_id}/validate'.sub('{' + 'validator_id' + '}', validator_id.to_s)
97
+
98
+ # query parameters
99
+ query_params = {}
100
+
101
+ # header parameters
102
+ header_params = {}
103
+ # HTTP header 'Accept' (if needed)
104
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
105
+ # HTTP header 'Content-Type'
106
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/xml+samlmetadata'])
107
+
108
+ # form parameters
109
+ form_params = {}
110
+
111
+ # http body (model)
112
+ post_body = @api_client.object_to_http_body(metadata)
113
+ auth_names = []
114
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
115
+ :header_params => header_params,
116
+ :query_params => query_params,
117
+ :form_params => form_params,
118
+ :body => post_body,
119
+ :auth_names => auth_names,
120
+ :return_type => 'Array<Status>')
121
+ if @api_client.config.debugging
122
+ @api_client.config.logger.debug "API called: ValidationApi#validate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
123
+ end
124
+ return data, status_code, headers
125
+ end
126
+ end
127
+ end