genio 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/LICENSE.txt +54 -0
- data/README.md +55 -0
- data/bin/genio +21 -0
- data/lib/genio.rb +35 -0
- data/lib/genio/helper/base.rb +101 -0
- data/lib/genio/helper/dot_net.rb +410 -0
- data/lib/genio/helper/java.rb +415 -0
- data/lib/genio/helper/php.rb +342 -0
- data/lib/genio/logging.rb +30 -0
- data/lib/genio/tasks.rb +246 -0
- data/lib/genio/template.rb +65 -0
- data/lib/genio/util/namespace_helper.rb +93 -0
- data/lib/genio/util/schema_helper.rb +65 -0
- data/lib/genio/version.rb +19 -0
- data/templates/sdk.rest_dotnet.erb +174 -0
- data/templates/sdk.rest_java.erb +231 -0
- data/templates/sdk.rest_php.erb +120 -0
- data/templates/sdk.rest_version_dotnet.erb +49 -0
- data/templates/sdk.rest_version_java.erb +46 -0
- data/templates/sdk.wsdl_dotnet.erb +90 -0
- data/templates/sdk.wsdl_java.erb +115 -0
- data/templates/sdk.wsdl_php.erb +79 -0
- data/templates/sdk.wsdlenum_dotnet.erb +32 -0
- data/templates/sdk.wsdlenum_java.erb +47 -0
- data/templates/sdk.wsdlservice_dotnet.erb +154 -0
- data/templates/sdk.wsdlservice_java.erb +145 -0
- data/templates/sdk.wsdlservice_php.erb +92 -0
- data/templates/sdk.wsdlsoapdeserialize_dotnet.erb +139 -0
- data/templates/sdk.wsdlsoapdeserialize_java.erb +128 -0
- data/templates/sdk.wsdlsoapserialize_dotnet.erb +184 -0
- data/templates/sdk.wsdlsoapserialize_java.erb +170 -0
- data/templates/sdk.wsdlsoapserialize_php.erb +67 -0
- metadata +191 -0
@@ -0,0 +1,49 @@
|
|
1
|
+
<%
|
2
|
+
#
|
3
|
+
# Copyright 2013 PayPal Inc.
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
#
|
17
|
+
#
|
18
|
+
%>
|
19
|
+
using PayPal;
|
20
|
+
|
21
|
+
namespace PayPal
|
22
|
+
{
|
23
|
+
public class SDKVersionImpl : SDKVersion
|
24
|
+
{
|
25
|
+
|
26
|
+
/// <summary>
|
27
|
+
/// SDK ID used in User-Agent HTTP header
|
28
|
+
/// </summary>
|
29
|
+
private const string SdkId = "";
|
30
|
+
|
31
|
+
/// <summary>
|
32
|
+
/// SDK Version used in User-Agent HTTP header
|
33
|
+
/// </summary>
|
34
|
+
private const string SdkVersion = "";
|
35
|
+
|
36
|
+
public string GetSDKId()
|
37
|
+
{
|
38
|
+
return SdkId;
|
39
|
+
}
|
40
|
+
|
41
|
+
public string GetSDKVersion()
|
42
|
+
{
|
43
|
+
return SdkVersion;
|
44
|
+
}
|
45
|
+
}
|
46
|
+
|
47
|
+
}
|
48
|
+
|
49
|
+
|
@@ -0,0 +1,46 @@
|
|
1
|
+
<%
|
2
|
+
#
|
3
|
+
# Copyright 2013 PayPal Inc.
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
#
|
17
|
+
#
|
18
|
+
%>
|
19
|
+
package com.paypal.sdk.info;
|
20
|
+
|
21
|
+
import com.paypal.core.SDKVersion;
|
22
|
+
|
23
|
+
/**
|
24
|
+
* Implementation of SDKVersion
|
25
|
+
*/
|
26
|
+
public class SDKVersionImpl implements SDKVersion {
|
27
|
+
|
28
|
+
/**
|
29
|
+
* SDK ID used in User-Agent HTTP header
|
30
|
+
*/
|
31
|
+
private static final String SDK_ID = "";
|
32
|
+
|
33
|
+
/**
|
34
|
+
* SDK Version used in User-Agent HTTP header
|
35
|
+
*/
|
36
|
+
private static final String SDK_VERSION = "";
|
37
|
+
|
38
|
+
public String getSDKId() {
|
39
|
+
return SDK_ID;
|
40
|
+
}
|
41
|
+
|
42
|
+
public String getSDKVersion() {
|
43
|
+
return SDK_VERSION;
|
44
|
+
}
|
45
|
+
|
46
|
+
}
|
@@ -0,0 +1,90 @@
|
|
1
|
+
<%
|
2
|
+
#
|
3
|
+
# Copyright 2013 PayPal Inc.
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
#
|
17
|
+
#
|
18
|
+
%>
|
19
|
+
<% operation_input = is_operation_input(data_type, schema) %>
|
20
|
+
<% imports(data_type, schema, package, classname, "soap", operation_input).each do |import| %>
|
21
|
+
using <%= import %>;
|
22
|
+
<% end %>
|
23
|
+
namespace <%= package %>
|
24
|
+
{
|
25
|
+
public class <%= validate_class_name(classname) %><% if data_type.fault %> : System.Exception <% end %><% if operation_input %> : XMLMessageSerializer<% end %>
|
26
|
+
{
|
27
|
+
|
28
|
+
/// <summary>
|
29
|
+
/// Namespace of <%= classname %>
|
30
|
+
/// </summary>
|
31
|
+
public const string Namespace = "<%= data_type.package %>";
|
32
|
+
|
33
|
+
/// <summary>
|
34
|
+
/// Default US culture info used for decimal conversion
|
35
|
+
/// </summary>
|
36
|
+
private static CultureInfo DefaultCulture = new CultureInfo("en-US");
|
37
|
+
|
38
|
+
<% const_args = {} %>
|
39
|
+
|
40
|
+
<% type = data_type %>
|
41
|
+
<% while type %>
|
42
|
+
<% type.properties.each do |name, property| %>
|
43
|
+
<% vname = validate_property_name(name, true) %>
|
44
|
+
<% const_args[vname] = get_property_class(property, classname) if property.required %>
|
45
|
+
private <%= get_property_class(property, classname) %><%= '?' if (is_nullable_type(property) and !property.array) %> <%= vname %>Property<% if property.array %> = new <%= get_property_class(property, classname) %>()<% end %>;
|
46
|
+
|
47
|
+
/// <summary>
|
48
|
+
/// <%= property.description %>
|
49
|
+
/// </summary>
|
50
|
+
public <%= get_property_class(property, classname) %><%= '?' if (is_nullable_type(property) and !property.array) %> <%= vname %>
|
51
|
+
{
|
52
|
+
get
|
53
|
+
{
|
54
|
+
return this.<%= vname %>Property;
|
55
|
+
}
|
56
|
+
set
|
57
|
+
{
|
58
|
+
this.<%= vname %>Property = value;
|
59
|
+
}
|
60
|
+
}
|
61
|
+
|
62
|
+
<% end %>
|
63
|
+
<% type = schema.data_types[type.extends] %>
|
64
|
+
<% end %>
|
65
|
+
/// <summary>
|
66
|
+
/// Default Constructor
|
67
|
+
/// </summary>
|
68
|
+
public <%= classname %>()
|
69
|
+
{
|
70
|
+
}
|
71
|
+
|
72
|
+
<% if const_args.size > 0 %>
|
73
|
+
/// <summary>
|
74
|
+
/// Parameterized Constructor
|
75
|
+
/// </summary>
|
76
|
+
public <%= classname %>(<%= const_args.map{|name, type| "#{type} #{validate_property_as_argument(name)}"}.join(", ") %>)
|
77
|
+
{
|
78
|
+
<% const_args.each do |name, type| %>
|
79
|
+
this.<%= name %> = <%= validate_property_as_argument(name) %>;
|
80
|
+
<% end %>
|
81
|
+
}
|
82
|
+
<% end %>
|
83
|
+
|
84
|
+
<% serialization_name = get_rootname_serialization(data_type, schema) if operation_input %>
|
85
|
+
<%= render "templates/sdk.wsdlsoapserialize_dotnet.erb", :classname => classname, :operation_input => operation_input, :serialization_name => serialization_name, :schema => schema, :data_type => data_type %>
|
86
|
+
|
87
|
+
<%= render "templates/sdk.wsdlsoapdeserialize_dotnet.erb", :classname => classname, :data_type => data_type %>
|
88
|
+
|
89
|
+
}
|
90
|
+
}
|
@@ -0,0 +1,115 @@
|
|
1
|
+
<%
|
2
|
+
#
|
3
|
+
# Copyright 2013 PayPal Inc.
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
#
|
17
|
+
#
|
18
|
+
%>
|
19
|
+
package <%= package %>;
|
20
|
+
<% operation_input = is_operation_input(data_type, schema) %>
|
21
|
+
<% imports(data_type, schema, package, classname, "soap", operation_input).each do |import| %>
|
22
|
+
import <%= import %>;
|
23
|
+
<% end %>
|
24
|
+
|
25
|
+
public class <%= validate_class_name(classname) %><% if data_type.fault %> extends RuntimeException <% end %><% if operation_input %> implements XMLMessageSerializer<% end %> {
|
26
|
+
|
27
|
+
/**
|
28
|
+
* Namespace of <%= classname %>
|
29
|
+
*/
|
30
|
+
public static final String nameSpace = "<%= data_type.package %>";
|
31
|
+
|
32
|
+
<% const_args = {} %>
|
33
|
+
<% type = data_type %>
|
34
|
+
<% while type %>
|
35
|
+
<% type.properties.each do |name, property| %>
|
36
|
+
<% vname = validate_property_name(name) %>
|
37
|
+
<% const_args[vname] = get_property_class(property, classname) if property.required %>
|
38
|
+
/**
|
39
|
+
* <%= property.description %>
|
40
|
+
*/
|
41
|
+
private <%= get_property_class(property, classname) %> <%= vname %><% if property.array %> = new ArrayList<<%= validate_class_name(find_basic_type(property.type)) %>>()<% end %>;
|
42
|
+
|
43
|
+
<% end %>
|
44
|
+
<% type = schema.data_types[type.extends] %>
|
45
|
+
<% end %>
|
46
|
+
/**
|
47
|
+
* Default Constructor
|
48
|
+
*/
|
49
|
+
public <%= classname %>() {
|
50
|
+
}
|
51
|
+
|
52
|
+
<% if const_args.size > 0 %>
|
53
|
+
/**
|
54
|
+
* Parameterized Constructor
|
55
|
+
*/
|
56
|
+
public <%= classname %>(<%= const_args.map{|name, type| "#{type} #{name}"}.join(", ") %>) {
|
57
|
+
<% const_args.each do |name, type| %>
|
58
|
+
this.<%= name %> = <%= name %>;
|
59
|
+
<% end %>
|
60
|
+
}
|
61
|
+
<% end %>
|
62
|
+
|
63
|
+
<% data_type.properties.each do |name, property| %>
|
64
|
+
<%
|
65
|
+
vname = validate_property_name(name)
|
66
|
+
methodname = validate_class_name(name)
|
67
|
+
%>
|
68
|
+
|
69
|
+
/**
|
70
|
+
* Setter for <%= vname %>
|
71
|
+
*/
|
72
|
+
public <%= classname %> set<%= methodname %>(<%= get_property_class(property, classname) %> <%= vname %>) {
|
73
|
+
this.<%= vname%> = <%= vname %>;
|
74
|
+
return this;
|
75
|
+
}
|
76
|
+
|
77
|
+
/**
|
78
|
+
* Getter for <%= vname %>
|
79
|
+
*/
|
80
|
+
public <%= get_property_class(property, classname) %> get<%= methodname %>() {
|
81
|
+
return this.<%= vname%>;
|
82
|
+
}
|
83
|
+
|
84
|
+
<% end %>
|
85
|
+
<% if data_type.extends %>
|
86
|
+
<% extended_data_type = schema.data_types[data_type.extends] %>
|
87
|
+
<% extended_data_type.properties.each do |name, property| %>
|
88
|
+
<%
|
89
|
+
vname = validate_property_name(name)
|
90
|
+
methodname = validate_class_name(name)
|
91
|
+
%>
|
92
|
+
|
93
|
+
/**
|
94
|
+
* Setter for <%= vname %>
|
95
|
+
*/
|
96
|
+
public <%= classname %> set<%= methodname %>(<%= get_property_class(property, classname) %> <%= vname %>) {
|
97
|
+
this.<%= vname%> = <%= vname %>;
|
98
|
+
return this;
|
99
|
+
}
|
100
|
+
|
101
|
+
/**
|
102
|
+
* Getter for <%= vname %>
|
103
|
+
*/
|
104
|
+
public <%= get_property_class(property, classname) %> get<%= methodname %>() {
|
105
|
+
return this.<%= vname%>;
|
106
|
+
}
|
107
|
+
|
108
|
+
<% end %>
|
109
|
+
<% end %>
|
110
|
+
<% serialization_name = get_rootname_serialization(data_type, schema) if operation_input %>
|
111
|
+
<%= render "templates/sdk.wsdlsoapserialize_java.erb", :classname => classname, :operation_input => operation_input, :serialization_name => serialization_name, :schema => schema, :data_type => data_type %>
|
112
|
+
|
113
|
+
<%= render "templates/sdk.wsdlsoapdeserialize_java.erb", :classname => classname, :data_type => data_type %>
|
114
|
+
|
115
|
+
}
|
@@ -0,0 +1,79 @@
|
|
1
|
+
<%
|
2
|
+
#
|
3
|
+
# Copyright 2013 PayPal Inc.
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
#
|
17
|
+
#
|
18
|
+
%>
|
19
|
+
<?php
|
20
|
+
namespace <%= package %>;
|
21
|
+
<% imports(data_type, schema, package, classname, "soap").each do |import| %>
|
22
|
+
use <%= import %>;
|
23
|
+
<% end %>
|
24
|
+
/**
|
25
|
+
<%= comment_wrap(data_type.description, 60, ' * ') %>
|
26
|
+
*/
|
27
|
+
class <%= valid_class_name(classname) %> extends <% if data_type.fault %>PPXmlFaultMessage<% else %>PPXmlMessage<% end %> {
|
28
|
+
<% const_args = {} %>
|
29
|
+
<% type = data_type %>
|
30
|
+
<% while type %>
|
31
|
+
<% type.properties.each do |name, property| %>
|
32
|
+
<% vname = to_underscore(name) %>
|
33
|
+
<% vtype = get_php_type(property, schema, classname) %>
|
34
|
+
<% const_args[vname] = property.type if property.required %>
|
35
|
+
/**
|
36
|
+
<%= comment_wrap(property.description, 60, "\t * ") %>
|
37
|
+
<% if property.array %>
|
38
|
+
* @array
|
39
|
+
<% end %>
|
40
|
+
* @access public
|
41
|
+
<% if (property.value != '1' and !property.attribute) and !should_qualify_name(property.package, schema) %>
|
42
|
+
* @namespace
|
43
|
+
<% elsif property.package.present? %>
|
44
|
+
* @namespace <%= property.package %>
|
45
|
+
<% end %>
|
46
|
+
<% if property.attribute %>
|
47
|
+
* @attribute
|
48
|
+
<% end %>
|
49
|
+
<% if property.value == '1' %>
|
50
|
+
* @value
|
51
|
+
<% end %>
|
52
|
+
* @var <%= "#{validated_package(schema.data_types[vtype].package)}\\" if schema.data_types[vtype] %><%= vtype %>
|
53
|
+
<% if vname != property.name %>
|
54
|
+
* @name <%= property.name %>
|
55
|
+
<% end %>
|
56
|
+
*/
|
57
|
+
public $<%= vname %>;
|
58
|
+
<% end %>
|
59
|
+
<% type = schema.data_types[type.extends] %>
|
60
|
+
<% end %>
|
61
|
+
|
62
|
+
<% if const_args.size > 0 %>
|
63
|
+
|
64
|
+
/**
|
65
|
+
* Constructor with mandatory properties
|
66
|
+
*
|
67
|
+
<% const_args.map.each do |name, type| %>
|
68
|
+
* @param <%= type %> $<%= name %>
|
69
|
+
<% end %>
|
70
|
+
*/
|
71
|
+
public function __construct(<%= const_args.map{|name, type| "$#{name} = NULL"}.join(", ") %>) {
|
72
|
+
<% const_args.each do |name, type| %>
|
73
|
+
$this-><%= name %> = $<%= name %>;
|
74
|
+
<% end %>
|
75
|
+
}
|
76
|
+
<% end %>
|
77
|
+
|
78
|
+
<%= render "templates/sdk.wsdlsoapserialize_php.erb", :classname => classname, :schema => schema, :data_type => data_type %>
|
79
|
+
}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
<%
|
2
|
+
#
|
3
|
+
# Copyright 2013 PayPal Inc.
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
#
|
17
|
+
#
|
18
|
+
%>
|
19
|
+
using System;
|
20
|
+
using System.ComponentModel;
|
21
|
+
namespace <%= package %>
|
22
|
+
{
|
23
|
+
[Serializable]
|
24
|
+
public enum <%= classname %>
|
25
|
+
{
|
26
|
+
|
27
|
+
<% definition["values"].each do |value| %>
|
28
|
+
[Description("<%= value %>")]<%= validate_enum_name(value.upcase) %><% if value != definition["values"].last %>,<% end %>
|
29
|
+
|
30
|
+
<% end %>
|
31
|
+
}
|
32
|
+
}
|
@@ -0,0 +1,47 @@
|
|
1
|
+
<%
|
2
|
+
#
|
3
|
+
# Copyright 2013 PayPal Inc.
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
#
|
17
|
+
#
|
18
|
+
%>
|
19
|
+
package <%= package %>;
|
20
|
+
|
21
|
+
public enum <%= classname %> {
|
22
|
+
|
23
|
+
<% definition["values"].each do |value| %>
|
24
|
+
|
25
|
+
<%= validate_enum_name(value.upcase) %>("<%= value %>")<% if value != definition["values"].last %>,<% else %>;<% end %>
|
26
|
+
<% end %>
|
27
|
+
|
28
|
+
private String value;
|
29
|
+
|
30
|
+
private <%= classname %> (String value) {
|
31
|
+
this.value = value;
|
32
|
+
}
|
33
|
+
|
34
|
+
public String getValue(){
|
35
|
+
return value;
|
36
|
+
}
|
37
|
+
|
38
|
+
public static <%= classname %> fromValue(String v) {
|
39
|
+
for (<%= classname %> c : values()) {
|
40
|
+
if (c.value.equals(v)) {
|
41
|
+
return c;
|
42
|
+
}
|
43
|
+
}
|
44
|
+
throw new IllegalArgumentException(v);
|
45
|
+
}
|
46
|
+
|
47
|
+
}
|