MailchimpSDKPlayground 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/MailchimpSDKPlayground.gemspec +45 -0
- data/README.md +97 -0
- data/Rakefile +8 -0
- data/docs/APIHealthStatus.md +8 -0
- data/docs/DefaultApi.md +56 -0
- data/docs/ProblemDetailDocument.md +12 -0
- data/git_push.sh +55 -0
- data/lib/MailchimpSDKPlayground/api/default_api.rb +71 -0
- data/lib/MailchimpSDKPlayground/api_client.rb +389 -0
- data/lib/MailchimpSDKPlayground/api_error.rb +38 -0
- data/lib/MailchimpSDKPlayground/configuration.rb +209 -0
- data/lib/MailchimpSDKPlayground/models/api_health_status.rb +185 -0
- data/lib/MailchimpSDKPlayground/models/problem_detail_document.rb +250 -0
- data/lib/MailchimpSDKPlayground/version.rb +15 -0
- data/lib/MailchimpSDKPlayground.rb +42 -0
- data/spec/api/default_api_spec.rb +46 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/api_health_status_spec.rb +41 -0
- data/spec/models/problem_detail_document_spec.rb +65 -0
- data/spec/spec_helper.rb +111 -0
- metadata +251 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 0a159ede1c77ec6129831404a26311ddf7197aa92a69ed7201e39caa1e950ff0
|
4
|
+
data.tar.gz: 5f41a04ab5d10a8c53a44015dc8a786e0e57db2ef7ace3cd47834b8960b83775
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8da4ddbba557b675a2ce8db916c740bfba968c5f9137f00560e0c7ce28c386a74783c9e458f54b68b6e8cc687a9a17d5a2f7df567dde4c0c6f89f7beaabf24e9
|
7
|
+
data.tar.gz: d1b70d0bead7837184ff52e38cba23a98927823f0126040d37f91c3610eacfcddcdabb465a099c050828567aa6fd1daac73bbe10360910627f677408880c7671
|
data/Gemfile
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
=begin
|
4
|
+
#Mailchimp Marketing API
|
5
|
+
|
6
|
+
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
7
|
+
|
8
|
+
OpenAPI spec version: 0.0.9
|
9
|
+
Contact: apihelp@mailchimp.com
|
10
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
11
|
+
Swagger Codegen version: 2.4.12
|
12
|
+
|
13
|
+
=end
|
14
|
+
|
15
|
+
$:.push File.expand_path("../lib", __FILE__)
|
16
|
+
require "MailchimpSDKPlayground/version"
|
17
|
+
|
18
|
+
Gem::Specification.new do |s|
|
19
|
+
s.name = "MailchimpSDKPlayground"
|
20
|
+
s.version = MailchimpSDKPlayground::VERSION
|
21
|
+
s.platform = Gem::Platform::RUBY
|
22
|
+
s.authors = ["Swagger-Codegen"]
|
23
|
+
s.email = ["apihelp@mailchimp.com"]
|
24
|
+
s.homepage = "https://github.com/swagger-api/swagger-codegen"
|
25
|
+
s.summary = "Mailchimp Marketing API Ruby Gem"
|
26
|
+
s.description = "No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)"
|
27
|
+
s.license = "Unlicense"
|
28
|
+
s.required_ruby_version = ">= 1.9"
|
29
|
+
|
30
|
+
s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
|
31
|
+
s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0'
|
32
|
+
|
33
|
+
s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
|
34
|
+
s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1'
|
35
|
+
s.add_development_dependency 'webmock', '~> 1.24', '>= 1.24.3'
|
36
|
+
s.add_development_dependency 'autotest', '~> 4.4', '>= 4.4.6'
|
37
|
+
s.add_development_dependency 'autotest-rails-pure', '~> 4.1', '>= 4.1.2'
|
38
|
+
s.add_development_dependency 'autotest-growl', '~> 0.2', '>= 0.2.16'
|
39
|
+
s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.12'
|
40
|
+
|
41
|
+
s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? }
|
42
|
+
s.test_files = `find spec/*`.split("\n")
|
43
|
+
s.executables = []
|
44
|
+
s.require_paths = ["lib"]
|
45
|
+
end
|
data/README.md
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
# MailchimpSDKPlayground
|
2
|
+
|
3
|
+
MailchimpSDKPlayground - the Ruby gem for the Mailchimp Marketing API
|
4
|
+
|
5
|
+
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
6
|
+
|
7
|
+
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
8
|
+
|
9
|
+
- API version: 0.0.9
|
10
|
+
- Package version: 1.0.0
|
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 MailchimpSDKPlayground.gemspec
|
21
|
+
```
|
22
|
+
|
23
|
+
Then either install the gem locally:
|
24
|
+
|
25
|
+
```shell
|
26
|
+
gem install ./MailchimpSDKPlayground-1.0.0.gem
|
27
|
+
```
|
28
|
+
(for development, run `gem install --dev ./MailchimpSDKPlayground-1.0.0.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 'MailchimpSDKPlayground', '~> 1.0.0'
|
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 'MailchimpSDKPlayground', :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 'MailchimpSDKPlayground'
|
56
|
+
|
57
|
+
# Setup authorization
|
58
|
+
MailchimpSDKPlayground.configure do |config|
|
59
|
+
# Configure HTTP basic authorization: basicAuth
|
60
|
+
config.username = 'YOUR USERNAME'
|
61
|
+
config.password = 'YOUR PASSWORD'
|
62
|
+
end
|
63
|
+
|
64
|
+
api_instance = MailchimpSDKPlayground::DefaultApi.new
|
65
|
+
|
66
|
+
begin
|
67
|
+
#Ping the API
|
68
|
+
result = api_instance.get_ping
|
69
|
+
p result
|
70
|
+
rescue MailchimpSDKPlayground::ApiError => e
|
71
|
+
puts "Exception when calling DefaultApi->get_ping: #{e}"
|
72
|
+
end
|
73
|
+
|
74
|
+
```
|
75
|
+
|
76
|
+
## Documentation for API Endpoints
|
77
|
+
|
78
|
+
All URIs are relative to *https://us19.api.mailchimp.com/3.0*
|
79
|
+
|
80
|
+
Class | Method | HTTP request | Description
|
81
|
+
------------ | ------------- | ------------- | -------------
|
82
|
+
*MailchimpSDKPlayground::DefaultApi* | [**get_ping**](docs/DefaultApi.md#get_ping) | **GET** /ping | Ping the API
|
83
|
+
|
84
|
+
|
85
|
+
## Documentation for Models
|
86
|
+
|
87
|
+
- [MailchimpSDKPlayground::APIHealthStatus](docs/APIHealthStatus.md)
|
88
|
+
- [MailchimpSDKPlayground::ProblemDetailDocument](docs/ProblemDetailDocument.md)
|
89
|
+
|
90
|
+
|
91
|
+
## Documentation for Authorization
|
92
|
+
|
93
|
+
|
94
|
+
### basicAuth
|
95
|
+
|
96
|
+
- **Type**: HTTP basic authentication
|
97
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
# MailchimpSDKPlayground::APIHealthStatus
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**health_status** | **String** | This will return a constant string value if the request is successful. Ex. \"Everything's Chimpy!\" | [optional]
|
7
|
+
|
8
|
+
|
data/docs/DefaultApi.md
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
# MailchimpSDKPlayground::DefaultApi
|
2
|
+
|
3
|
+
All URIs are relative to *https://us19.api.mailchimp.com/3.0*
|
4
|
+
|
5
|
+
Method | HTTP request | Description
|
6
|
+
------------- | ------------- | -------------
|
7
|
+
[**get_ping**](DefaultApi.md#get_ping) | **GET** /ping | Ping the API
|
8
|
+
|
9
|
+
|
10
|
+
# **get_ping**
|
11
|
+
> APIHealthStatus get_ping
|
12
|
+
|
13
|
+
Ping the API
|
14
|
+
|
15
|
+
A health check for the API that won't return any account-specific information.
|
16
|
+
|
17
|
+
### Example
|
18
|
+
```ruby
|
19
|
+
# load the gem
|
20
|
+
require 'MailchimpSDKPlayground'
|
21
|
+
# setup authorization
|
22
|
+
MailchimpSDKPlayground.configure do |config|
|
23
|
+
# Configure HTTP basic authorization: basicAuth
|
24
|
+
config.username = 'YOUR USERNAME'
|
25
|
+
config.password = 'YOUR PASSWORD'
|
26
|
+
end
|
27
|
+
|
28
|
+
api_instance = MailchimpSDKPlayground::DefaultApi.new
|
29
|
+
|
30
|
+
begin
|
31
|
+
#Ping the API
|
32
|
+
result = api_instance.get_ping
|
33
|
+
p result
|
34
|
+
rescue MailchimpSDKPlayground::ApiError => e
|
35
|
+
puts "Exception when calling DefaultApi->get_ping: #{e}"
|
36
|
+
end
|
37
|
+
```
|
38
|
+
|
39
|
+
### Parameters
|
40
|
+
This endpoint does not need any parameter.
|
41
|
+
|
42
|
+
### Return type
|
43
|
+
|
44
|
+
[**APIHealthStatus**](APIHealthStatus.md)
|
45
|
+
|
46
|
+
### Authorization
|
47
|
+
|
48
|
+
[basicAuth](../README.md#basicAuth)
|
49
|
+
|
50
|
+
### HTTP request headers
|
51
|
+
|
52
|
+
- **Content-Type**: application/json
|
53
|
+
- **Accept**: application/json, application/problem+json
|
54
|
+
|
55
|
+
|
56
|
+
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# MailchimpSDKPlayground::ProblemDetailDocument
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**type** | **String** | An absolute URI that identifies the problem type. When dereferenced, it should provide human-readable documentation for the problem type. |
|
7
|
+
**title** | **String** | A short, human-readable summary of the problem type. It shouldn't change based on the occurrence of the problem, except for purposes of localization. |
|
8
|
+
**status** | **Integer** | The HTTP status code (RFC2616, Section 6) generated by the origin server for this occurrence of the problem. |
|
9
|
+
**detail** | **String** | A human-readable explanation specific to this occurrence of the problem. [Learn more about errors](/developer/guides/get-started-with-mailchimp-api-3/#Errors). |
|
10
|
+
**instance** | **String** | A string that identifies this specific occurrence of the problem. Please provide this ID when contacting support. |
|
11
|
+
|
12
|
+
|
data/git_push.sh
ADDED
@@ -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,71 @@
|
|
1
|
+
=begin
|
2
|
+
#Mailchimp Marketing API
|
3
|
+
|
4
|
+
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
5
|
+
|
6
|
+
OpenAPI spec version: 0.0.9
|
7
|
+
Contact: apihelp@mailchimp.com
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.12
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'uri'
|
14
|
+
|
15
|
+
module MailchimpSDKPlayground
|
16
|
+
class DefaultApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Ping the API
|
23
|
+
# A health check for the API that won't return any account-specific information.
|
24
|
+
# @param [Hash] opts the optional parameters
|
25
|
+
# @return [APIHealthStatus]
|
26
|
+
def get_ping(opts = {})
|
27
|
+
data, _status_code, _headers = get_ping_with_http_info(opts)
|
28
|
+
data
|
29
|
+
end
|
30
|
+
|
31
|
+
# Ping the API
|
32
|
+
# A health check for the API that won't return any account-specific information.
|
33
|
+
# @param [Hash] opts the optional parameters
|
34
|
+
# @return [Array<(APIHealthStatus, Fixnum, Hash)>] APIHealthStatus data, response status code and response headers
|
35
|
+
def get_ping_with_http_info(opts = {})
|
36
|
+
if @api_client.config.debugging
|
37
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.get_ping ...'
|
38
|
+
end
|
39
|
+
# resource path
|
40
|
+
local_var_path = '/ping'
|
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', 'application/problem+json'])
|
49
|
+
# HTTP header 'Content-Type'
|
50
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
51
|
+
|
52
|
+
# form parameters
|
53
|
+
form_params = {}
|
54
|
+
|
55
|
+
# http body (model)
|
56
|
+
post_body = nil
|
57
|
+
auth_names = ['basicAuth']
|
58
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
59
|
+
:header_params => header_params,
|
60
|
+
:query_params => query_params,
|
61
|
+
:form_params => form_params,
|
62
|
+
:body => post_body,
|
63
|
+
:auth_names => auth_names,
|
64
|
+
:return_type => 'APIHealthStatus')
|
65
|
+
if @api_client.config.debugging
|
66
|
+
@api_client.config.logger.debug "API called: DefaultApi#get_ping\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
67
|
+
end
|
68
|
+
return data, status_code, headers
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|