From 8f9aaeb68c96f5bd319cd07c8e0ff11e3b0a2036 Mon Sep 17 00:00:00 2001 From: GeorgeBowers Date: Wed, 23 Feb 2022 16:06:54 +0000 Subject: [PATCH 1/5] hopefully fixed mockserver for ruby 3 --- lib/mockserver-client/api_client.rb | 2 +- lib/mockserver-client/configuration.rb | 2 +- lib/mockserver-client/version.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/mockserver-client/api_client.rb b/lib/mockserver-client/api_client.rb index bae9f9d..2168c42 100644 --- a/lib/mockserver-client/api_client.rb +++ b/lib/mockserver-client/api_client.rb @@ -263,7 +263,7 @@ def sanitize_filename(filename) def build_request_url(path) # Add leading and trailing slashes to path path = "/#{path}".gsub(/\/+/, '/') - URI.encode(@config.base_url + path) + CGI.escape(@config.base_url + path) end # Builds the HTTP request body diff --git a/lib/mockserver-client/configuration.rb b/lib/mockserver-client/configuration.rb index 5492964..8605496 100644 --- a/lib/mockserver-client/configuration.rb +++ b/lib/mockserver-client/configuration.rb @@ -175,7 +175,7 @@ def base_path=(base_path) def base_url url = "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - URI.encode(url) + CGI.escape(url) end # Gets API key (with prefix if set). diff --git a/lib/mockserver-client/version.rb b/lib/mockserver-client/version.rb index 3ffe360..9afb2f3 100644 --- a/lib/mockserver-client/version.rb +++ b/lib/mockserver-client/version.rb @@ -11,5 +11,5 @@ =end module MockServer - VERSION = '5.3.0' + VERSION = '5.3.1' end From 9d7021330b4b04b12c6e77bb0b20fdb2ddc25cf8 Mon Sep 17 00:00:00 2001 From: GeorgeBowers Date: Wed, 23 Feb 2022 16:24:14 +0000 Subject: [PATCH 2/5] added gem to repo? --- mockserver-client-5.3.1.gem | Bin 0 -> 31232 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 mockserver-client-5.3.1.gem diff --git a/mockserver-client-5.3.1.gem b/mockserver-client-5.3.1.gem new file mode 100644 index 0000000000000000000000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jOWUv(B z$2a>ln9h2Qs`=_VBUe1HW%6g`ynfw3%nj_$Jq%=eX9?NqrXG68sCO(QMSoAjCuPuVRM9`Wvg{@y4j}2n06YdpJljU8htuoc2CwAC07JeYbi;=@3|l%Z*4VL`^c} z9bHhRDows zKhK{D7{g@s7Z91v8nQiBzs?S7mMc-4!SQGz!AW^zuD_O-gA_=Rbx-ND{YimETj8cG zvj|Q?#Wk2;Fu3ODFy=Tcz62ayo(TngB1aeeO)MhZ)(;`71*Bm6r0Zcq0xeJ00&WZf zBej_J1R2jT`&mB|mmdc&W@MM-OVN?I?qp7q7KH*OWh+QO>%2B^kRB83LUv_i0Xx!* zSWsKMtgJ9VvU9TXqO)sf@};n*vdpl)fi2`c6)oy6xbQin7_t?nH{pIUE&MHhpjwex zy}g7lwUmtkmp+R%DMj(OIhN^tF`=KMwgELsd^qCF47n>cX>3EW3!(SX{cw0qSpRrH zL0BQv`J)&oUaWA1t}$|mWk%|NF(dkci^8lvDHLmyhl0Oa{=yQ~6 zE^jJqo0fMVCrO`AlaH?JUe#>juu`nuz7=aJ7(hcnjxip!F<)VyCu3|Jv97{sK{BdEQqOdTX{E~)ODX4lh*MSXf&)$@G`@4F%oSg8( zp5&ZK8r|V%R?O1j3e_)Cl<8t%LsV|Evh$DObMXm8a_9OiOTKd`J0;vnt<_5Il#7Wc zGhxEj$&pk{Ve*u`MQ({g5b%&#Gr4%9B*C#iYGQn0F1S(C{72mW<)UI5SHJKO45tNF z?8jP%Z;5KtQ~YLyt<8cZl<-tm0d~2w!} N(!jqo@ZYO}{{cz~>#G0& literal 0 HcmV?d00001 From a1a0e054bbb309eebbd0769c1f987d340deabb8c Mon Sep 17 00:00:00 2001 From: GeorgeBowers Date: Thu, 24 Feb 2022 13:03:38 +0000 Subject: [PATCH 3/5] removed built gemfile from repo --- mockserver-client-5.3.1.gem | Bin 31232 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 mockserver-client-5.3.1.gem diff --git a/mockserver-client-5.3.1.gem b/mockserver-client-5.3.1.gem deleted file mode 100644 index 6c8a05bbb652d35445cce4540c9edc9357cd978e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 31232 zcmeFYRd8i7v?XSCo0*y2W@ct)X1CdH+ihlMW@ct)ZZk78Gc(_tewkEe>SZ$dnj}?; zezea~9o3f3uC1k|C0jFRV^d>iV+IRPkpEeQ>0e=EV*~k*`d|6aH7heGCkQhe3llpV zI|n-l3kVZ4D;ql}2r<+DEQkKveqEfLjUE5F@CojxcRUw1OROQ0LC@9%4dCj-ffdv|9^eu-i# z54)e3vO(q*^K~W>Qxb1c8^`~IW~7+-Mt~L2Bn^w_KGVHj;&pfkt|Y;#P;@2=!?d0X zc_K*b9#kgpAh$=GQKjDl^JPp2*@e-@WZg&mawbKl2_H!=m@xEn`c*mCYS6ao)WzTC zCex|E`{lL09`$uF6fcS?ipk7mQiJEsEt+iU#BQv9VuBbl6uOa!ZqZ}a+6KoQn6}52 zZRc=*yKZQon}O%EdD3{n?zZ)aR`=;$a6Ih>l!BuXensP_&CX(slxsk*C&3~n2Bm56 zkV1or%7>Iizaqaozn;lDlFUzDIQcpW?N`TOs+u9Rt~B+^^O>&O111jV%f zC{sZ2Y0J1G*BNwnx7i$3f;$+=E#a>f*=%1i62Y}2dQpK8CBZ(vfRb)E*Kmp&x04(~ z<2@uEpUJsPDrra+e$T7fZty9B6!*F~rU&TkuUrQ=NV5p%N0Gm1QUOV#?x1jc)T(<% zNxPho5`l_Il5xJPm;76xQ-6SFbTZrNT6pXQB!J9Uu?5rvf|+DxGHOHJQN1 z^YlD=Ky)aKR3IYtbOOetL@*M}v<#_i1u+E$Q z@Jml6l9`yhKYR^QDI09;7?#s%Z1eX#og#x4$(c!^8e%*12T7ukQ7FW#%fh%BC-j8n zKE9EhI$9+#J!T*)+xy)fz_CZ}>zBk6*~;#fqJ zutJuIpu8Qv&li`6_eyYT{Cw_v`)b)48gS={ZDDX`Z0GFUC+9~I3@z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8(sMEGE zYdZWmS#6MbxcCksamx_f5=jNBK`Lp07a)Nq82;8y$gn((h7w*5E8`tiS~FjOWUv(B z$2a>ln9h2Qs`=_VBUe1HW%6g`ynfw3%nj_$Jq%=eX9?NqrXG68sCO(QMSoAjCuPuVRM9`Wvg{@y4j}2n06YdpJljU8htuoc2CwAC07JeYbi;=@3|l%Z*4VL`^c} z9bHhRDows zKhK{D7{g@s7Z91v8nQiBzs?S7mMc-4!SQGz!AW^zuD_O-gA_=Rbx-ND{YimETj8cG zvj|Q?#Wk2;Fu3ODFy=Tcz62ayo(TngB1aeeO)MhZ)(;`71*Bm6r0Zcq0xeJ00&WZf zBej_J1R2jT`&mB|mmdc&W@MM-OVN?I?qp7q7KH*OWh+QO>%2B^kRB83LUv_i0Xx!* zSWsKMtgJ9VvU9TXqO)sf@};n*vdpl)fi2`c6)oy6xbQin7_t?nH{pIUE&MHhpjwex zy}g7lwUmtkmp+R%DMj(OIhN^tF`=KMwgELsd^qCF47n>cX>3EW3!(SX{cw0qSpRrH zL0BQv`J)&oUaWA1t}$|mWk%|NF(dkci^8lvDHLmyhl0Oa{=yQ~6 zE^jJqo0fMVCrO`AlaH?JUe#>juu`nuz7=aJ7(hcnjxip!F<)VyCu3|Jv97{sK{BdEQqOdTX{E~)ODX4lh*MSXf&)$@G`@4F%oSg8( zp5&ZK8r|V%R?O1j3e_)Cl<8t%LsV|Evh$DObMXm8a_9OiOTKd`J0;vnt<_5Il#7Wc zGhxEj$&pk{Ve*u`MQ({g5b%&#Gr4%9B*C#iYGQn0F1S(C{72mW<)UI5SHJKO45tNF z?8jP%Z;5KtQ~YLyt<8cZl<-tm0d~2w!} N(!jqo@ZYO}{{cz~>#G0& From a2159bdbdf85e4fffc9a98a92f234b73e04d7d27 Mon Sep 17 00:00:00 2001 From: lagarwal-uic Date: Wed, 11 May 2022 12:26:33 +0100 Subject: [PATCH 4/5] Initial commit of ruby gem created by openapi-generator from mockserver-client-5.13.2 yaml --- .openapi-generator/VERSION | 1 - .rspec | 2 - Gemfile | 3 +- README.md | 69 +- docs/Body.md | 43 +- docs/BodyAnyOf.md | 24 + docs/BodyAnyOf1.md | 26 + docs/BodyAnyOf2.md | 22 + docs/BodyAnyOf3.md | 22 + docs/BodyAnyOf4.md | 22 + docs/BodyAnyOf5.md | 22 + docs/BodyAnyOf6.md | 26 + docs/BodyAnyOf7.md | 24 + docs/BodyAnyOf8.md | 22 + docs/BodyAnyOf9.md | 22 + docs/BodyWithContentType.md | 27 +- docs/BodyWithContentTypeAnyOf.md | 24 + docs/BodyWithContentTypeAnyOf1.md | 24 + docs/BodyWithContentTypeAnyOf2.md | 24 + docs/BodyWithContentTypeAnyOf3.md | 24 + docs/ConnectionOptions.md | 32 +- docs/ControlApi.md | 276 +++++--- docs/Delay.md | 19 +- docs/Expectation.md | 46 +- docs/ExpectationApi.md | 116 +++- docs/ExpectationId.md | 18 + docs/Expectations.md | 48 +- docs/HttpClassCallback.md | 18 +- docs/HttpError.md | 22 +- docs/HttpForward.md | 25 +- docs/HttpObjectCallback.md | 20 +- docs/HttpOverrideForwardedRequest.md | 50 +- docs/HttpOverrideForwardedRequestOneOf.md | 26 + docs/HttpOverrideForwardedRequestOneOf1.md | 22 + ...ideForwardedRequestOneOfRequestModifier.md | 24 + ...ardedRequestOneOfRequestModifierCookies.md | 22 + ...orwardedRequestOneOfRequestModifierPath.md | 20 + ...eOfRequestModifierQueryStringParameters.md | 22 + ...deForwardedRequestOneOfResponseModifier.md | 20 + docs/HttpRequest.md | 41 +- docs/HttpResponse.md | 34 +- docs/HttpTemplate.md | 22 +- docs/KeyToMultiValue.md | 48 +- docs/KeyToMultiValueOneOf.md | 18 + docs/KeyToValue.md | 48 +- docs/OpenAPIDefinition.md | 20 + docs/OpenAPIExpectation.md | 20 + docs/OpenAPIExpectations.md | 49 ++ docs/Ports.md | 16 +- docs/PositiveIntegerDefault0.md | 15 + docs/RequestDefinition.md | 49 ++ docs/Schema.md | 82 +++ docs/SocketAddress.md | 22 + docs/StringOrJsonSchema.md | 49 ++ docs/StringOrJsonSchemaOneOf.md | 26 + docs/TimeToLive.md | 22 +- docs/Times.md | 19 +- docs/Verification.md | 48 +- docs/VerificationSequence.md | 47 +- docs/VerificationTimes.md | 19 +- docs/VerifyApi.md | 101 ++- git_push.sh | 57 ++ lib/mockserver-client.rb | 38 +- lib/mockserver-client/api/control_api.rb | 285 ++++++--- lib/mockserver-client/api/expectation_api.rb | 129 +++- lib/mockserver-client/api/verify_api.rb | 109 ++-- lib/mockserver-client/api_client.rb | 171 ++--- lib/mockserver-client/api_error.rb | 25 +- lib/mockserver-client/configuration.rb | 99 ++- lib/mockserver-client/models/body.rb | 283 +++++++- lib/mockserver-client/models/body_any_of.rb | 280 ++++++++ lib/mockserver-client/models/body_any_of1.rb | 301 +++++++++ lib/mockserver-client/models/body_any_of2.rb | 271 ++++++++ lib/mockserver-client/models/body_any_of3.rb | 271 ++++++++ lib/mockserver-client/models/body_any_of4.rb | 271 ++++++++ lib/mockserver-client/models/body_any_of5.rb | 271 ++++++++ lib/mockserver-client/models/body_any_of6.rb | 289 +++++++++ lib/mockserver-client/models/body_any_of7.rb | 280 ++++++++ lib/mockserver-client/models/body_any_of8.rb | 271 ++++++++ lib/mockserver-client/models/body_any_of9.rb | 271 ++++++++ .../models/body_with_content_type.rb | 193 +++++- .../models/body_with_content_type_any_of.rb | 280 ++++++++ .../models/body_with_content_type_any_of1.rb | 280 ++++++++ .../models/body_with_content_type_any_of2.rb | 280 ++++++++ .../models/body_with_content_type_any_of3.rb | 280 ++++++++ .../models/connection_options.rb | 134 ++-- lib/mockserver-client/models/delay.rb | 74 ++- lib/mockserver-client/models/expectation.rb | 230 +++---- .../models/expectation_id.rb | 223 +++++++ lib/mockserver-client/models/expectations.rb | 231 +++---- .../models/http_class_callback.rb | 82 ++- lib/mockserver-client/models/http_error.rb | 79 ++- lib/mockserver-client/models/http_forward.rb | 105 ++- .../models/http_object_callback.rb | 97 ++- .../models/http_override_forwarded_request.rb | 249 +++----- .../http_override_forwarded_request_one_of.rb | 254 ++++++++ ...http_override_forwarded_request_one_of1.rb | 236 +++++++ ...rwarded_request_one_of_request_modifier.rb | 245 +++++++ ...request_one_of_request_modifier_cookies.rb | 238 +++++++ ...ed_request_one_of_request_modifier_path.rb | 227 +++++++ ...equest_modifier_query_string_parameters.rb | 238 +++++++ ...warded_request_one_of_response_modifier.rb | 227 +++++++ lib/mockserver-client/models/http_request.rb | 163 +++-- lib/mockserver-client/models/http_response.rb | 103 ++- lib/mockserver-client/models/http_template.rb | 103 ++- .../models/key_to_multi_value.rb | 231 +++---- .../models/key_to_multi_value_one_of.rb | 254 ++++++++ lib/mockserver-client/models/key_to_value.rb | 231 +++---- .../models/open_api_definition.rb | 227 +++++++ .../models/open_api_expectation.rb | 230 +++++++ .../models/open_api_expectations.rb | 105 +++ lib/mockserver-client/models/ports.rb | 70 +- .../models/positive_integer_default0.rb | 209 ++++++ .../models/request_definition.rb | 105 +++ lib/mockserver-client/models/schema.rb | 602 ++++++++++++++++++ .../models/socket_address.rb | 270 ++++++++ .../models/string_or_json_schema.rb | 105 +++ .../models/string_or_json_schema_one_of.rb | 288 +++++++++ lib/mockserver-client/models/time_to_live.rb | 85 ++- lib/mockserver-client/models/times.rb | 75 ++- lib/mockserver-client/models/verification.rb | 249 +++----- .../models/verification_sequence.rb | 242 +++---- .../models/verification_times.rb | 94 ++- lib/mockserver-client/version.rb | 8 +- mockserver-client.gemspec | 25 +- spec/api/control_api_spec.rb | 42 +- spec/api/expectation_api_spec.rb | 29 +- spec/api/verify_api_spec.rb | 18 +- spec/api_client_spec.rb | 12 +- spec/configuration_spec.rb | 6 +- spec/models/body_any_of1_spec.rb | 66 ++ spec/models/body_any_of2_spec.rb | 50 ++ spec/models/body_any_of3_spec.rb | 50 ++ spec/models/body_any_of4_spec.rb | 50 ++ spec/models/body_any_of5_spec.rb | 50 ++ spec/models/body_any_of6_spec.rb | 62 ++ spec/models/body_any_of7_spec.rb | 56 ++ spec/models/body_any_of8_spec.rb | 50 ++ spec/models/body_any_of9_spec.rb | 50 ++ spec/models/body_any_of_spec.rb | 56 ++ spec/models/body_spec.rb | 115 +++- .../body_with_content_type_any_of1_spec.rb | 56 ++ .../body_with_content_type_any_of2_spec.rb | 56 ++ .../body_with_content_type_any_of3_spec.rb | 56 ++ .../body_with_content_type_any_of_spec.rb | 56 ++ spec/models/body_with_content_type_spec.rb | 63 +- spec/models/connection_options_spec.rb | 37 +- spec/models/delay_spec.rb | 19 +- spec/models/expectation_id_spec.rb | 34 + spec/models/expectation_spec.rb | 24 +- spec/models/expectations_spec.rb | 24 +- spec/models/http_class_callback_spec.rb | 25 +- spec/models/http_error_spec.rb | 19 +- spec/models/http_forward_spec.rb | 33 +- spec/models/http_object_callback_spec.rb | 31 +- ...override_forwarded_request_one_of1_spec.rb | 46 ++ ...st_one_of_request_modifier_cookies_spec.rb | 46 ++ ...quest_one_of_request_modifier_path_spec.rb | 40 ++ ...t_modifier_query_string_parameters_spec.rb | 46 ++ ...ed_request_one_of_request_modifier_spec.rb | 52 ++ ...d_request_one_of_response_modifier_spec.rb | 40 ++ ..._override_forwarded_request_one_of_spec.rb | 58 ++ .../http_override_forwarded_request_spec.rb | 34 +- spec/models/http_request_spec.rb | 45 +- spec/models/http_response_spec.rb | 23 +- spec/models/http_template_spec.rb | 33 +- spec/models/key_to_multi_value_one_of_spec.rb | 38 ++ spec/models/key_to_multi_value_spec.rb | 24 +- spec/models/key_to_value_spec.rb | 24 +- spec/models/open_api_definition_spec.rb | 40 ++ spec/models/open_api_expectation_spec.rb | 40 ++ spec/models/open_api_expectations_spec.rb | 31 + spec/models/ports_spec.rb | 19 +- spec/models/positive_integer_default0_spec.rb | 28 + spec/models/request_definition_spec.rb | 31 + spec/models/schema_spec.rb | 226 +++++++ spec/models/socket_address_spec.rb | 50 ++ .../string_or_json_schema_one_of_spec.rb | 62 ++ spec/models/string_or_json_schema_spec.rb | 31 + spec/models/time_to_live_spec.rb | 23 +- spec/models/times_spec.rb | 19 +- spec/models/verification_sequence_spec.rb | 30 +- spec/models/verification_spec.rb | 34 +- spec/models/verification_times_spec.rb | 23 +- spec/spec_helper.rb | 6 +- 185 files changed, 14750 insertions(+), 2449 deletions(-) delete mode 100644 .openapi-generator/VERSION delete mode 100644 .rspec create mode 100644 docs/BodyAnyOf.md create mode 100644 docs/BodyAnyOf1.md create mode 100644 docs/BodyAnyOf2.md create mode 100644 docs/BodyAnyOf3.md create mode 100644 docs/BodyAnyOf4.md create mode 100644 docs/BodyAnyOf5.md create mode 100644 docs/BodyAnyOf6.md create mode 100644 docs/BodyAnyOf7.md create mode 100644 docs/BodyAnyOf8.md create mode 100644 docs/BodyAnyOf9.md create mode 100644 docs/BodyWithContentTypeAnyOf.md create mode 100644 docs/BodyWithContentTypeAnyOf1.md create mode 100644 docs/BodyWithContentTypeAnyOf2.md create mode 100644 docs/BodyWithContentTypeAnyOf3.md create mode 100644 docs/ExpectationId.md create mode 100644 docs/HttpOverrideForwardedRequestOneOf.md create mode 100644 docs/HttpOverrideForwardedRequestOneOf1.md create mode 100644 docs/HttpOverrideForwardedRequestOneOfRequestModifier.md create mode 100644 docs/HttpOverrideForwardedRequestOneOfRequestModifierCookies.md create mode 100644 docs/HttpOverrideForwardedRequestOneOfRequestModifierPath.md create mode 100644 docs/HttpOverrideForwardedRequestOneOfRequestModifierQueryStringParameters.md create mode 100644 docs/HttpOverrideForwardedRequestOneOfResponseModifier.md create mode 100644 docs/KeyToMultiValueOneOf.md create mode 100644 docs/OpenAPIDefinition.md create mode 100644 docs/OpenAPIExpectation.md create mode 100644 docs/OpenAPIExpectations.md create mode 100644 docs/PositiveIntegerDefault0.md create mode 100644 docs/RequestDefinition.md create mode 100644 docs/Schema.md create mode 100644 docs/SocketAddress.md create mode 100644 docs/StringOrJsonSchema.md create mode 100644 docs/StringOrJsonSchemaOneOf.md create mode 100644 git_push.sh create mode 100644 lib/mockserver-client/models/body_any_of.rb create mode 100644 lib/mockserver-client/models/body_any_of1.rb create mode 100644 lib/mockserver-client/models/body_any_of2.rb create mode 100644 lib/mockserver-client/models/body_any_of3.rb create mode 100644 lib/mockserver-client/models/body_any_of4.rb create mode 100644 lib/mockserver-client/models/body_any_of5.rb create mode 100644 lib/mockserver-client/models/body_any_of6.rb create mode 100644 lib/mockserver-client/models/body_any_of7.rb create mode 100644 lib/mockserver-client/models/body_any_of8.rb create mode 100644 lib/mockserver-client/models/body_any_of9.rb create mode 100644 lib/mockserver-client/models/body_with_content_type_any_of.rb create mode 100644 lib/mockserver-client/models/body_with_content_type_any_of1.rb create mode 100644 lib/mockserver-client/models/body_with_content_type_any_of2.rb create mode 100644 lib/mockserver-client/models/body_with_content_type_any_of3.rb create mode 100644 lib/mockserver-client/models/expectation_id.rb create mode 100644 lib/mockserver-client/models/http_override_forwarded_request_one_of.rb create mode 100644 lib/mockserver-client/models/http_override_forwarded_request_one_of1.rb create mode 100644 lib/mockserver-client/models/http_override_forwarded_request_one_of_request_modifier.rb create mode 100644 lib/mockserver-client/models/http_override_forwarded_request_one_of_request_modifier_cookies.rb create mode 100644 lib/mockserver-client/models/http_override_forwarded_request_one_of_request_modifier_path.rb create mode 100644 lib/mockserver-client/models/http_override_forwarded_request_one_of_request_modifier_query_string_parameters.rb create mode 100644 lib/mockserver-client/models/http_override_forwarded_request_one_of_response_modifier.rb create mode 100644 lib/mockserver-client/models/key_to_multi_value_one_of.rb create mode 100644 lib/mockserver-client/models/open_api_definition.rb create mode 100644 lib/mockserver-client/models/open_api_expectation.rb create mode 100644 lib/mockserver-client/models/open_api_expectations.rb create mode 100644 lib/mockserver-client/models/positive_integer_default0.rb create mode 100644 lib/mockserver-client/models/request_definition.rb create mode 100644 lib/mockserver-client/models/schema.rb create mode 100644 lib/mockserver-client/models/socket_address.rb create mode 100644 lib/mockserver-client/models/string_or_json_schema.rb create mode 100644 lib/mockserver-client/models/string_or_json_schema_one_of.rb create mode 100644 spec/models/body_any_of1_spec.rb create mode 100644 spec/models/body_any_of2_spec.rb create mode 100644 spec/models/body_any_of3_spec.rb create mode 100644 spec/models/body_any_of4_spec.rb create mode 100644 spec/models/body_any_of5_spec.rb create mode 100644 spec/models/body_any_of6_spec.rb create mode 100644 spec/models/body_any_of7_spec.rb create mode 100644 spec/models/body_any_of8_spec.rb create mode 100644 spec/models/body_any_of9_spec.rb create mode 100644 spec/models/body_any_of_spec.rb create mode 100644 spec/models/body_with_content_type_any_of1_spec.rb create mode 100644 spec/models/body_with_content_type_any_of2_spec.rb create mode 100644 spec/models/body_with_content_type_any_of3_spec.rb create mode 100644 spec/models/body_with_content_type_any_of_spec.rb create mode 100644 spec/models/expectation_id_spec.rb create mode 100644 spec/models/http_override_forwarded_request_one_of1_spec.rb create mode 100644 spec/models/http_override_forwarded_request_one_of_request_modifier_cookies_spec.rb create mode 100644 spec/models/http_override_forwarded_request_one_of_request_modifier_path_spec.rb create mode 100644 spec/models/http_override_forwarded_request_one_of_request_modifier_query_string_parameters_spec.rb create mode 100644 spec/models/http_override_forwarded_request_one_of_request_modifier_spec.rb create mode 100644 spec/models/http_override_forwarded_request_one_of_response_modifier_spec.rb create mode 100644 spec/models/http_override_forwarded_request_one_of_spec.rb create mode 100644 spec/models/key_to_multi_value_one_of_spec.rb create mode 100644 spec/models/open_api_definition_spec.rb create mode 100644 spec/models/open_api_expectation_spec.rb create mode 100644 spec/models/open_api_expectations_spec.rb create mode 100644 spec/models/positive_integer_default0_spec.rb create mode 100644 spec/models/request_definition_spec.rb create mode 100644 spec/models/schema_spec.rb create mode 100644 spec/models/socket_address_spec.rb create mode 100644 spec/models/string_or_json_schema_one_of_spec.rb create mode 100644 spec/models/string_or_json_schema_spec.rb diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION deleted file mode 100644 index 712bd5a..0000000 --- a/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.3.1 \ No newline at end of file diff --git a/.rspec b/.rspec deleted file mode 100644 index 83e16f8..0000000 --- a/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---require spec_helper diff --git a/Gemfile b/Gemfile index 01ba313..c2e3127 100644 --- a/Gemfile +++ b/Gemfile @@ -3,6 +3,7 @@ source 'https://rubygems.org' gemspec group :development, :test do - gem 'rake', '~> 12.0.0' + gem 'rake', '~> 13.0.1' gem 'pry-byebug' + gem 'rubocop', '~> 0.66.0' end diff --git a/README.md b/README.md index f8b98c0..6272ccd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # mockserver-client -MockServer - the Ruby gem for the Mock Server API +MockServer - the Ruby gem for the MockServer API MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). @@ -10,8 +10,8 @@ Both MockServer and the MockServer Proxy record all received requests so that it This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 5.3.0 -- Package version: 5.3.0 +- API version: 5.13.2 +- Package version: 5.13.2 - Build package: org.openapitools.codegen.languages.RubyClientCodegen ## Installation @@ -27,15 +27,16 @@ gem build mockserver-client.gemspec Then either install the gem locally: ```shell -gem install ./mockserver-client-5.3.0.gem +gem install ./mockserver-client-5.13.2.gem ``` -(for development, run `gem install --dev ./mockserver-client-5.3.0.gem` to install the development dependencies) + +(for development, run `gem install --dev ./mockserver-client-5.13.2.gem` to install the development dependencies) or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). Finally add this to the Gemfile: - gem 'mockserver-client', '~> 5.3.0' + gem 'mockserver-client', '~> 5.13.2' ### Install from Git @@ -54,6 +55,7 @@ ruby -Ilib script.rb ## Getting Started Please follow the [installation](#installation) procedure and then run the following code: + ```ruby # Load the gem require 'mockserver-client' @@ -63,10 +65,10 @@ ports = MockServer::Ports.new # Ports | list of ports to bind to, where 0 indica begin #bind additional listening ports - result = api_instance.bind_put(ports) + result = api_instance.mockserver_bind_put(ports) p result rescue MockServer::ApiError => e - puts "Exception when calling ControlApi->bind_put: #{e}" + puts "Exception when calling ControlApi->mockserver_bind_put: #{e}" end ``` @@ -77,36 +79,69 @@ All URIs are relative to *http://localhost:1080* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*MockServer::ControlApi* | [**bind_put**](docs/ControlApi.md#bind_put) | **PUT** /bind | bind additional listening ports -*MockServer::ControlApi* | [**clear_put**](docs/ControlApi.md#clear_put) | **PUT** /clear | clears expectations and recorded requests that match the request matcher -*MockServer::ControlApi* | [**reset_put**](docs/ControlApi.md#reset_put) | **PUT** /reset | clears all expectations and recorded requests -*MockServer::ControlApi* | [**retrieve_put**](docs/ControlApi.md#retrieve_put) | **PUT** /retrieve | retrieve recorded requests, active expectations, recorded expectations or log messages -*MockServer::ControlApi* | [**status_put**](docs/ControlApi.md#status_put) | **PUT** /status | return listening ports -*MockServer::ControlApi* | [**stop_put**](docs/ControlApi.md#stop_put) | **PUT** /stop | stop running process -*MockServer::ExpectationApi* | [**expectation_put**](docs/ExpectationApi.md#expectation_put) | **PUT** /expectation | create expectation -*MockServer::VerifyApi* | [**verify_put**](docs/VerifyApi.md#verify_put) | **PUT** /verify | verify a request has been received a specific number of times -*MockServer::VerifyApi* | [**verify_sequence_put**](docs/VerifyApi.md#verify_sequence_put) | **PUT** /verifySequence | verify a sequence of request has been received in the specific order +*MockServer::ControlApi* | [**mockserver_bind_put**](docs/ControlApi.md#mockserver_bind_put) | **PUT** /mockserver/bind | bind additional listening ports +*MockServer::ControlApi* | [**mockserver_clear_put**](docs/ControlApi.md#mockserver_clear_put) | **PUT** /mockserver/clear | clears expectations and recorded requests that match the request matcher +*MockServer::ControlApi* | [**mockserver_reset_put**](docs/ControlApi.md#mockserver_reset_put) | **PUT** /mockserver/reset | clears all expectations and recorded requests +*MockServer::ControlApi* | [**mockserver_retrieve_put**](docs/ControlApi.md#mockserver_retrieve_put) | **PUT** /mockserver/retrieve | retrieve recorded requests, active expectations, recorded expectations or log messages +*MockServer::ControlApi* | [**mockserver_status_put**](docs/ControlApi.md#mockserver_status_put) | **PUT** /mockserver/status | return listening ports +*MockServer::ControlApi* | [**mockserver_stop_put**](docs/ControlApi.md#mockserver_stop_put) | **PUT** /mockserver/stop | stop running process +*MockServer::ExpectationApi* | [**mockserver_expectation_put**](docs/ExpectationApi.md#mockserver_expectation_put) | **PUT** /mockserver/expectation | create expectation +*MockServer::ExpectationApi* | [**mockserver_openapi_put**](docs/ExpectationApi.md#mockserver_openapi_put) | **PUT** /mockserver/openapi | create expectations from OpenAPI or Swagger +*MockServer::VerifyApi* | [**mockserver_verify_put**](docs/VerifyApi.md#mockserver_verify_put) | **PUT** /mockserver/verify | verify a request has been received a specific number of times +*MockServer::VerifyApi* | [**mockserver_verify_sequence_put**](docs/VerifyApi.md#mockserver_verify_sequence_put) | **PUT** /mockserver/verifySequence | verify a sequence of request has been received in the specific order ## Documentation for Models - [MockServer::Body](docs/Body.md) + - [MockServer::BodyAnyOf](docs/BodyAnyOf.md) + - [MockServer::BodyAnyOf1](docs/BodyAnyOf1.md) + - [MockServer::BodyAnyOf2](docs/BodyAnyOf2.md) + - [MockServer::BodyAnyOf3](docs/BodyAnyOf3.md) + - [MockServer::BodyAnyOf4](docs/BodyAnyOf4.md) + - [MockServer::BodyAnyOf5](docs/BodyAnyOf5.md) + - [MockServer::BodyAnyOf6](docs/BodyAnyOf6.md) + - [MockServer::BodyAnyOf7](docs/BodyAnyOf7.md) + - [MockServer::BodyAnyOf8](docs/BodyAnyOf8.md) + - [MockServer::BodyAnyOf9](docs/BodyAnyOf9.md) - [MockServer::BodyWithContentType](docs/BodyWithContentType.md) + - [MockServer::BodyWithContentTypeAnyOf](docs/BodyWithContentTypeAnyOf.md) + - [MockServer::BodyWithContentTypeAnyOf1](docs/BodyWithContentTypeAnyOf1.md) + - [MockServer::BodyWithContentTypeAnyOf2](docs/BodyWithContentTypeAnyOf2.md) + - [MockServer::BodyWithContentTypeAnyOf3](docs/BodyWithContentTypeAnyOf3.md) - [MockServer::ConnectionOptions](docs/ConnectionOptions.md) - [MockServer::Delay](docs/Delay.md) - [MockServer::Expectation](docs/Expectation.md) + - [MockServer::ExpectationId](docs/ExpectationId.md) - [MockServer::Expectations](docs/Expectations.md) - [MockServer::HttpClassCallback](docs/HttpClassCallback.md) - [MockServer::HttpError](docs/HttpError.md) - [MockServer::HttpForward](docs/HttpForward.md) - [MockServer::HttpObjectCallback](docs/HttpObjectCallback.md) - [MockServer::HttpOverrideForwardedRequest](docs/HttpOverrideForwardedRequest.md) + - [MockServer::HttpOverrideForwardedRequestOneOf](docs/HttpOverrideForwardedRequestOneOf.md) + - [MockServer::HttpOverrideForwardedRequestOneOf1](docs/HttpOverrideForwardedRequestOneOf1.md) + - [MockServer::HttpOverrideForwardedRequestOneOfRequestModifier](docs/HttpOverrideForwardedRequestOneOfRequestModifier.md) + - [MockServer::HttpOverrideForwardedRequestOneOfRequestModifierCookies](docs/HttpOverrideForwardedRequestOneOfRequestModifierCookies.md) + - [MockServer::HttpOverrideForwardedRequestOneOfRequestModifierPath](docs/HttpOverrideForwardedRequestOneOfRequestModifierPath.md) + - [MockServer::HttpOverrideForwardedRequestOneOfRequestModifierQueryStringParameters](docs/HttpOverrideForwardedRequestOneOfRequestModifierQueryStringParameters.md) + - [MockServer::HttpOverrideForwardedRequestOneOfResponseModifier](docs/HttpOverrideForwardedRequestOneOfResponseModifier.md) - [MockServer::HttpRequest](docs/HttpRequest.md) - [MockServer::HttpResponse](docs/HttpResponse.md) - [MockServer::HttpTemplate](docs/HttpTemplate.md) - [MockServer::KeyToMultiValue](docs/KeyToMultiValue.md) + - [MockServer::KeyToMultiValueOneOf](docs/KeyToMultiValueOneOf.md) - [MockServer::KeyToValue](docs/KeyToValue.md) + - [MockServer::OpenAPIDefinition](docs/OpenAPIDefinition.md) + - [MockServer::OpenAPIExpectation](docs/OpenAPIExpectation.md) + - [MockServer::OpenAPIExpectations](docs/OpenAPIExpectations.md) - [MockServer::Ports](docs/Ports.md) + - [MockServer::PositiveIntegerDefault0](docs/PositiveIntegerDefault0.md) + - [MockServer::RequestDefinition](docs/RequestDefinition.md) + - [MockServer::Schema](docs/Schema.md) + - [MockServer::SocketAddress](docs/SocketAddress.md) + - [MockServer::StringOrJsonSchema](docs/StringOrJsonSchema.md) + - [MockServer::StringOrJsonSchemaOneOf](docs/StringOrJsonSchemaOneOf.md) - [MockServer::TimeToLive](docs/TimeToLive.md) - [MockServer::Times](docs/Times.md) - [MockServer::Verification](docs/Verification.md) diff --git a/docs/Body.md b/docs/Body.md index 96ba4b3..1abc95f 100644 --- a/docs/Body.md +++ b/docs/Body.md @@ -1,7 +1,46 @@ # MockServer::Body ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_not** | **Boolean** | | [optional] | +| **type** | **String** | | [optional] | +| **base64_bytes** | **String** | | [optional] | +| **content_type** | **String** | | [optional] | +| **json** | **String** | | [optional] | +| **match_type** | **String** | | [optional] | +| **json_schema** | **Object** | | [optional] | +| **json_path** | **String** | | [optional] | +| **parameters** | [**KeyToMultiValue**](KeyToMultiValue.md) | | [optional] | +| **regex** | **String** | | [optional] | +| **string** | **String** | | [optional] | +| **sub_string** | **Boolean** | | [optional] | +| **xml** | **String** | | [optional] | +| **xml_schema** | **String** | | [optional] | +| **xpath** | **String** | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::Body.new( + _not: null, + type: null, + base64_bytes: null, + content_type: null, + json: null, + match_type: null, + json_schema: null, + json_path: null, + parameters: null, + regex: null, + string: null, + sub_string: null, + xml: null, + xml_schema: null, + xpath: null +) +``` diff --git a/docs/BodyAnyOf.md b/docs/BodyAnyOf.md new file mode 100644 index 0000000..8b2cb3c --- /dev/null +++ b/docs/BodyAnyOf.md @@ -0,0 +1,24 @@ +# MockServer::BodyAnyOf + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_not** | **Boolean** | | [optional] | +| **type** | **String** | | [optional] | +| **base64_bytes** | **String** | | [optional] | +| **content_type** | **String** | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::BodyAnyOf.new( + _not: null, + type: null, + base64_bytes: null, + content_type: null +) +``` + diff --git a/docs/BodyAnyOf1.md b/docs/BodyAnyOf1.md new file mode 100644 index 0000000..ae20d47 --- /dev/null +++ b/docs/BodyAnyOf1.md @@ -0,0 +1,26 @@ +# MockServer::BodyAnyOf1 + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_not** | **Boolean** | | [optional] | +| **type** | **String** | | [optional] | +| **json** | **String** | | [optional] | +| **content_type** | **String** | | [optional] | +| **match_type** | **String** | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::BodyAnyOf1.new( + _not: null, + type: null, + json: null, + content_type: null, + match_type: null +) +``` + diff --git a/docs/BodyAnyOf2.md b/docs/BodyAnyOf2.md new file mode 100644 index 0000000..3562cd5 --- /dev/null +++ b/docs/BodyAnyOf2.md @@ -0,0 +1,22 @@ +# MockServer::BodyAnyOf2 + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_not** | **Boolean** | | [optional] | +| **type** | **String** | | [optional] | +| **json_schema** | **Object** | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::BodyAnyOf2.new( + _not: null, + type: null, + json_schema: null +) +``` + diff --git a/docs/BodyAnyOf3.md b/docs/BodyAnyOf3.md new file mode 100644 index 0000000..4fbf7c7 --- /dev/null +++ b/docs/BodyAnyOf3.md @@ -0,0 +1,22 @@ +# MockServer::BodyAnyOf3 + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_not** | **Boolean** | | [optional] | +| **type** | **String** | | [optional] | +| **json_path** | **String** | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::BodyAnyOf3.new( + _not: null, + type: null, + json_path: null +) +``` + diff --git a/docs/BodyAnyOf4.md b/docs/BodyAnyOf4.md new file mode 100644 index 0000000..ffae89e --- /dev/null +++ b/docs/BodyAnyOf4.md @@ -0,0 +1,22 @@ +# MockServer::BodyAnyOf4 + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_not** | **Boolean** | | [optional] | +| **type** | **String** | | [optional] | +| **parameters** | [**KeyToMultiValue**](KeyToMultiValue.md) | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::BodyAnyOf4.new( + _not: null, + type: null, + parameters: null +) +``` + diff --git a/docs/BodyAnyOf5.md b/docs/BodyAnyOf5.md new file mode 100644 index 0000000..68a2d0e --- /dev/null +++ b/docs/BodyAnyOf5.md @@ -0,0 +1,22 @@ +# MockServer::BodyAnyOf5 + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_not** | **Boolean** | | [optional] | +| **type** | **String** | | [optional] | +| **regex** | **String** | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::BodyAnyOf5.new( + _not: null, + type: null, + regex: null +) +``` + diff --git a/docs/BodyAnyOf6.md b/docs/BodyAnyOf6.md new file mode 100644 index 0000000..c151698 --- /dev/null +++ b/docs/BodyAnyOf6.md @@ -0,0 +1,26 @@ +# MockServer::BodyAnyOf6 + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_not** | **Boolean** | | [optional] | +| **type** | **String** | | [optional] | +| **string** | **String** | | [optional] | +| **content_type** | **String** | | [optional] | +| **sub_string** | **Boolean** | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::BodyAnyOf6.new( + _not: null, + type: null, + string: null, + content_type: null, + sub_string: null +) +``` + diff --git a/docs/BodyAnyOf7.md b/docs/BodyAnyOf7.md new file mode 100644 index 0000000..207571c --- /dev/null +++ b/docs/BodyAnyOf7.md @@ -0,0 +1,24 @@ +# MockServer::BodyAnyOf7 + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_not** | **Boolean** | | [optional] | +| **type** | **String** | | [optional] | +| **xml** | **String** | | [optional] | +| **content_type** | **String** | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::BodyAnyOf7.new( + _not: null, + type: null, + xml: null, + content_type: null +) +``` + diff --git a/docs/BodyAnyOf8.md b/docs/BodyAnyOf8.md new file mode 100644 index 0000000..a177bb1 --- /dev/null +++ b/docs/BodyAnyOf8.md @@ -0,0 +1,22 @@ +# MockServer::BodyAnyOf8 + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_not** | **Boolean** | | [optional] | +| **type** | **String** | | [optional] | +| **xml_schema** | **String** | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::BodyAnyOf8.new( + _not: null, + type: null, + xml_schema: null +) +``` + diff --git a/docs/BodyAnyOf9.md b/docs/BodyAnyOf9.md new file mode 100644 index 0000000..dc5054b --- /dev/null +++ b/docs/BodyAnyOf9.md @@ -0,0 +1,22 @@ +# MockServer::BodyAnyOf9 + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_not** | **Boolean** | | [optional] | +| **type** | **String** | | [optional] | +| **xpath** | **String** | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::BodyAnyOf9.new( + _not: null, + type: null, + xpath: null +) +``` + diff --git a/docs/BodyWithContentType.md b/docs/BodyWithContentType.md index 8abd2b7..d3b809f 100644 --- a/docs/BodyWithContentType.md +++ b/docs/BodyWithContentType.md @@ -1,7 +1,30 @@ # MockServer::BodyWithContentType ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_not** | **Boolean** | | [optional] | +| **type** | **String** | | [optional] | +| **base64_bytes** | **String** | | [optional] | +| **content_type** | **String** | | [optional] | +| **json** | **String** | | [optional] | +| **string** | **String** | | [optional] | +| **xml** | **String** | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::BodyWithContentType.new( + _not: null, + type: null, + base64_bytes: null, + content_type: null, + json: null, + string: null, + xml: null +) +``` diff --git a/docs/BodyWithContentTypeAnyOf.md b/docs/BodyWithContentTypeAnyOf.md new file mode 100644 index 0000000..137b840 --- /dev/null +++ b/docs/BodyWithContentTypeAnyOf.md @@ -0,0 +1,24 @@ +# MockServer::BodyWithContentTypeAnyOf + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_not** | **Boolean** | | [optional] | +| **type** | **String** | | [optional] | +| **base64_bytes** | **String** | | [optional] | +| **content_type** | **String** | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::BodyWithContentTypeAnyOf.new( + _not: null, + type: null, + base64_bytes: null, + content_type: null +) +``` + diff --git a/docs/BodyWithContentTypeAnyOf1.md b/docs/BodyWithContentTypeAnyOf1.md new file mode 100644 index 0000000..5434f1a --- /dev/null +++ b/docs/BodyWithContentTypeAnyOf1.md @@ -0,0 +1,24 @@ +# MockServer::BodyWithContentTypeAnyOf1 + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_not** | **Boolean** | | [optional] | +| **type** | **String** | | [optional] | +| **json** | **String** | | [optional] | +| **content_type** | **String** | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::BodyWithContentTypeAnyOf1.new( + _not: null, + type: null, + json: null, + content_type: null +) +``` + diff --git a/docs/BodyWithContentTypeAnyOf2.md b/docs/BodyWithContentTypeAnyOf2.md new file mode 100644 index 0000000..9d0a659 --- /dev/null +++ b/docs/BodyWithContentTypeAnyOf2.md @@ -0,0 +1,24 @@ +# MockServer::BodyWithContentTypeAnyOf2 + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_not** | **Boolean** | | [optional] | +| **type** | **String** | | [optional] | +| **string** | **String** | | [optional] | +| **content_type** | **String** | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::BodyWithContentTypeAnyOf2.new( + _not: null, + type: null, + string: null, + content_type: null +) +``` + diff --git a/docs/BodyWithContentTypeAnyOf3.md b/docs/BodyWithContentTypeAnyOf3.md new file mode 100644 index 0000000..15adaa7 --- /dev/null +++ b/docs/BodyWithContentTypeAnyOf3.md @@ -0,0 +1,24 @@ +# MockServer::BodyWithContentTypeAnyOf3 + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_not** | **Boolean** | | [optional] | +| **type** | **String** | | [optional] | +| **xml** | **String** | | [optional] | +| **content_type** | **String** | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::BodyWithContentTypeAnyOf3.new( + _not: null, + type: null, + xml: null, + content_type: null +) +``` + diff --git a/docs/ConnectionOptions.md b/docs/ConnectionOptions.md index fac497b..de9cb9d 100644 --- a/docs/ConnectionOptions.md +++ b/docs/ConnectionOptions.md @@ -1,12 +1,30 @@ # MockServer::ConnectionOptions ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**close_socket** | **BOOLEAN** | | [optional] -**content_length_header_override** | **Integer** | | [optional] -**suppress_content_length_header** | **BOOLEAN** | | [optional] -**suppress_connection_header** | **BOOLEAN** | | [optional] -**keep_alive_override** | **BOOLEAN** | | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **suppress_content_length_header** | **Boolean** | | [optional] | +| **content_length_header_override** | **Integer** | | [optional] | +| **suppress_connection_header** | **Boolean** | | [optional] | +| **chunk_size** | **Integer** | | [optional] | +| **keep_alive_override** | **Boolean** | | [optional] | +| **close_socket** | **Boolean** | | [optional] | +| **close_socket_delay** | [**Delay**](Delay.md) | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::ConnectionOptions.new( + suppress_content_length_header: null, + content_length_header_override: null, + suppress_connection_header: null, + chunk_size: null, + keep_alive_override: null, + close_socket: null, + close_socket_delay: null +) +``` diff --git a/docs/ControlApi.md b/docs/ControlApi.md index eac6065..fe66aeb 100644 --- a/docs/ControlApi.md +++ b/docs/ControlApi.md @@ -2,45 +2,65 @@ All URIs are relative to *http://localhost:1080* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**bind_put**](ControlApi.md#bind_put) | **PUT** /bind | bind additional listening ports -[**clear_put**](ControlApi.md#clear_put) | **PUT** /clear | clears expectations and recorded requests that match the request matcher -[**reset_put**](ControlApi.md#reset_put) | **PUT** /reset | clears all expectations and recorded requests -[**retrieve_put**](ControlApi.md#retrieve_put) | **PUT** /retrieve | retrieve recorded requests, active expectations, recorded expectations or log messages -[**status_put**](ControlApi.md#status_put) | **PUT** /status | return listening ports -[**stop_put**](ControlApi.md#stop_put) | **PUT** /stop | stop running process +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**mockserver_bind_put**](ControlApi.md#mockserver_bind_put) | **PUT** /mockserver/bind | bind additional listening ports | +| [**mockserver_clear_put**](ControlApi.md#mockserver_clear_put) | **PUT** /mockserver/clear | clears expectations and recorded requests that match the request matcher | +| [**mockserver_reset_put**](ControlApi.md#mockserver_reset_put) | **PUT** /mockserver/reset | clears all expectations and recorded requests | +| [**mockserver_retrieve_put**](ControlApi.md#mockserver_retrieve_put) | **PUT** /mockserver/retrieve | retrieve recorded requests, active expectations, recorded expectations or log messages | +| [**mockserver_status_put**](ControlApi.md#mockserver_status_put) | **PUT** /mockserver/status | return listening ports | +| [**mockserver_stop_put**](ControlApi.md#mockserver_stop_put) | **PUT** /mockserver/stop | stop running process | -# **bind_put** -> Ports bind_put(ports) +## mockserver_bind_put + +> mockserver_bind_put(ports) bind additional listening ports only supported on Netty version -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'mockserver-client' api_instance = MockServer::ControlApi.new ports = MockServer::Ports.new # Ports | list of ports to bind to, where 0 indicates dynamically bind to any available port begin - #bind additional listening ports - result = api_instance.bind_put(ports) + # bind additional listening ports + result = api_instance.mockserver_bind_put(ports) p result rescue MockServer::ApiError => e - puts "Exception when calling ControlApi->bind_put: #{e}" + puts "Error when calling ControlApi->mockserver_bind_put: #{e}" +end +``` + +#### Using the mockserver_bind_put_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> mockserver_bind_put_with_http_info(ports) + +```ruby +begin + # bind additional listening ports + data, status_code, headers = api_instance.mockserver_bind_put_with_http_info(ports) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue MockServer::ApiError => e + puts "Error when calling ControlApi->mockserver_bind_put_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ports** | [**Ports**](Ports.md)| list of ports to bind to, where 0 indicates dynamically bind to any available port | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **ports** | [**Ports**](Ports.md) | list of ports to bind to, where 0 indicates dynamically bind to any available port | | ### Return type @@ -52,39 +72,58 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json +- **Content-Type**: application/json +- **Accept**: application/json +## mockserver_clear_put -# **clear_put** -> clear_put(opts) +> mockserver_clear_put(opts) clears expectations and recorded requests that match the request matcher -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'mockserver-client' api_instance = MockServer::ControlApi.new opts = { - http_request: MockServer::HttpRequest.new # HttpRequest | request used to match expectations and recored requests to clear + unknown_base_type: TODO # UNKNOWN_BASE_TYPE | request used to match expectations and recored requests to clear } begin - #clears expectations and recorded requests that match the request matcher - api_instance.clear_put(opts) + # clears expectations and recorded requests that match the request matcher + api_instance.mockserver_clear_put(opts) rescue MockServer::ApiError => e - puts "Exception when calling ControlApi->clear_put: #{e}" + puts "Error when calling ControlApi->mockserver_clear_put: #{e}" +end +``` + +#### Using the mockserver_clear_put_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> mockserver_clear_put_with_http_info(opts) + +```ruby +begin + # clears expectations and recorded requests that match the request matcher + data, status_code, headers = api_instance.mockserver_clear_put_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue MockServer::ApiError => e + puts "Error when calling ControlApi->mockserver_clear_put_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **http_request** | [**HttpRequest**](HttpRequest.md)| request used to match expectations and recored requests to clear | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **unknown_base_type** | [**UNKNOWN_BASE_TYPE**](UNKNOWN_BASE_TYPE.md) | request used to match expectations and recored requests to clear | [optional] | ### Return type @@ -96,32 +135,52 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: Not defined +- **Content-Type**: application/json +- **Accept**: Not defined +## mockserver_reset_put -# **reset_put** -> reset_put +> mockserver_reset_put clears all expectations and recorded requests -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'mockserver-client' api_instance = MockServer::ControlApi.new begin - #clears all expectations and recorded requests - api_instance.reset_put + # clears all expectations and recorded requests + api_instance.mockserver_reset_put +rescue MockServer::ApiError => e + puts "Error when calling ControlApi->mockserver_reset_put: #{e}" +end +``` + +#### Using the mockserver_reset_put_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> mockserver_reset_put_with_http_info + +```ruby +begin + # clears all expectations and recorded requests + data, status_code, headers = api_instance.mockserver_reset_put_with_http_info + p status_code # => 2xx + p headers # => { ... } + p data # => nil rescue MockServer::ApiError => e - puts "Exception when calling ControlApi->reset_put: #{e}" + puts "Error when calling ControlApi->mockserver_reset_put_with_http_info: #{e}" end ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -134,48 +193,67 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined +## mockserver_retrieve_put -# **retrieve_put** -> Object retrieve_put(opts) +> mockserver_retrieve_put(opts) retrieve recorded requests, active expectations, recorded expectations or log messages -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'mockserver-client' api_instance = MockServer::ControlApi.new opts = { - format: 'format_example', # String | changes response format, default if not specificed is \"json\", supported values are \"java\", \"json\" - type: 'type_example', # String | specifies the type of object that is retrieve, default if not specified is \"requests\", supported values are \"logs\", \"requests\", \"recorded_expectations\", \"active_expectations\" - http_request: MockServer::HttpRequest.new # HttpRequest | request used to match which recorded requests, expectations or log messages to return, an empty body matches all requests, expectations or log messages + format: 'java', # String | changes response format, default if not specificed is \"json\", supported values are \"java\", \"json\", \"log_entries\" + type: 'logs', # String | specifies the type of object that is retrieve, default if not specified is \"requests\", supported values are \"logs\", \"requests\", \"recorded_expectations\", \"active_expectations\" + request_definition: MockServer::HttpRequest.new # RequestDefinition | request used to match which recorded requests, expectations or log messages to return, an empty body matches all requests, expectations or log messages } begin - #retrieve recorded requests, active expectations, recorded expectations or log messages - result = api_instance.retrieve_put(opts) + # retrieve recorded requests, active expectations, recorded expectations or log messages + result = api_instance.mockserver_retrieve_put(opts) p result rescue MockServer::ApiError => e - puts "Exception when calling ControlApi->retrieve_put: #{e}" + puts "Error when calling ControlApi->mockserver_retrieve_put: #{e}" +end +``` + +#### Using the mockserver_retrieve_put_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> mockserver_retrieve_put_with_http_info(opts) + +```ruby +begin + # retrieve recorded requests, active expectations, recorded expectations or log messages + data, status_code, headers = api_instance.mockserver_retrieve_put_with_http_info(opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue MockServer::ApiError => e + puts "Error when calling ControlApi->mockserver_retrieve_put_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **format** | **String**| changes response format, default if not specificed is \"json\", supported values are \"java\", \"json\" | [optional] - **type** | **String**| specifies the type of object that is retrieve, default if not specified is \"requests\", supported values are \"logs\", \"requests\", \"recorded_expectations\", \"active_expectations\" | [optional] - **http_request** | [**HttpRequest**](HttpRequest.md)| request used to match which recorded requests, expectations or log messages to return, an empty body matches all requests, expectations or log messages | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **format** | **String** | changes response format, default if not specificed is \"json\", supported values are \"java\", \"json\", \"log_entries\" | [optional] | +| **type** | **String** | specifies the type of object that is retrieve, default if not specified is \"requests\", supported values are \"logs\", \"requests\", \"recorded_expectations\", \"active_expectations\" | [optional] | +| **request_definition** | [**RequestDefinition**](RequestDefinition.md) | request used to match which recorded requests, expectations or log messages to return, an empty body matches all requests, expectations or log messages | [optional] | ### Return type -**Object** +[**OneOfarrayarray**](OneOfarrayarray.md) ### Authorization @@ -183,33 +261,53 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json, application/java, text/plain +- **Content-Type**: application/json +- **Accept**: application/json, application/java, text/plain +## mockserver_status_put -# **status_put** -> Ports status_put +> mockserver_status_put return listening ports -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'mockserver-client' api_instance = MockServer::ControlApi.new begin - #return listening ports - result = api_instance.status_put + # return listening ports + result = api_instance.mockserver_status_put p result rescue MockServer::ApiError => e - puts "Exception when calling ControlApi->status_put: #{e}" + puts "Error when calling ControlApi->mockserver_status_put: #{e}" +end +``` + +#### Using the mockserver_status_put_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> mockserver_status_put_with_http_info + +```ruby +begin + # return listening ports + data, status_code, headers = api_instance.mockserver_status_put_with_http_info + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue MockServer::ApiError => e + puts "Error when calling ControlApi->mockserver_status_put_with_http_info: #{e}" end ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -222,34 +320,54 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json +## mockserver_stop_put -# **stop_put** -> stop_put +> mockserver_stop_put stop running process only supported on Netty version -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'mockserver-client' api_instance = MockServer::ControlApi.new begin - #stop running process - api_instance.stop_put + # stop running process + api_instance.mockserver_stop_put +rescue MockServer::ApiError => e + puts "Error when calling ControlApi->mockserver_stop_put: #{e}" +end +``` + +#### Using the mockserver_stop_put_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> mockserver_stop_put_with_http_info + +```ruby +begin + # stop running process + data, status_code, headers = api_instance.mockserver_stop_put_with_http_info + p status_code # => 2xx + p headers # => { ... } + p data # => nil rescue MockServer::ApiError => e - puts "Exception when calling ControlApi->stop_put: #{e}" + puts "Error when calling ControlApi->mockserver_stop_put_with_http_info: #{e}" end ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -262,8 +380,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined - - +- **Content-Type**: Not defined +- **Accept**: Not defined diff --git a/docs/Delay.md b/docs/Delay.md index 59b5218..6456e4d 100644 --- a/docs/Delay.md +++ b/docs/Delay.md @@ -1,9 +1,20 @@ # MockServer::Delay ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**time_unit** | **String** | | [optional] -**value** | **Integer** | | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **time_unit** | **String** | | [optional] | +| **value** | **Integer** | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::Delay.new( + time_unit: null, + value: null +) +``` diff --git a/docs/Expectation.md b/docs/Expectation.md index 690e6e7..da33070 100644 --- a/docs/Expectation.md +++ b/docs/Expectation.md @@ -1,7 +1,47 @@ # MockServer::Expectation -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +## Class instance methods +### `openapi_one_of` + +Returns the list of classes defined in oneOf. + +#### Example + +```ruby +require 'mockserver-client' + +MockServer::Expectation.openapi_one_of +# => +# [ +# :'Object' +# ] +``` + +### build + +Find the appropriate object from the `openapi_one_of` list and casts the data into it. + +#### Example + +```ruby +require 'mockserver-client' + +MockServer::Expectation.build(data) +# => # + +MockServer::Expectation.build(data_that_doesnt_match) +# => nil +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| **data** | **Mixed** | data to be matched against the list of oneOf items | + +#### Return type + +- `Object` +- `nil` (if no type matches) diff --git a/docs/ExpectationApi.md b/docs/ExpectationApi.md index afb2210..465b273 100644 --- a/docs/ExpectationApi.md +++ b/docs/ExpectationApi.md @@ -2,41 +2,63 @@ All URIs are relative to *http://localhost:1080* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**expectation_put**](ExpectationApi.md#expectation_put) | **PUT** /expectation | create expectation +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**mockserver_expectation_put**](ExpectationApi.md#mockserver_expectation_put) | **PUT** /mockserver/expectation | create expectation | +| [**mockserver_openapi_put**](ExpectationApi.md#mockserver_openapi_put) | **PUT** /mockserver/openapi | create expectations from OpenAPI or Swagger | -# **expectation_put** -> expectation_put(expectations) +## mockserver_expectation_put + +> > mockserver_expectation_put(expectations) create expectation -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'mockserver-client' api_instance = MockServer::ExpectationApi.new -expectations = nil # Array | expectation to create +expectations = nil # Expectations | expectation(s) to create + +begin + # create expectation + result = api_instance.mockserver_expectation_put(expectations) + p result +rescue MockServer::ApiError => e + puts "Error when calling ExpectationApi->mockserver_expectation_put: #{e}" +end +``` + +#### Using the mockserver_expectation_put_with_http_info variant + +This returns an Array which contains the response data, status code and headers. +> >, Integer, Hash)> mockserver_expectation_put_with_http_info(expectations) + +```ruby begin - #create expectation - api_instance.expectation_put(expectations) + # create expectation + data, status_code, headers = api_instance.mockserver_expectation_put_with_http_info(expectations) + p status_code # => 2xx + p headers # => { ... } + p data # => > rescue MockServer::ApiError => e - puts "Exception when calling ExpectationApi->expectation_put: #{e}" + puts "Error when calling ExpectationApi->mockserver_expectation_put_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **expectations** | [**Array<Expectations>**](Array.md)| expectation to create | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **expectations** | [**Expectations**](Expectations.md) | expectation(s) to create | | ### Return type -nil (empty response body) +[**Array<Expectation>**](Expectation.md) ### Authorization @@ -44,8 +66,68 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: Not defined +- **Content-Type**: application/json +- **Accept**: application/json + + +## mockserver_openapi_put + +> > mockserver_openapi_put(open_api_expectations) + +create expectations from OpenAPI or Swagger + +### Examples + +```ruby +require 'time' +require 'mockserver-client' + +api_instance = MockServer::ExpectationApi.new +open_api_expectations = nil # OpenAPIExpectations | expectation(s) to create + +begin + # create expectations from OpenAPI or Swagger + result = api_instance.mockserver_openapi_put(open_api_expectations) + p result +rescue MockServer::ApiError => e + puts "Error when calling ExpectationApi->mockserver_openapi_put: #{e}" +end +``` + +#### Using the mockserver_openapi_put_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> mockserver_openapi_put_with_http_info(open_api_expectations) + +```ruby +begin + # create expectations from OpenAPI or Swagger + data, status_code, headers = api_instance.mockserver_openapi_put_with_http_info(open_api_expectations) + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue MockServer::ApiError => e + puts "Error when calling ExpectationApi->mockserver_openapi_put_with_http_info: #{e}" +end +``` +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **open_api_expectations** | [**OpenAPIExpectations**](OpenAPIExpectations.md) | expectation(s) to create | | + +### Return type + +[**Array<Expectation>**](Expectation.md) + +### Authorization + +No authorization required + +### HTTP request headers +- **Content-Type**: application/json +- **Accept**: application/json diff --git a/docs/ExpectationId.md b/docs/ExpectationId.md new file mode 100644 index 0000000..c664c41 --- /dev/null +++ b/docs/ExpectationId.md @@ -0,0 +1,18 @@ +# MockServer::ExpectationId + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | | | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::ExpectationId.new( + id: null +) +``` + diff --git a/docs/Expectations.md b/docs/Expectations.md index 6d441cf..6917c3e 100644 --- a/docs/Expectations.md +++ b/docs/Expectations.md @@ -1,7 +1,49 @@ # MockServer::Expectations -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +## Class instance methods +### `openapi_one_of` + +Returns the list of classes defined in oneOf. + +#### Example + +```ruby +require 'mockserver-client' + +MockServer::Expectations.openapi_one_of +# => +# [ +# :'Array', +# :'Expectation' +# ] +``` + +### build + +Find the appropriate object from the `openapi_one_of` list and casts the data into it. + +#### Example + +```ruby +require 'mockserver-client' + +MockServer::Expectations.build(data) +# => #:0x00007fdd4aab02a0> + +MockServer::Expectations.build(data_that_doesnt_match) +# => nil +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| **data** | **Mixed** | data to be matched against the list of oneOf items | + +#### Return type + +- `Array` +- `Expectation` +- `nil` (if no type matches) diff --git a/docs/HttpClassCallback.md b/docs/HttpClassCallback.md index 93f2a2b..1f204df 100644 --- a/docs/HttpClassCallback.md +++ b/docs/HttpClassCallback.md @@ -1,8 +1,20 @@ # MockServer::HttpClassCallback ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**callback_class** | **String** | | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **delay** | [**Delay**](Delay.md) | | [optional] | +| **callback_class** | **String** | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::HttpClassCallback.new( + delay: null, + callback_class: null +) +``` diff --git a/docs/HttpError.md b/docs/HttpError.md index 9cc2d59..df3d2cd 100644 --- a/docs/HttpError.md +++ b/docs/HttpError.md @@ -1,10 +1,22 @@ # MockServer::HttpError ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**delay** | [**Delay**](Delay.md) | | [optional] -**drop_connection** | **BOOLEAN** | | [optional] -**response_bytes** | **String** | | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **delay** | [**Delay**](Delay.md) | | [optional] | +| **drop_connection** | **Boolean** | | [optional] | +| **response_bytes** | **String** | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::HttpError.new( + delay: null, + drop_connection: null, + response_bytes: null +) +``` diff --git a/docs/HttpForward.md b/docs/HttpForward.md index 505f914..7ad4034 100644 --- a/docs/HttpForward.md +++ b/docs/HttpForward.md @@ -1,11 +1,24 @@ # MockServer::HttpForward ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**host** | **String** | | [optional] -**port** | **Integer** | | [optional] -**scheme** | **String** | | [optional] -**delay** | [**Delay**](Delay.md) | | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **delay** | [**Delay**](Delay.md) | | [optional] | +| **host** | **String** | | [optional] | +| **port** | **Integer** | | [optional] | +| **scheme** | **String** | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::HttpForward.new( + delay: null, + host: null, + port: null, + scheme: null +) +``` diff --git a/docs/HttpObjectCallback.md b/docs/HttpObjectCallback.md index efa6113..25b3032 100644 --- a/docs/HttpObjectCallback.md +++ b/docs/HttpObjectCallback.md @@ -1,8 +1,22 @@ # MockServer::HttpObjectCallback ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**client_id** | **String** | | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **delay** | [**Delay**](Delay.md) | | [optional] | +| **client_id** | **String** | | [optional] | +| **response_callback** | **Boolean** | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::HttpObjectCallback.new( + delay: null, + client_id: null, + response_callback: null +) +``` diff --git a/docs/HttpOverrideForwardedRequest.md b/docs/HttpOverrideForwardedRequest.md index e7f6f75..f42d570 100644 --- a/docs/HttpOverrideForwardedRequest.md +++ b/docs/HttpOverrideForwardedRequest.md @@ -1,9 +1,49 @@ # MockServer::HttpOverrideForwardedRequest -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**http_request** | [**HttpRequest**](HttpRequest.md) | | [optional] -**delay** | [**Delay**](Delay.md) | | [optional] +## Class instance methods +### `openapi_one_of` + +Returns the list of classes defined in oneOf. + +#### Example + +```ruby +require 'mockserver-client' + +MockServer::HttpOverrideForwardedRequest.openapi_one_of +# => +# [ +# :'HttpOverrideForwardedRequestOneOf', +# :'HttpOverrideForwardedRequestOneOf1' +# ] +``` + +### build + +Find the appropriate object from the `openapi_one_of` list and casts the data into it. + +#### Example + +```ruby +require 'mockserver-client' + +MockServer::HttpOverrideForwardedRequest.build(data) +# => # + +MockServer::HttpOverrideForwardedRequest.build(data_that_doesnt_match) +# => nil +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| **data** | **Mixed** | data to be matched against the list of oneOf items | + +#### Return type + +- `HttpOverrideForwardedRequestOneOf` +- `HttpOverrideForwardedRequestOneOf1` +- `nil` (if no type matches) diff --git a/docs/HttpOverrideForwardedRequestOneOf.md b/docs/HttpOverrideForwardedRequestOneOf.md new file mode 100644 index 0000000..8b24f62 --- /dev/null +++ b/docs/HttpOverrideForwardedRequestOneOf.md @@ -0,0 +1,26 @@ +# MockServer::HttpOverrideForwardedRequestOneOf + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **delay** | [**Delay**](Delay.md) | | [optional] | +| **request_override** | [**HttpRequest**](HttpRequest.md) | | [optional] | +| **request_modifier** | [**HttpOverrideForwardedRequestOneOfRequestModifier**](HttpOverrideForwardedRequestOneOfRequestModifier.md) | | [optional] | +| **response_override** | [**HttpResponse**](HttpResponse.md) | | [optional] | +| **response_modifier** | [**HttpOverrideForwardedRequestOneOfResponseModifier**](HttpOverrideForwardedRequestOneOfResponseModifier.md) | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::HttpOverrideForwardedRequestOneOf.new( + delay: null, + request_override: null, + request_modifier: null, + response_override: null, + response_modifier: null +) +``` + diff --git a/docs/HttpOverrideForwardedRequestOneOf1.md b/docs/HttpOverrideForwardedRequestOneOf1.md new file mode 100644 index 0000000..947e52d --- /dev/null +++ b/docs/HttpOverrideForwardedRequestOneOf1.md @@ -0,0 +1,22 @@ +# MockServer::HttpOverrideForwardedRequestOneOf1 + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **delay** | [**Delay**](Delay.md) | | [optional] | +| **http_request** | [**HttpRequest**](HttpRequest.md) | | [optional] | +| **http_response** | [**HttpResponse**](HttpResponse.md) | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::HttpOverrideForwardedRequestOneOf1.new( + delay: null, + http_request: null, + http_response: null +) +``` + diff --git a/docs/HttpOverrideForwardedRequestOneOfRequestModifier.md b/docs/HttpOverrideForwardedRequestOneOfRequestModifier.md new file mode 100644 index 0000000..4834e11 --- /dev/null +++ b/docs/HttpOverrideForwardedRequestOneOfRequestModifier.md @@ -0,0 +1,24 @@ +# MockServer::HttpOverrideForwardedRequestOneOfRequestModifier + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **path** | [**HttpOverrideForwardedRequestOneOfRequestModifierPath**](HttpOverrideForwardedRequestOneOfRequestModifierPath.md) | | [optional] | +| **query_string_parameters** | [**HttpOverrideForwardedRequestOneOfRequestModifierQueryStringParameters**](HttpOverrideForwardedRequestOneOfRequestModifierQueryStringParameters.md) | | [optional] | +| **headers** | [**HttpOverrideForwardedRequestOneOfRequestModifierQueryStringParameters**](HttpOverrideForwardedRequestOneOfRequestModifierQueryStringParameters.md) | | [optional] | +| **cookies** | [**HttpOverrideForwardedRequestOneOfRequestModifierCookies**](HttpOverrideForwardedRequestOneOfRequestModifierCookies.md) | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::HttpOverrideForwardedRequestOneOfRequestModifier.new( + path: null, + query_string_parameters: null, + headers: null, + cookies: null +) +``` + diff --git a/docs/HttpOverrideForwardedRequestOneOfRequestModifierCookies.md b/docs/HttpOverrideForwardedRequestOneOfRequestModifierCookies.md new file mode 100644 index 0000000..0870654 --- /dev/null +++ b/docs/HttpOverrideForwardedRequestOneOfRequestModifierCookies.md @@ -0,0 +1,22 @@ +# MockServer::HttpOverrideForwardedRequestOneOfRequestModifierCookies + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **add** | [**KeyToValue**](KeyToValue.md) | | [optional] | +| **replace** | [**KeyToValue**](KeyToValue.md) | | [optional] | +| **remove** | **Array<String>** | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::HttpOverrideForwardedRequestOneOfRequestModifierCookies.new( + add: null, + replace: null, + remove: null +) +``` + diff --git a/docs/HttpOverrideForwardedRequestOneOfRequestModifierPath.md b/docs/HttpOverrideForwardedRequestOneOfRequestModifierPath.md new file mode 100644 index 0000000..a23f3b3 --- /dev/null +++ b/docs/HttpOverrideForwardedRequestOneOfRequestModifierPath.md @@ -0,0 +1,20 @@ +# MockServer::HttpOverrideForwardedRequestOneOfRequestModifierPath + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **regex** | **String** | | [optional] | +| **substitution** | **String** | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::HttpOverrideForwardedRequestOneOfRequestModifierPath.new( + regex: null, + substitution: null +) +``` + diff --git a/docs/HttpOverrideForwardedRequestOneOfRequestModifierQueryStringParameters.md b/docs/HttpOverrideForwardedRequestOneOfRequestModifierQueryStringParameters.md new file mode 100644 index 0000000..ce903db --- /dev/null +++ b/docs/HttpOverrideForwardedRequestOneOfRequestModifierQueryStringParameters.md @@ -0,0 +1,22 @@ +# MockServer::HttpOverrideForwardedRequestOneOfRequestModifierQueryStringParameters + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **add** | [**KeyToMultiValue**](KeyToMultiValue.md) | | [optional] | +| **replace** | [**KeyToMultiValue**](KeyToMultiValue.md) | | [optional] | +| **remove** | **Array<String>** | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::HttpOverrideForwardedRequestOneOfRequestModifierQueryStringParameters.new( + add: null, + replace: null, + remove: null +) +``` + diff --git a/docs/HttpOverrideForwardedRequestOneOfResponseModifier.md b/docs/HttpOverrideForwardedRequestOneOfResponseModifier.md new file mode 100644 index 0000000..5de6c84 --- /dev/null +++ b/docs/HttpOverrideForwardedRequestOneOfResponseModifier.md @@ -0,0 +1,20 @@ +# MockServer::HttpOverrideForwardedRequestOneOfResponseModifier + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **headers** | [**HttpOverrideForwardedRequestOneOfRequestModifierQueryStringParameters**](HttpOverrideForwardedRequestOneOfRequestModifierQueryStringParameters.md) | | [optional] | +| **cookies** | [**HttpOverrideForwardedRequestOneOfRequestModifierCookies**](HttpOverrideForwardedRequestOneOfRequestModifierCookies.md) | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::HttpOverrideForwardedRequestOneOfResponseModifier.new( + headers: null, + cookies: null +) +``` + diff --git a/docs/HttpRequest.md b/docs/HttpRequest.md index 63a65f0..f55d078 100644 --- a/docs/HttpRequest.md +++ b/docs/HttpRequest.md @@ -1,15 +1,36 @@ # MockServer::HttpRequest ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**body** | [**Body**](Body.md) | | [optional] -**headers** | [**KeyToMultiValue**](KeyToMultiValue.md) | | [optional] -**cookies** | [**KeyToValue**](KeyToValue.md) | | [optional] -**query_string_parameters** | [**KeyToMultiValue**](KeyToMultiValue.md) | | [optional] -**path** | **String** | | [optional] -**method** | **String** | | [optional] -**secure** | **BOOLEAN** | | [optional] -**keep_alive** | **BOOLEAN** | | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **secure** | **Boolean** | | [optional] | +| **keep_alive** | **Boolean** | | [optional] | +| **method** | [**StringOrJsonSchema**](StringOrJsonSchema.md) | | [optional] | +| **path** | [**StringOrJsonSchema**](StringOrJsonSchema.md) | | [optional] | +| **path_parameters** | [**KeyToMultiValue**](KeyToMultiValue.md) | | [optional] | +| **query_string_parameters** | [**KeyToMultiValue**](KeyToMultiValue.md) | | [optional] | +| **body** | [**Body**](Body.md) | | [optional] | +| **headers** | [**KeyToMultiValue**](KeyToMultiValue.md) | | [optional] | +| **cookies** | [**KeyToValue**](KeyToValue.md) | | [optional] | +| **socket_address** | [**SocketAddress**](SocketAddress.md) | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::HttpRequest.new( + secure: null, + keep_alive: null, + method: null, + path: null, + path_parameters: null, + query_string_parameters: null, + body: null, + headers: null, + cookies: null, + socket_address: null +) +``` diff --git a/docs/HttpResponse.md b/docs/HttpResponse.md index 05ce28d..09d1936 100644 --- a/docs/HttpResponse.md +++ b/docs/HttpResponse.md @@ -1,14 +1,30 @@ # MockServer::HttpResponse ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**body** | [**BodyWithContentType**](BodyWithContentType.md) | | [optional] -**delay** | [**Delay**](Delay.md) | | [optional] -**cookies** | [**KeyToValue**](KeyToValue.md) | | [optional] -**connection_options** | [**ConnectionOptions**](ConnectionOptions.md) | | [optional] -**headers** | [**KeyToMultiValue**](KeyToMultiValue.md) | | [optional] -**status_code** | **Integer** | | [optional] -**reason_phrase** | **String** | | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **delay** | [**Delay**](Delay.md) | | [optional] | +| **body** | [**BodyWithContentType**](BodyWithContentType.md) | | [optional] | +| **cookies** | [**KeyToValue**](KeyToValue.md) | | [optional] | +| **connection_options** | [**ConnectionOptions**](ConnectionOptions.md) | | [optional] | +| **headers** | [**KeyToMultiValue**](KeyToMultiValue.md) | | [optional] | +| **status_code** | **Integer** | | [optional] | +| **reason_phrase** | **String** | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::HttpResponse.new( + delay: null, + body: null, + cookies: null, + connection_options: null, + headers: null, + status_code: null, + reason_phrase: null +) +``` diff --git a/docs/HttpTemplate.md b/docs/HttpTemplate.md index 0718698..f15adb4 100644 --- a/docs/HttpTemplate.md +++ b/docs/HttpTemplate.md @@ -1,10 +1,22 @@ # MockServer::HttpTemplate ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**template_type** | **String** | | [optional] -**template** | **String** | | [optional] -**delay** | [**Delay**](Delay.md) | | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **delay** | [**Delay**](Delay.md) | | [optional] | +| **template_type** | **String** | | [optional] | +| **template** | **String** | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::HttpTemplate.new( + delay: null, + template_type: null, + template: null +) +``` diff --git a/docs/KeyToMultiValue.md b/docs/KeyToMultiValue.md index a4979a7..695505a 100644 --- a/docs/KeyToMultiValue.md +++ b/docs/KeyToMultiValue.md @@ -1,7 +1,49 @@ # MockServer::KeyToMultiValue -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +## Class instance methods +### `openapi_one_of` + +Returns the list of classes defined in oneOf. + +#### Example + +```ruby +require 'mockserver-client' + +MockServer::KeyToMultiValue.openapi_one_of +# => +# [ +# :'Array', +# :'KeyToMultiValueOneOf' +# ] +``` + +### build + +Find the appropriate object from the `openapi_one_of` list and casts the data into it. + +#### Example + +```ruby +require 'mockserver-client' + +MockServer::KeyToMultiValue.build(data) +# => #:0x00007fdd4aab02a0> + +MockServer::KeyToMultiValue.build(data_that_doesnt_match) +# => nil +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| **data** | **Mixed** | data to be matched against the list of oneOf items | + +#### Return type + +- `Array` +- `KeyToMultiValueOneOf` +- `nil` (if no type matches) diff --git a/docs/KeyToMultiValueOneOf.md b/docs/KeyToMultiValueOneOf.md new file mode 100644 index 0000000..73adb3d --- /dev/null +++ b/docs/KeyToMultiValueOneOf.md @@ -0,0 +1,18 @@ +# MockServer::KeyToMultiValueOneOf + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **key_match_style** | **String** | | [optional][default to 'SUB_SET'] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::KeyToMultiValueOneOf.new( + key_match_style: null +) +``` + diff --git a/docs/KeyToValue.md b/docs/KeyToValue.md index 66dcc71..d8273ec 100644 --- a/docs/KeyToValue.md +++ b/docs/KeyToValue.md @@ -1,7 +1,49 @@ # MockServer::KeyToValue -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +## Class instance methods +### `openapi_one_of` + +Returns the list of classes defined in oneOf. + +#### Example + +```ruby +require 'mockserver-client' + +MockServer::KeyToValue.openapi_one_of +# => +# [ +# :'Array', +# :'Hash' +# ] +``` + +### build + +Find the appropriate object from the `openapi_one_of` list and casts the data into it. + +#### Example + +```ruby +require 'mockserver-client' + +MockServer::KeyToValue.build(data) +# => #:0x00007fdd4aab02a0> + +MockServer::KeyToValue.build(data_that_doesnt_match) +# => nil +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| **data** | **Mixed** | data to be matched against the list of oneOf items | + +#### Return type + +- `Array` +- `Hash` +- `nil` (if no type matches) diff --git a/docs/OpenAPIDefinition.md b/docs/OpenAPIDefinition.md new file mode 100644 index 0000000..4b8c453 --- /dev/null +++ b/docs/OpenAPIDefinition.md @@ -0,0 +1,20 @@ +# MockServer::OpenAPIDefinition + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **spec_url_or_payload** | **String** | | [optional] | +| **operation_id** | **String** | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::OpenAPIDefinition.new( + spec_url_or_payload: null, + operation_id: null +) +``` + diff --git a/docs/OpenAPIExpectation.md b/docs/OpenAPIExpectation.md new file mode 100644 index 0000000..1d1868d --- /dev/null +++ b/docs/OpenAPIExpectation.md @@ -0,0 +1,20 @@ +# MockServer::OpenAPIExpectation + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **spec_url_or_payload** | [**AnyOfstringobject**](AnyOfstringobject.md) | | | +| **operations_and_responses** | **Hash<String, String>** | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::OpenAPIExpectation.new( + spec_url_or_payload: null, + operations_and_responses: null +) +``` + diff --git a/docs/OpenAPIExpectations.md b/docs/OpenAPIExpectations.md new file mode 100644 index 0000000..0a6e8ea --- /dev/null +++ b/docs/OpenAPIExpectations.md @@ -0,0 +1,49 @@ +# MockServer::OpenAPIExpectations + +## Class instance methods + +### `openapi_one_of` + +Returns the list of classes defined in oneOf. + +#### Example + +```ruby +require 'mockserver-client' + +MockServer::OpenAPIExpectations.openapi_one_of +# => +# [ +# :'Array', +# :'OpenAPIExpectation' +# ] +``` + +### build + +Find the appropriate object from the `openapi_one_of` list and casts the data into it. + +#### Example + +```ruby +require 'mockserver-client' + +MockServer::OpenAPIExpectations.build(data) +# => #:0x00007fdd4aab02a0> + +MockServer::OpenAPIExpectations.build(data_that_doesnt_match) +# => nil +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| **data** | **Mixed** | data to be matched against the list of oneOf items | + +#### Return type + +- `Array` +- `OpenAPIExpectation` +- `nil` (if no type matches) + diff --git a/docs/Ports.md b/docs/Ports.md index 4343fc3..d80ed45 100644 --- a/docs/Ports.md +++ b/docs/Ports.md @@ -1,8 +1,18 @@ # MockServer::Ports ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ports** | **Array<Float>** | | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **ports** | **Array<Float>** | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::Ports.new( + ports: null +) +``` diff --git a/docs/PositiveIntegerDefault0.md b/docs/PositiveIntegerDefault0.md new file mode 100644 index 0000000..0264742 --- /dev/null +++ b/docs/PositiveIntegerDefault0.md @@ -0,0 +1,15 @@ +# MockServer::PositiveIntegerDefault0 + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::PositiveIntegerDefault0.new() +``` + diff --git a/docs/RequestDefinition.md b/docs/RequestDefinition.md new file mode 100644 index 0000000..aa161ae --- /dev/null +++ b/docs/RequestDefinition.md @@ -0,0 +1,49 @@ +# MockServer::RequestDefinition + +## Class instance methods + +### `openapi_one_of` + +Returns the list of classes defined in oneOf. + +#### Example + +```ruby +require 'mockserver-client' + +MockServer::RequestDefinition.openapi_one_of +# => +# [ +# :'HttpRequest', +# :'OpenAPIDefinition' +# ] +``` + +### build + +Find the appropriate object from the `openapi_one_of` list and casts the data into it. + +#### Example + +```ruby +require 'mockserver-client' + +MockServer::RequestDefinition.build(data) +# => # + +MockServer::RequestDefinition.build(data_that_doesnt_match) +# => nil +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| **data** | **Mixed** | data to be matched against the list of oneOf items | + +#### Return type + +- `HttpRequest` +- `OpenAPIDefinition` +- `nil` (if no type matches) + diff --git a/docs/Schema.md b/docs/Schema.md new file mode 100644 index 0000000..1e442d9 --- /dev/null +++ b/docs/Schema.md @@ -0,0 +1,82 @@ +# MockServer::Schema + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | | [optional] | +| **schema** | **String** | | [optional] | +| **title** | **String** | | [optional] | +| **description** | **String** | | [optional] | +| **default** | **Object** | | [optional] | +| **multiple_of** | **Float** | | [optional] | +| **maximum** | **Float** | | [optional] | +| **exclusive_maximum** | **Boolean** | | [optional][default to false] | +| **minimum** | **Float** | | [optional] | +| **exclusive_minimum** | **Boolean** | | [optional][default to false] | +| **max_length** | **Integer** | | [optional] | +| **min_length** | [**PositiveIntegerDefault0**](PositiveIntegerDefault0.md) | | [optional] | +| **pattern** | **String** | | [optional] | +| **additional_items** | [**AnyOfboolean**](AnyOfboolean.md) | | [optional] | +| **items** | [**AnyOfschemaArray**](AnyOfschemaArray.md) | | [optional] | +| **max_items** | **Integer** | | [optional] | +| **min_items** | [**PositiveIntegerDefault0**](PositiveIntegerDefault0.md) | | [optional] | +| **unique_items** | **Boolean** | | [optional][default to false] | +| **max_properties** | **Integer** | | [optional] | +| **min_properties** | [**PositiveIntegerDefault0**](PositiveIntegerDefault0.md) | | [optional] | +| **required** | [**StringArray**](StringArray.md) | | [optional] | +| **additional_properties** | [**AnyOfboolean**](AnyOfboolean.md) | | [optional] | +| **definitions** | [**Hash<String, >**](.md) | | [optional] | +| **properties** | [**Hash<String, >**](.md) | | [optional] | +| **pattern_properties** | [**Hash<String, >**](.md) | | [optional] | +| **dependencies** | [**Hash<String, AnyOfstringArray>**](AnyOfstringArray.md) | | [optional] | +| **enum** | **Array<NULL_SCHEMA_ERR>** | | [optional] | +| **type** | [**AnyOfsimpleTypesset**](AnyOfsimpleTypesset.md) | | [optional] | +| **format** | **String** | | [optional] | +| **all_of** | [**SchemaArray**](SchemaArray.md) | | [optional] | +| **any_of** | [**SchemaArray**](SchemaArray.md) | | [optional] | +| **one_of** | [**SchemaArray**](SchemaArray.md) | | [optional] | +| **_not** | [****](.md) | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::Schema.new( + id: null, + schema: null, + title: null, + description: null, + default: null, + multiple_of: null, + maximum: null, + exclusive_maximum: null, + minimum: null, + exclusive_minimum: null, + max_length: null, + min_length: null, + pattern: null, + additional_items: null, + items: null, + max_items: null, + min_items: null, + unique_items: null, + max_properties: null, + min_properties: null, + required: null, + additional_properties: null, + definitions: null, + properties: null, + pattern_properties: null, + dependencies: null, + enum: null, + type: null, + format: null, + all_of: null, + any_of: null, + one_of: null, + _not: null +) +``` + diff --git a/docs/SocketAddress.md b/docs/SocketAddress.md new file mode 100644 index 0000000..005929a --- /dev/null +++ b/docs/SocketAddress.md @@ -0,0 +1,22 @@ +# MockServer::SocketAddress + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **host** | **String** | | [optional] | +| **port** | **Integer** | | [optional] | +| **scheme** | **String** | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::SocketAddress.new( + host: null, + port: null, + scheme: null +) +``` + diff --git a/docs/StringOrJsonSchema.md b/docs/StringOrJsonSchema.md new file mode 100644 index 0000000..f39d18f --- /dev/null +++ b/docs/StringOrJsonSchema.md @@ -0,0 +1,49 @@ +# MockServer::StringOrJsonSchema + +## Class instance methods + +### `openapi_one_of` + +Returns the list of classes defined in oneOf. + +#### Example + +```ruby +require 'mockserver-client' + +MockServer::StringOrJsonSchema.openapi_one_of +# => +# [ +# :'String', +# :'StringOrJsonSchemaOneOf' +# ] +``` + +### build + +Find the appropriate object from the `openapi_one_of` list and casts the data into it. + +#### Example + +```ruby +require 'mockserver-client' + +MockServer::StringOrJsonSchema.build(data) +# => # + +MockServer::StringOrJsonSchema.build(data_that_doesnt_match) +# => nil +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| **data** | **Mixed** | data to be matched against the list of oneOf items | + +#### Return type + +- `String` +- `StringOrJsonSchemaOneOf` +- `nil` (if no type matches) + diff --git a/docs/StringOrJsonSchemaOneOf.md b/docs/StringOrJsonSchemaOneOf.md new file mode 100644 index 0000000..722a2b5 --- /dev/null +++ b/docs/StringOrJsonSchemaOneOf.md @@ -0,0 +1,26 @@ +# MockServer::StringOrJsonSchemaOneOf + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_not** | **Boolean** | | [optional] | +| **optional** | **Boolean** | | [optional] | +| **value** | **String** | | [optional] | +| **schema** | **Object** | | [optional] | +| **parameter_style** | **String** | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::StringOrJsonSchemaOneOf.new( + _not: null, + optional: null, + value: null, + schema: null, + parameter_style: null +) +``` + diff --git a/docs/TimeToLive.md b/docs/TimeToLive.md index 8fde184..f46cfd4 100644 --- a/docs/TimeToLive.md +++ b/docs/TimeToLive.md @@ -1,10 +1,22 @@ # MockServer::TimeToLive ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**time_unit** | **String** | | [optional] -**time_to_live** | **Integer** | | [optional] -**unlimited** | **BOOLEAN** | | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **time_unit** | **String** | | [optional] | +| **time_to_live** | **Integer** | | [optional] | +| **unlimited** | **Boolean** | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::TimeToLive.new( + time_unit: null, + time_to_live: null, + unlimited: null +) +``` diff --git a/docs/Times.md b/docs/Times.md index b43c27c..6a5d4ef 100644 --- a/docs/Times.md +++ b/docs/Times.md @@ -1,9 +1,20 @@ # MockServer::Times ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**remaining_times** | **Integer** | | [optional] -**unlimited** | **BOOLEAN** | | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **remaining_times** | **Integer** | | [optional] | +| **unlimited** | **Boolean** | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::Times.new( + remaining_times: null, + unlimited: null +) +``` diff --git a/docs/Verification.md b/docs/Verification.md index 2206ece..91dc33d 100644 --- a/docs/Verification.md +++ b/docs/Verification.md @@ -1,9 +1,47 @@ # MockServer::Verification -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**http_request** | [**HttpRequest**](HttpRequest.md) | | [optional] -**times** | [**VerificationTimes**](VerificationTimes.md) | | [optional] +## Class instance methods +### `openapi_one_of` + +Returns the list of classes defined in oneOf. + +#### Example + +```ruby +require 'mockserver-client' + +MockServer::Verification.openapi_one_of +# => +# [ +# :'Object' +# ] +``` + +### build + +Find the appropriate object from the `openapi_one_of` list and casts the data into it. + +#### Example + +```ruby +require 'mockserver-client' + +MockServer::Verification.build(data) +# => # + +MockServer::Verification.build(data_that_doesnt_match) +# => nil +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| **data** | **Mixed** | data to be matched against the list of oneOf items | + +#### Return type + +- `Object` +- `nil` (if no type matches) diff --git a/docs/VerificationSequence.md b/docs/VerificationSequence.md index 86e0838..e287e1e 100644 --- a/docs/VerificationSequence.md +++ b/docs/VerificationSequence.md @@ -1,8 +1,47 @@ # MockServer::VerificationSequence -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**http_requests** | [**Array<HttpRequest>**](HttpRequest.md) | | [optional] +## Class instance methods +### `openapi_one_of` + +Returns the list of classes defined in oneOf. + +#### Example + +```ruby +require 'mockserver-client' + +MockServer::VerificationSequence.openapi_one_of +# => +# [ +# :'Object' +# ] +``` + +### build + +Find the appropriate object from the `openapi_one_of` list and casts the data into it. + +#### Example + +```ruby +require 'mockserver-client' + +MockServer::VerificationSequence.build(data) +# => # + +MockServer::VerificationSequence.build(data_that_doesnt_match) +# => nil +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| **data** | **Mixed** | data to be matched against the list of oneOf items | + +#### Return type + +- `Object` +- `nil` (if no type matches) diff --git a/docs/VerificationTimes.md b/docs/VerificationTimes.md index 919b030..494cdf8 100644 --- a/docs/VerificationTimes.md +++ b/docs/VerificationTimes.md @@ -1,9 +1,20 @@ # MockServer::VerificationTimes ## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**count** | **Integer** | | [optional] -**exact** | **BOOLEAN** | | [optional] +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **at_least** | **Integer** | | [optional] | +| **at_most** | **Integer** | | [optional] | + +## Example + +```ruby +require 'mockserver-client' + +instance = MockServer::VerificationTimes.new( + at_least: null, + at_most: null +) +``` diff --git a/docs/VerifyApi.md b/docs/VerifyApi.md index 4ccc113..0e5a167 100644 --- a/docs/VerifyApi.md +++ b/docs/VerifyApi.md @@ -2,38 +2,58 @@ All URIs are relative to *http://localhost:1080* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**verify_put**](VerifyApi.md#verify_put) | **PUT** /verify | verify a request has been received a specific number of times -[**verify_sequence_put**](VerifyApi.md#verify_sequence_put) | **PUT** /verifySequence | verify a sequence of request has been received in the specific order +| Method | HTTP request | Description | +| ------ | ------------ | ----------- | +| [**mockserver_verify_put**](VerifyApi.md#mockserver_verify_put) | **PUT** /mockserver/verify | verify a request has been received a specific number of times | +| [**mockserver_verify_sequence_put**](VerifyApi.md#mockserver_verify_sequence_put) | **PUT** /mockserver/verifySequence | verify a sequence of request has been received in the specific order | -# **verify_put** -> verify_put(verification) +## mockserver_verify_put + +> mockserver_verify_put(verification) verify a request has been received a specific number of times -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'mockserver-client' api_instance = MockServer::VerifyApi.new -verification = MockServer::Verification.new # Verification | request matcher and the number of times to match +verification = nil # Verification | request matcher and the number of times to match + +begin + # verify a request has been received a specific number of times + api_instance.mockserver_verify_put(verification) +rescue MockServer::ApiError => e + puts "Error when calling VerifyApi->mockserver_verify_put: #{e}" +end +``` + +#### Using the mockserver_verify_put_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. +> mockserver_verify_put_with_http_info(verification) + +```ruby begin - #verify a request has been received a specific number of times - api_instance.verify_put(verification) + # verify a request has been received a specific number of times + data, status_code, headers = api_instance.mockserver_verify_put_with_http_info(verification) + p status_code # => 2xx + p headers # => { ... } + p data # => nil rescue MockServer::ApiError => e - puts "Exception when calling VerifyApi->verify_put: #{e}" + puts "Error when calling VerifyApi->mockserver_verify_put_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **verification** | [**Verification**](Verification.md)| request matcher and the number of times to match | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **verification** | [**Verification**](Verification.md) | request matcher and the number of times to match | | ### Return type @@ -45,37 +65,56 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: text/plain +- **Content-Type**: application/json +- **Accept**: text/plain +## mockserver_verify_sequence_put -# **verify_sequence_put** -> verify_sequence_put(verification_sequence) +> mockserver_verify_sequence_put(verification_sequence) verify a sequence of request has been received in the specific order -### Example +### Examples + ```ruby -# load the gem +require 'time' require 'mockserver-client' api_instance = MockServer::VerifyApi.new -verification_sequence = MockServer::VerificationSequence.new # VerificationSequence | the sequence of requests matchers +verification_sequence = nil # VerificationSequence | the sequence of requests matchers begin - #verify a sequence of request has been received in the specific order - api_instance.verify_sequence_put(verification_sequence) + # verify a sequence of request has been received in the specific order + api_instance.mockserver_verify_sequence_put(verification_sequence) rescue MockServer::ApiError => e - puts "Exception when calling VerifyApi->verify_sequence_put: #{e}" + puts "Error when calling VerifyApi->mockserver_verify_sequence_put: #{e}" +end +``` + +#### Using the mockserver_verify_sequence_put_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> mockserver_verify_sequence_put_with_http_info(verification_sequence) + +```ruby +begin + # verify a sequence of request has been received in the specific order + data, status_code, headers = api_instance.mockserver_verify_sequence_put_with_http_info(verification_sequence) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue MockServer::ApiError => e + puts "Error when calling VerifyApi->mockserver_verify_sequence_put_with_http_info: #{e}" end ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **verification_sequence** | [**VerificationSequence**](VerificationSequence.md)| the sequence of requests matchers | +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **verification_sequence** | [**VerificationSequence**](VerificationSequence.md) | the sequence of requests matchers | | ### Return type @@ -87,8 +126,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: text/plain - - +- **Content-Type**: application/json +- **Accept**: text/plain diff --git a/git_push.sh b/git_push.sh new file mode 100644 index 0000000..f53a75d --- /dev/null +++ b/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/lib/mockserver-client.rb b/lib/mockserver-client.rb index 7726655..866b452 100644 --- a/lib/mockserver-client.rb +++ b/lib/mockserver-client.rb @@ -1,12 +1,12 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -18,22 +18,54 @@ # Models require 'mockserver-client/models/body' +require 'mockserver-client/models/body_any_of' +require 'mockserver-client/models/body_any_of1' +require 'mockserver-client/models/body_any_of2' +require 'mockserver-client/models/body_any_of3' +require 'mockserver-client/models/body_any_of4' +require 'mockserver-client/models/body_any_of5' +require 'mockserver-client/models/body_any_of6' +require 'mockserver-client/models/body_any_of7' +require 'mockserver-client/models/body_any_of8' +require 'mockserver-client/models/body_any_of9' require 'mockserver-client/models/body_with_content_type' +require 'mockserver-client/models/body_with_content_type_any_of' +require 'mockserver-client/models/body_with_content_type_any_of1' +require 'mockserver-client/models/body_with_content_type_any_of2' +require 'mockserver-client/models/body_with_content_type_any_of3' require 'mockserver-client/models/connection_options' require 'mockserver-client/models/delay' require 'mockserver-client/models/expectation' +require 'mockserver-client/models/expectation_id' require 'mockserver-client/models/expectations' require 'mockserver-client/models/http_class_callback' require 'mockserver-client/models/http_error' require 'mockserver-client/models/http_forward' require 'mockserver-client/models/http_object_callback' require 'mockserver-client/models/http_override_forwarded_request' +require 'mockserver-client/models/http_override_forwarded_request_one_of' +require 'mockserver-client/models/http_override_forwarded_request_one_of1' +require 'mockserver-client/models/http_override_forwarded_request_one_of_request_modifier' +require 'mockserver-client/models/http_override_forwarded_request_one_of_request_modifier_cookies' +require 'mockserver-client/models/http_override_forwarded_request_one_of_request_modifier_path' +require 'mockserver-client/models/http_override_forwarded_request_one_of_request_modifier_query_string_parameters' +require 'mockserver-client/models/http_override_forwarded_request_one_of_response_modifier' require 'mockserver-client/models/http_request' require 'mockserver-client/models/http_response' require 'mockserver-client/models/http_template' require 'mockserver-client/models/key_to_multi_value' +require 'mockserver-client/models/key_to_multi_value_one_of' require 'mockserver-client/models/key_to_value' +require 'mockserver-client/models/open_api_definition' +require 'mockserver-client/models/open_api_expectation' +require 'mockserver-client/models/open_api_expectations' require 'mockserver-client/models/ports' +require 'mockserver-client/models/positive_integer_default0' +require 'mockserver-client/models/request_definition' +require 'mockserver-client/models/schema' +require 'mockserver-client/models/socket_address' +require 'mockserver-client/models/string_or_json_schema' +require 'mockserver-client/models/string_or_json_schema_one_of' require 'mockserver-client/models/time_to_live' require 'mockserver-client/models/times' require 'mockserver-client/models/verification' diff --git a/lib/mockserver-client/api/control_api.rb b/lib/mockserver-client/api/control_api.rb index 57282c1..c006001 100644 --- a/lib/mockserver-client/api/control_api.rb +++ b/lib/mockserver-client/api/control_api.rb @@ -1,16 +1,16 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end -require 'uri' +require 'cgi' module MockServer class ControlApi @@ -21,101 +21,128 @@ def initialize(api_client = ApiClient.default) end # bind additional listening ports # only supported on Netty version - # @param ports list of ports to bind to, where 0 indicates dynamically bind to any available port + # @param ports [Ports] list of ports to bind to, where 0 indicates dynamically bind to any available port # @param [Hash] opts the optional parameters # @return [Ports] - def bind_put(ports, opts = {}) - data, _status_code, _headers = bind_put_with_http_info(ports, opts) + def mockserver_bind_put(ports, opts = {}) + data, _status_code, _headers = mockserver_bind_put_with_http_info(ports, opts) data end # bind additional listening ports # only supported on Netty version - # @param ports list of ports to bind to, where 0 indicates dynamically bind to any available port + # @param ports [Ports] list of ports to bind to, where 0 indicates dynamically bind to any available port # @param [Hash] opts the optional parameters - # @return [Array<(Ports, Fixnum, Hash)>] Ports data, response status code and response headers - def bind_put_with_http_info(ports, opts = {}) + # @return [Array<(Ports, Integer, Hash)>] Ports data, response status code and response headers + def mockserver_bind_put_with_http_info(ports, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ControlApi.bind_put ...' + @api_client.config.logger.debug 'Calling API: ControlApi.mockserver_bind_put ...' end # verify the required parameter 'ports' is set if @api_client.config.client_side_validation && ports.nil? - fail ArgumentError, "Missing the required parameter 'ports' when calling ControlApi.bind_put" + fail ArgumentError, "Missing the required parameter 'ports' when calling ControlApi.mockserver_bind_put" end # resource path - local_var_path = 'mockserver/bind' + local_var_path = '/mockserver/bind' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(ports) - auth_names = [] - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(ports) + + # return_type + return_type = opts[:debug_return_type] || 'Ports' + + # auth_names + auth_names = opts[:debug_auth_names] || [] + + new_options = opts.merge( + :operation => :"ControlApi.mockserver_bind_put", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'Ports') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: ControlApi#bind_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: ControlApi#mockserver_bind_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # clears expectations and recorded requests that match the request matcher # @param [Hash] opts the optional parameters - # @option opts [HttpRequest] :http_request request used to match expectations and recored requests to clear + # @option opts [UNKNOWN_BASE_TYPE] :unknown_base_type request used to match expectations and recored requests to clear # @return [nil] - def clear_put(opts = {}) - clear_put_with_http_info(opts) + def mockserver_clear_put(opts = {}) + mockserver_clear_put_with_http_info(opts) nil end # clears expectations and recorded requests that match the request matcher # @param [Hash] opts the optional parameters - # @option opts [HttpRequest] :http_request request used to match expectations and recored requests to clear - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers - def clear_put_with_http_info(opts = {}) + # @option opts [UNKNOWN_BASE_TYPE] :unknown_base_type request used to match expectations and recored requests to clear + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def mockserver_clear_put_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ControlApi.clear_put ...' + @api_client.config.logger.debug 'Calling API: ControlApi.mockserver_clear_put ...' end # resource path - local_var_path = 'mockserver/clear' + local_var_path = '/mockserver/clear' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(opts[:'http_request']) - auth_names = [] - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'unknown_base_type']) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [] + + new_options = opts.merge( + :operation => :"ControlApi.mockserver_clear_put", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: ControlApi#clear_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: ControlApi#mockserver_clear_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end @@ -123,102 +150,128 @@ def clear_put_with_http_info(opts = {}) # clears all expectations and recorded requests # @param [Hash] opts the optional parameters # @return [nil] - def reset_put(opts = {}) - reset_put_with_http_info(opts) + def mockserver_reset_put(opts = {}) + mockserver_reset_put_with_http_info(opts) nil end # clears all expectations and recorded requests # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers - def reset_put_with_http_info(opts = {}) + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def mockserver_reset_put_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ControlApi.reset_put ...' + @api_client.config.logger.debug 'Calling API: ControlApi.mockserver_reset_put ...' end # resource path - local_var_path = 'mockserver/reset' + local_var_path = '/mockserver/reset' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = [] - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [] + + new_options = opts.merge( + :operation => :"ControlApi.mockserver_reset_put", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: ControlApi#reset_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: ControlApi#mockserver_reset_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # retrieve recorded requests, active expectations, recorded expectations or log messages # @param [Hash] opts the optional parameters - # @option opts [String] :format changes response format, default if not specificed is \"json\", supported values are \"java\", \"json\" + # @option opts [String] :format changes response format, default if not specificed is \"json\", supported values are \"java\", \"json\", \"log_entries\" # @option opts [String] :type specifies the type of object that is retrieve, default if not specified is \"requests\", supported values are \"logs\", \"requests\", \"recorded_expectations\", \"active_expectations\" - # @option opts [HttpRequest] :http_request request used to match which recorded requests, expectations or log messages to return, an empty body matches all requests, expectations or log messages - # @return [Object] - def retrieve_put(opts = {}) - data, _status_code, _headers = retrieve_put_with_http_info(opts) + # @option opts [RequestDefinition] :request_definition request used to match which recorded requests, expectations or log messages to return, an empty body matches all requests, expectations or log messages + # @return [OneOfarrayarray] + def mockserver_retrieve_put(opts = {}) + data, _status_code, _headers = mockserver_retrieve_put_with_http_info(opts) data end # retrieve recorded requests, active expectations, recorded expectations or log messages # @param [Hash] opts the optional parameters - # @option opts [String] :format changes response format, default if not specificed is \"json\", supported values are \"java\", \"json\" + # @option opts [String] :format changes response format, default if not specificed is \"json\", supported values are \"java\", \"json\", \"log_entries\" # @option opts [String] :type specifies the type of object that is retrieve, default if not specified is \"requests\", supported values are \"logs\", \"requests\", \"recorded_expectations\", \"active_expectations\" - # @option opts [HttpRequest] :http_request request used to match which recorded requests, expectations or log messages to return, an empty body matches all requests, expectations or log messages - # @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers - def retrieve_put_with_http_info(opts = {}) + # @option opts [RequestDefinition] :request_definition request used to match which recorded requests, expectations or log messages to return, an empty body matches all requests, expectations or log messages + # @return [Array<(OneOfarrayarray, Integer, Hash)>] OneOfarrayarray data, response status code and response headers + def mockserver_retrieve_put_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ControlApi.retrieve_put ...' + @api_client.config.logger.debug 'Calling API: ControlApi.mockserver_retrieve_put ...' end - if @api_client.config.client_side_validation && opts[:'format'] && !['java', 'json'].include?(opts[:'format']) - fail ArgumentError, 'invalid value for "format", must be one of java, json' + allowable_values = ["java", "json", "log_entries"] + if @api_client.config.client_side_validation && opts[:'format'] && !allowable_values.include?(opts[:'format']) + fail ArgumentError, "invalid value for \"format\", must be one of #{allowable_values}" end - if @api_client.config.client_side_validation && opts[:'type'] && !['logs', 'requests', 'recorded_expectations', 'active_expectations'].include?(opts[:'type']) - fail ArgumentError, 'invalid value for "type", must be one of logs, requests, recorded_expectations, active_expectations' + allowable_values = ["logs", "requests", "request_responses", "recorded_expectations", "active_expectations"] + if @api_client.config.client_side_validation && opts[:'type'] && !allowable_values.include?(opts[:'type']) + fail ArgumentError, "invalid value for \"type\", must be one of #{allowable_values}" end # resource path - local_var_path = 'mockserver/retrieve' + local_var_path = '/mockserver/retrieve' # query parameters - query_params = {} + query_params = opts[:query_params] || {} query_params[:'format'] = opts[:'format'] if !opts[:'format'].nil? query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil? # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/java', 'text/plain']) # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(opts[:'http_request']) - auth_names = [] - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'request_definition']) + + # return_type + return_type = opts[:debug_return_type] || 'OneOfarrayarray' + + # auth_names + auth_names = opts[:debug_auth_names] || [] + + new_options = opts.merge( + :operation => :"ControlApi.mockserver_retrieve_put", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'Object') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: ControlApi#retrieve_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: ControlApi#mockserver_retrieve_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end @@ -226,44 +279,54 @@ def retrieve_put_with_http_info(opts = {}) # return listening ports # @param [Hash] opts the optional parameters # @return [Ports] - def status_put(opts = {}) - data, _status_code, _headers = status_put_with_http_info(opts) + def mockserver_status_put(opts = {}) + data, _status_code, _headers = mockserver_status_put_with_http_info(opts) data end # return listening ports # @param [Hash] opts the optional parameters - # @return [Array<(Ports, Fixnum, Hash)>] Ports data, response status code and response headers - def status_put_with_http_info(opts = {}) + # @return [Array<(Ports, Integer, Hash)>] Ports data, response status code and response headers + def mockserver_status_put_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ControlApi.status_put ...' + @api_client.config.logger.debug 'Calling API: ControlApi.mockserver_status_put ...' end # resource path - local_var_path = 'mockserver/status' + local_var_path = '/mockserver/status' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = [] - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Ports' + + # auth_names + auth_names = opts[:debug_auth_names] || [] + + new_options = opts.merge( + :operation => :"ControlApi.mockserver_status_put", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => 'Ports') + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: ControlApi#status_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: ControlApi#mockserver_status_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end @@ -272,45 +335,55 @@ def status_put_with_http_info(opts = {}) # only supported on Netty version # @param [Hash] opts the optional parameters # @return [nil] - def stop_put(opts = {}) - stop_put_with_http_info(opts) + def mockserver_stop_put(opts = {}) + mockserver_stop_put_with_http_info(opts) nil end # stop running process # only supported on Netty version # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers - def stop_put_with_http_info(opts = {}) + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def mockserver_stop_put_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ControlApi.stop_put ...' + @api_client.config.logger.debug 'Calling API: ControlApi.mockserver_stop_put ...' end # resource path - local_var_path = 'mockserver/stop' + local_var_path = '/mockserver/stop' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = nil - auth_names = [] - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [] + + new_options = opts.merge( + :operation => :"ControlApi.mockserver_stop_put", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: ControlApi#stop_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: ControlApi#mockserver_stop_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - end end diff --git a/lib/mockserver-client/api/expectation_api.rb b/lib/mockserver-client/api/expectation_api.rb index 41da933..e005d4a 100644 --- a/lib/mockserver-client/api/expectation_api.rb +++ b/lib/mockserver-client/api/expectation_api.rb @@ -1,16 +1,16 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end -require 'uri' +require 'cgi' module MockServer class ExpectationApi @@ -20,54 +20,131 @@ def initialize(api_client = ApiClient.default) @api_client = api_client end # create expectation - # @param expectations expectation to create + # @param expectations [Expectations] expectation(s) to create # @param [Hash] opts the optional parameters - # @return [nil] - def expectation_put(expectations, opts = {}) - expectation_put_with_http_info(expectations, opts) - nil + # @return [Array] + def mockserver_expectation_put(expectations, opts = {}) + data, _status_code, _headers = mockserver_expectation_put_with_http_info(expectations, opts) + data end # create expectation - # @param expectations expectation to create + # @param expectations [Expectations] expectation(s) to create # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers - def expectation_put_with_http_info(expectations, opts = {}) + # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers + def mockserver_expectation_put_with_http_info(expectations, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: ExpectationApi.expectation_put ...' - end - # verify the required parameter 'expectations' is set - if @api_client.config.client_side_validation && expectations.nil? - fail ArgumentError, "Missing the required parameter 'expectations' when calling ExpectationApi.expectation_put" + @api_client.config.logger.debug 'Calling API: ExpectationApi.mockserver_expectation_put ...' end # resource path local_var_path = '/mockserver/expectation' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(expectations) - auth_names = [] - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(expectations) + + # return_type + return_type = opts[:debug_return_type] || 'Array' + + # auth_names + auth_names = opts[:debug_auth_names] || [] + + new_options = opts.merge( + :operation => :"ExpectationApi.mockserver_expectation_put", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: ExpectationApi#expectation_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: ExpectationApi#mockserver_expectation_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end + # create expectations from OpenAPI or Swagger + # @param open_api_expectations [OpenAPIExpectations] expectation(s) to create + # @param [Hash] opts the optional parameters + # @return [Array] + def mockserver_openapi_put(open_api_expectations, opts = {}) + data, _status_code, _headers = mockserver_openapi_put_with_http_info(open_api_expectations, opts) + data + end + + # create expectations from OpenAPI or Swagger + # @param open_api_expectations [OpenAPIExpectations] expectation(s) to create + # @param [Hash] opts the optional parameters + # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers + def mockserver_openapi_put_with_http_info(open_api_expectations, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ExpectationApi.mockserver_openapi_put ...' + end + # verify the required parameter 'open_api_expectations' is set + if @api_client.config.client_side_validation && open_api_expectations.nil? + fail ArgumentError, "Missing the required parameter 'open_api_expectations' when calling ExpectationApi.mockserver_openapi_put" + end + # resource path + local_var_path = '/mockserver/openapi' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(open_api_expectations) + + # return_type + return_type = opts[:debug_return_type] || 'Array' + + # auth_names + auth_names = opts[:debug_auth_names] || [] + + new_options = opts.merge( + :operation => :"ExpectationApi.mockserver_openapi_put", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ExpectationApi#mockserver_openapi_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end end diff --git a/lib/mockserver-client/api/verify_api.rb b/lib/mockserver-client/api/verify_api.rb index 0941736..cb8eddd 100644 --- a/lib/mockserver-client/api/verify_api.rb +++ b/lib/mockserver-client/api/verify_api.rb @@ -1,16 +1,16 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end -require 'uri' +require 'cgi' module MockServer class VerifyApi @@ -20,108 +20,135 @@ def initialize(api_client = ApiClient.default) @api_client = api_client end # verify a request has been received a specific number of times - # @param verification request matcher and the number of times to match + # @param verification [Verification] request matcher and the number of times to match # @param [Hash] opts the optional parameters # @return [nil] - def verify_put(verification, opts = {}) - verify_put_with_http_info(verification, opts) + def mockserver_verify_put(verification, opts = {}) + mockserver_verify_put_with_http_info(verification, opts) nil end # verify a request has been received a specific number of times - # @param verification request matcher and the number of times to match + # @param verification [Verification] request matcher and the number of times to match # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers - def verify_put_with_http_info(verification, opts = {}) + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def mockserver_verify_put_with_http_info(verification, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: VerifyApi.verify_put ...' + @api_client.config.logger.debug 'Calling API: VerifyApi.mockserver_verify_put ...' end # verify the required parameter 'verification' is set if @api_client.config.client_side_validation && verification.nil? - fail ArgumentError, "Missing the required parameter 'verification' when calling VerifyApi.verify_put" + fail ArgumentError, "Missing the required parameter 'verification' when calling VerifyApi.mockserver_verify_put" end # resource path - local_var_path = 'mockserver/verify' + local_var_path = '/mockserver/verify' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['text/plain']) # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(verification) - auth_names = [] - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(verification) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [] + + new_options = opts.merge( + :operation => :"VerifyApi.mockserver_verify_put", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: VerifyApi#verify_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: VerifyApi#mockserver_verify_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # verify a sequence of request has been received in the specific order - # @param verification_sequence the sequence of requests matchers + # @param verification_sequence [VerificationSequence] the sequence of requests matchers # @param [Hash] opts the optional parameters # @return [nil] - def verify_sequence_put(verification_sequence, opts = {}) - verify_sequence_put_with_http_info(verification_sequence, opts) + def mockserver_verify_sequence_put(verification_sequence, opts = {}) + mockserver_verify_sequence_put_with_http_info(verification_sequence, opts) nil end # verify a sequence of request has been received in the specific order - # @param verification_sequence the sequence of requests matchers + # @param verification_sequence [VerificationSequence] the sequence of requests matchers # @param [Hash] opts the optional parameters - # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers - def verify_sequence_put_with_http_info(verification_sequence, opts = {}) + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def mockserver_verify_sequence_put_with_http_info(verification_sequence, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: VerifyApi.verify_sequence_put ...' + @api_client.config.logger.debug 'Calling API: VerifyApi.mockserver_verify_sequence_put ...' end # verify the required parameter 'verification_sequence' is set if @api_client.config.client_side_validation && verification_sequence.nil? - fail ArgumentError, "Missing the required parameter 'verification_sequence' when calling VerifyApi.verify_sequence_put" + fail ArgumentError, "Missing the required parameter 'verification_sequence' when calling VerifyApi.mockserver_verify_sequence_put" end # resource path - local_var_path = 'mockserver/verifySequence' + local_var_path = '/mockserver/verifySequence' # query parameters - query_params = {} + query_params = opts[:query_params] || {} # header parameters - header_params = {} + header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['text/plain']) # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters - form_params = {} + form_params = opts[:form_params] || {} # http body (model) - post_body = @api_client.object_to_http_body(verification_sequence) - auth_names = [] - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, + post_body = opts[:debug_body] || @api_client.object_to_http_body(verification_sequence) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [] + + new_options = opts.merge( + :operation => :"VerifyApi.mockserver_verify_sequence_put", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, - :auth_names => auth_names) + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: VerifyApi#verify_sequence_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: VerifyApi#mockserver_verify_sequence_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - end end diff --git a/lib/mockserver-client/api_client.rb b/lib/mockserver-client/api_client.rb index 2168c42..5ebb486 100644 --- a/lib/mockserver-client/api_client.rb +++ b/lib/mockserver-client/api_client.rb @@ -1,12 +1,12 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -14,8 +14,8 @@ require 'json' require 'logger' require 'tempfile' +require 'time' require 'typhoeus' -require 'uri' module MockServer class ApiClient @@ -44,7 +44,7 @@ def self.default # Call an API with given options. # - # @return [Array<(Object, Fixnum, Hash)>] an array of 3 elements: + # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: # the data deserialized from response body (could be nil), response status code and response headers. def call_api(http_method, path, opts = {}) request = build_request(http_method, path, opts) @@ -87,7 +87,7 @@ def call_api(http_method, path, opts = {}) # @option opts [Object] :body HTTP body (JSON/XML) # @return [Typhoeus::Request] A Typhoeus Request def build_request(http_method, path, opts = {}) - url = build_request_url(path) + url = build_request_url(path, opts) http_method = http_method.to_sym.downcase header_params = @default_headers.merge(opts[:header_params] || {}) @@ -127,6 +127,72 @@ def build_request(http_method, path, opts = {}) request end + # Builds the HTTP request body + # + # @param [Hash] header_params Header parameters + # @param [Hash] form_params Query parameters + # @param [Object] body HTTP body (JSON/XML) + # @return [String] HTTP body data in the form of string + def build_request_body(header_params, form_params, body) + # http form + if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || + header_params['Content-Type'] == 'multipart/form-data' + data = {} + form_params.each do |key, value| + case value + when ::File, ::Array, nil + # let typhoeus handle File, Array and nil parameters + data[key] = value + else + data[key] = value.to_s + end + end + elsif body + data = body.is_a?(String) ? body : body.to_json + else + data = nil + end + data + end + + # Save response body into a file in (the defined) temporary folder, using the filename + # from the "Content-Disposition" header if provided, otherwise a random filename. + # The response body is written to the file in chunks in order to handle files which + # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby + # process can use. + # + # @see Configuration#temp_folder_path + def download_file(request) + tempfile = nil + encoding = nil + request.on_headers do |response| + content_disposition = response.headers['Content-Disposition'] + if content_disposition && content_disposition =~ /filename=/i + filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] + prefix = sanitize_filename(filename) + else + prefix = 'download-' + end + prefix = prefix + '-' unless prefix.end_with?('-') + encoding = response.body.encoding + tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) + @tempfile = tempfile + end + request.on_body do |chunk| + chunk.force_encoding(encoding) + tempfile.write(chunk) + end + request.on_complete do |response| + if tempfile + tempfile.close + @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ + "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ + "will be deleted automatically with GC. It's also recommended to delete the temp file "\ + "explicitly with `tempfile.delete`" + end + end + end + # Check if the given MIME is a JSON MIME. # JSON MIME examples: # application/json @@ -142,7 +208,7 @@ def json_mime?(mime) # Deserialize the response to the given return type. # # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array[User]", "Hash[String,Integer]" + # @param [String] return_type some examples: "User", "Array", "Hash" def deserialize(response, return_type) body = response.body @@ -163,7 +229,7 @@ def deserialize(response, return_type) begin data = JSON.parse("[#{body}]", :symbolize_names => true)[0] rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) + if %w(String Date Time).include?(return_type) data = body else raise e @@ -186,11 +252,11 @@ def convert_to_type(data, return_type) data.to_i when 'Float' data.to_f - when 'BOOLEAN' + when 'Boolean' data == true - when 'DateTime' + when 'Time' # parse date time (expecting ISO 8601 format) - DateTime.parse data + Time.parse data when 'Date' # parse date time (expecting ISO 8601 format) Date.parse data @@ -208,46 +274,9 @@ def convert_to_type(data, return_type) data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } end else - # models, e.g. Pet - MockServer.const_get(return_type).new.tap do |model| - model.build_from_hash data - end - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - tempfile.close if tempfile - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(return_type) + klass.respond_to?(:openapi_one_of) ? klass.build(data) : klass.build_from_hash(data) end end @@ -260,41 +289,13 @@ def sanitize_filename(filename) filename.gsub(/.*[\/\\]/, '') end - def build_request_url(path) + def build_request_url(path, opts = {}) # Add leading and trailing slashes to path path = "/#{path}".gsub(/\/+/, '/') - CGI.escape(@config.base_url + path) - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' || - header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Array, nil - # let typhoeus handle File, Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data + @config.base_url(opts[:operation]) + path end - # Update hearder and query params based on authentication settings. + # Update header and query params based on authentication settings. # # @param [Hash] header_params Header parameters # @param [Hash] query_params Query parameters @@ -306,7 +307,7 @@ def update_params_for_auth!(header_params, query_params, auth_names) case auth_setting[:in] when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' + else fail ArgumentError, 'Authentication token must be in `query` or `header`' end end end @@ -333,8 +334,8 @@ def select_header_accept(accepts) # @param [Array] content_types array for Content-Type # @return [String] the Content-Type header (e.g. application/json) def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? + # return nil by default + return if content_types.nil? || content_types.empty? # use JSON when present, otherwise use the first one json_content_type = content_types.find { |s| json_mime?(s) } json_content_type || content_types.first diff --git a/lib/mockserver-client/api_error.rb b/lib/mockserver-client/api_error.rb index 7aa535a..293736d 100644 --- a/lib/mockserver-client/api_error.rb +++ b/lib/mockserver-client/api_error.rb @@ -1,12 +1,12 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -34,5 +34,24 @@ def initialize(arg = nil) super arg end end + + # Override to_s to display a friendly error message + def to_s + message + end + + def message + if @message.nil? + msg = "Error message: the server returns an error" + else + msg = @message + end + + msg += "\nHTTP status code: #{code}" if code + msg += "\nResponse headers: #{response_headers}" if response_headers + msg += "\nResponse body: #{response_body}" if response_body + + msg + end end end diff --git a/lib/mockserver-client/configuration.rb b/lib/mockserver-client/configuration.rb index 8605496..6e124ff 100644 --- a/lib/mockserver-client/configuration.rb +++ b/lib/mockserver-client/configuration.rb @@ -1,17 +1,15 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end -require 'uri' - module MockServer class Configuration # Defines url scheme @@ -23,6 +21,18 @@ class Configuration # Defines url base path attr_accessor :base_path + # Define server configuration index + attr_accessor :server_index + + # Define server operation configuration index + attr_accessor :server_operation_index + + # Default server variables + attr_accessor :server_variables + + # Default server operation variables + attr_accessor :server_operation_variables + # Defines API keys used with API Key authentications. # # @return [Hash] key: parameter name, value: parameter value (API key) @@ -129,17 +139,21 @@ class Configuration def initialize @scheme = 'http' - @host = 'localhost' + @host = 'localhost:1080' @base_path = '' + @server_index = 0 + @server_operation_index = {} + @server_variables = {} + @server_operation_variables = {} @api_key = {} @api_key_prefix = {} - @timeout = 0 @client_side_validation = true @verify_ssl = true @verify_ssl_host = true @params_encoding = nil @cert_file = nil @key_file = nil + @timeout = 0 @debugging = false @inject_format = false @force_ending_format = false @@ -173,18 +187,23 @@ def base_path=(base_path) @base_path = '' if @base_path == '/' end - def base_url - url = "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - CGI.escape(url) + # Returns base URL for specified operation based on server settings + def base_url(operation = nil) + index = server_operation_index.fetch(operation, server_index) + return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if index == nil + + server_url(index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation]) end # Gets API key (with prefix if set). # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) + def api_key_with_prefix(param_name, param_alias = nil) + key = @api_key[param_name] + key = @api_key.fetch(param_alias, key) unless param_alias.nil? if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" + "#{@api_key_prefix[param_name]} #{key}" else - @api_key[param_name] + key end end @@ -198,5 +217,59 @@ def auth_settings { } end + + # Returns an array of Server setting + def server_settings + [ + { + url: "http://localhost:1080", + description: "No description provided", + }, + { + url: "https://localhost:1080", + description: "No description provided", + } + ] + end + + def operation_server_settings + { + } + end + + # Returns URL based on server settings + # + # @param index array index of the server settings + # @param variables hash of variable and the corresponding value + def server_url(index, variables = {}, servers = nil) + servers = server_settings if servers == nil + + # check array index out of bound + if (index < 0 || index >= servers.size) + fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}" + end + + server = servers[index] + url = server[:url] + + return url unless server.key? :variables + + # go through variable and assign a value + server[:variables].each do |name, variable| + if variables.key?(name) + if (!server[:variables][name].key?(:enum_values) || server[:variables][name][:enum_values].include?(variables[name])) + url.gsub! "{" + name.to_s + "}", variables[name] + else + fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}." + end + else + # use default value + url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value] + end + end + + url + end + end end diff --git a/lib/mockserver-client/models/body.rb b/lib/mockserver-client/models/body.rb index de90e07..22da068 100644 --- a/lib/mockserver-client/models/body.rb +++ b/lib/mockserver-client/models/body.rb @@ -1,38 +1,218 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end require 'date' +require 'time' module MockServer + # request body matcher class Body + attr_accessor :_not + + attr_accessor :type + + attr_accessor :base64_bytes + + attr_accessor :content_type + + attr_accessor :json + + attr_accessor :match_type + + attr_accessor :json_schema + + attr_accessor :json_path + + attr_accessor :parameters + + attr_accessor :regex + + attr_accessor :string + + attr_accessor :sub_string + + attr_accessor :xml + + attr_accessor :xml_schema + + attr_accessor :xpath + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'_not' => :'not', + :'type' => :'type', + :'base64_bytes' => :'base64Bytes', + :'content_type' => :'contentType', + :'json' => :'json', + :'match_type' => :'matchType', + :'json_schema' => :'jsonSchema', + :'json_path' => :'jsonPath', + :'parameters' => :'parameters', + :'regex' => :'regex', + :'string' => :'string', + :'sub_string' => :'subString', + :'xml' => :'xml', + :'xml_schema' => :'xmlSchema', + :'xpath' => :'xpath' } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. def self.openapi_types { + :'_not' => :'Boolean', + :'type' => :'String', + :'base64_bytes' => :'String', + :'content_type' => :'String', + :'json' => :'String', + :'match_type' => :'String', + :'json_schema' => :'Object', + :'json_path' => :'String', + :'parameters' => :'KeyToMultiValue', + :'regex' => :'String', + :'string' => :'String', + :'sub_string' => :'Boolean', + :'xml' => :'String', + :'xml_schema' => :'String', + :'xpath' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # List of class defined in anyOf (OpenAPI v3) + def self.openapi_any_of + [ + :'BodyAnyOf', + :'BodyAnyOf1', + :'BodyAnyOf2', + :'BodyAnyOf3', + :'BodyAnyOf4', + :'BodyAnyOf5', + :'BodyAnyOf6', + :'BodyAnyOf7', + :'BodyAnyOf8', + :'BodyAnyOf9', + :'Hash', + :'String' + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::Body` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::Body`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'_not') + self._not = attributes[:'_not'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'base64_bytes') + self.base64_bytes = attributes[:'base64_bytes'] + end + + if attributes.key?(:'content_type') + self.content_type = attributes[:'content_type'] + end + + if attributes.key?(:'json') + self.json = attributes[:'json'] + end + + if attributes.key?(:'match_type') + self.match_type = attributes[:'match_type'] + end + + if attributes.key?(:'json_schema') + self.json_schema = attributes[:'json_schema'] + end + + if attributes.key?(:'json_path') + self.json_path = attributes[:'json_path'] + end + + if attributes.key?(:'parameters') + self.parameters = attributes[:'parameters'] + end + + if attributes.key?(:'regex') + self.regex = attributes[:'regex'] + end + + if attributes.key?(:'string') + self.string = attributes[:'string'] + end + + if attributes.key?(:'sub_string') + self.sub_string = attributes[:'sub_string'] + end + + if attributes.key?(:'xml') + self.xml = attributes[:'xml'] + end + + if attributes.key?(:'xml_schema') + self.xml_schema = attributes[:'xml_schema'] + end + + if attributes.key?(:'xpath') + self.xpath = attributes[:'xpath'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -45,14 +225,65 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + type_validator = EnumAttributeValidator.new('String', ["XPATH"]) + return false unless type_validator.valid?(@type) + match_type_validator = EnumAttributeValidator.new('String', ["STRICT", "ONLY_MATCHING_FIELDS"]) + return false unless match_type_validator.valid?(@match_type) + _any_of_found = false + self.class.openapi_any_of.each do |_class| + _any_of = MockServer.const_get(_class).build_from_hash(self.to_hash) + if _any_of.valid? + _any_of_found = true + end + end + + if !_any_of_found + return false + end + true end + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["XPATH"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] match_type Object to be assigned + def match_type=(match_type) + validator = EnumAttributeValidator.new('String', ["STRICT", "ONLY_MATCHING_FIELDS"]) + unless validator.valid?(match_type) + fail ArgumentError, "invalid value for \"match_type\", must be one of #{validator.allowable_values}." + end + @match_type = match_type + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) - self.class == o.class + self.class == o.class && + _not == o._not && + type == o.type && + base64_bytes == o.base64_bytes && + content_type == o.content_type && + json == o.json && + match_type == o.match_type && + json_schema == o.json_schema && + json_path == o.json_path && + parameters == o.parameters && + regex == o.regex && + string == o.string && + sub_string == o.sub_string && + xml == o.xml && + xml_schema == o.xml_schema && + xpath == o.xpath end # @see the `==` method @@ -62,9 +293,16 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash - [].hash + [_not, type, base64_bytes, content_type, json, match_type, json_schema, json_path, parameters, regex, string, sub_string, xml, xml_schema, xpath].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) end # Builds the object from hash @@ -73,15 +311,17 @@ def hash def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -93,8 +333,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -103,7 +343,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -124,8 +364,9 @@ def _deserialize(type, value) end end else # model - temp_model = MockServer.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -147,7 +388,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -170,5 +415,7 @@ def _to_hash(value) value end end + end + end diff --git a/lib/mockserver-client/models/body_any_of.rb b/lib/mockserver-client/models/body_any_of.rb new file mode 100644 index 0000000..0df38cc --- /dev/null +++ b/lib/mockserver-client/models/body_any_of.rb @@ -0,0 +1,280 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module MockServer + # binary body matcher + class BodyAnyOf + attr_accessor :_not + + attr_accessor :type + + attr_accessor :base64_bytes + + attr_accessor :content_type + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'_not' => :'not', + :'type' => :'type', + :'base64_bytes' => :'base64Bytes', + :'content_type' => :'contentType' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'_not' => :'Boolean', + :'type' => :'String', + :'base64_bytes' => :'String', + :'content_type' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::BodyAnyOf` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::BodyAnyOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'_not') + self._not = attributes[:'_not'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'base64_bytes') + self.base64_bytes = attributes[:'base64_bytes'] + end + + if attributes.key?(:'content_type') + self.content_type = attributes[:'content_type'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + type_validator = EnumAttributeValidator.new('String', ["BINARY"]) + return false unless type_validator.valid?(@type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["BINARY"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _not == o._not && + type == o.type && + base64_bytes == o.base64_bytes && + content_type == o.content_type + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [_not, type, base64_bytes, content_type].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/mockserver-client/models/body_any_of1.rb b/lib/mockserver-client/models/body_any_of1.rb new file mode 100644 index 0000000..0cd72b7 --- /dev/null +++ b/lib/mockserver-client/models/body_any_of1.rb @@ -0,0 +1,301 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module MockServer + # json body matcher + class BodyAnyOf1 + attr_accessor :_not + + attr_accessor :type + + attr_accessor :json + + attr_accessor :content_type + + attr_accessor :match_type + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'_not' => :'not', + :'type' => :'type', + :'json' => :'json', + :'content_type' => :'contentType', + :'match_type' => :'matchType' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'_not' => :'Boolean', + :'type' => :'String', + :'json' => :'String', + :'content_type' => :'String', + :'match_type' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::BodyAnyOf1` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::BodyAnyOf1`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'_not') + self._not = attributes[:'_not'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'json') + self.json = attributes[:'json'] + end + + if attributes.key?(:'content_type') + self.content_type = attributes[:'content_type'] + end + + if attributes.key?(:'match_type') + self.match_type = attributes[:'match_type'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + type_validator = EnumAttributeValidator.new('String', ["JSON"]) + return false unless type_validator.valid?(@type) + match_type_validator = EnumAttributeValidator.new('String', ["STRICT", "ONLY_MATCHING_FIELDS"]) + return false unless match_type_validator.valid?(@match_type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["JSON"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] match_type Object to be assigned + def match_type=(match_type) + validator = EnumAttributeValidator.new('String', ["STRICT", "ONLY_MATCHING_FIELDS"]) + unless validator.valid?(match_type) + fail ArgumentError, "invalid value for \"match_type\", must be one of #{validator.allowable_values}." + end + @match_type = match_type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _not == o._not && + type == o.type && + json == o.json && + content_type == o.content_type && + match_type == o.match_type + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [_not, type, json, content_type, match_type].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/mockserver-client/models/body_any_of2.rb b/lib/mockserver-client/models/body_any_of2.rb new file mode 100644 index 0000000..9344d32 --- /dev/null +++ b/lib/mockserver-client/models/body_any_of2.rb @@ -0,0 +1,271 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module MockServer + # json schema body matcher + class BodyAnyOf2 + attr_accessor :_not + + attr_accessor :type + + attr_accessor :json_schema + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'_not' => :'not', + :'type' => :'type', + :'json_schema' => :'jsonSchema' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'_not' => :'Boolean', + :'type' => :'String', + :'json_schema' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::BodyAnyOf2` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::BodyAnyOf2`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'_not') + self._not = attributes[:'_not'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'json_schema') + self.json_schema = attributes[:'json_schema'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + type_validator = EnumAttributeValidator.new('String', ["JSON_SCHEMA"]) + return false unless type_validator.valid?(@type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["JSON_SCHEMA"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _not == o._not && + type == o.type && + json_schema == o.json_schema + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [_not, type, json_schema].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/mockserver-client/models/body_any_of3.rb b/lib/mockserver-client/models/body_any_of3.rb new file mode 100644 index 0000000..7d74889 --- /dev/null +++ b/lib/mockserver-client/models/body_any_of3.rb @@ -0,0 +1,271 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module MockServer + # JSON path body matcher + class BodyAnyOf3 + attr_accessor :_not + + attr_accessor :type + + attr_accessor :json_path + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'_not' => :'not', + :'type' => :'type', + :'json_path' => :'jsonPath' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'_not' => :'Boolean', + :'type' => :'String', + :'json_path' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::BodyAnyOf3` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::BodyAnyOf3`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'_not') + self._not = attributes[:'_not'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'json_path') + self.json_path = attributes[:'json_path'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + type_validator = EnumAttributeValidator.new('String', ["JSON_PATH"]) + return false unless type_validator.valid?(@type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["JSON_PATH"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _not == o._not && + type == o.type && + json_path == o.json_path + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [_not, type, json_path].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/mockserver-client/models/body_any_of4.rb b/lib/mockserver-client/models/body_any_of4.rb new file mode 100644 index 0000000..143b968 --- /dev/null +++ b/lib/mockserver-client/models/body_any_of4.rb @@ -0,0 +1,271 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module MockServer + # parameter body matcher + class BodyAnyOf4 + attr_accessor :_not + + attr_accessor :type + + attr_accessor :parameters + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'_not' => :'not', + :'type' => :'type', + :'parameters' => :'parameters' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'_not' => :'Boolean', + :'type' => :'String', + :'parameters' => :'KeyToMultiValue' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::BodyAnyOf4` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::BodyAnyOf4`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'_not') + self._not = attributes[:'_not'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'parameters') + self.parameters = attributes[:'parameters'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + type_validator = EnumAttributeValidator.new('String', ["PARAMETERS"]) + return false unless type_validator.valid?(@type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["PARAMETERS"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _not == o._not && + type == o.type && + parameters == o.parameters + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [_not, type, parameters].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/mockserver-client/models/body_any_of5.rb b/lib/mockserver-client/models/body_any_of5.rb new file mode 100644 index 0000000..b7ad372 --- /dev/null +++ b/lib/mockserver-client/models/body_any_of5.rb @@ -0,0 +1,271 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module MockServer + # regex body matcher + class BodyAnyOf5 + attr_accessor :_not + + attr_accessor :type + + attr_accessor :regex + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'_not' => :'not', + :'type' => :'type', + :'regex' => :'regex' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'_not' => :'Boolean', + :'type' => :'String', + :'regex' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::BodyAnyOf5` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::BodyAnyOf5`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'_not') + self._not = attributes[:'_not'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'regex') + self.regex = attributes[:'regex'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + type_validator = EnumAttributeValidator.new('String', ["REGEX"]) + return false unless type_validator.valid?(@type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["REGEX"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _not == o._not && + type == o.type && + regex == o.regex + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [_not, type, regex].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/mockserver-client/models/body_any_of6.rb b/lib/mockserver-client/models/body_any_of6.rb new file mode 100644 index 0000000..c87eb9a --- /dev/null +++ b/lib/mockserver-client/models/body_any_of6.rb @@ -0,0 +1,289 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module MockServer + # string body matcher + class BodyAnyOf6 + attr_accessor :_not + + attr_accessor :type + + attr_accessor :string + + attr_accessor :content_type + + attr_accessor :sub_string + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'_not' => :'not', + :'type' => :'type', + :'string' => :'string', + :'content_type' => :'contentType', + :'sub_string' => :'subString' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'_not' => :'Boolean', + :'type' => :'String', + :'string' => :'String', + :'content_type' => :'String', + :'sub_string' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::BodyAnyOf6` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::BodyAnyOf6`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'_not') + self._not = attributes[:'_not'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'string') + self.string = attributes[:'string'] + end + + if attributes.key?(:'content_type') + self.content_type = attributes[:'content_type'] + end + + if attributes.key?(:'sub_string') + self.sub_string = attributes[:'sub_string'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + type_validator = EnumAttributeValidator.new('String', ["STRING"]) + return false unless type_validator.valid?(@type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["STRING"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _not == o._not && + type == o.type && + string == o.string && + content_type == o.content_type && + sub_string == o.sub_string + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [_not, type, string, content_type, sub_string].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/mockserver-client/models/body_any_of7.rb b/lib/mockserver-client/models/body_any_of7.rb new file mode 100644 index 0000000..e2bcbef --- /dev/null +++ b/lib/mockserver-client/models/body_any_of7.rb @@ -0,0 +1,280 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module MockServer + # xml body matcher + class BodyAnyOf7 + attr_accessor :_not + + attr_accessor :type + + attr_accessor :xml + + attr_accessor :content_type + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'_not' => :'not', + :'type' => :'type', + :'xml' => :'xml', + :'content_type' => :'contentType' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'_not' => :'Boolean', + :'type' => :'String', + :'xml' => :'String', + :'content_type' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::BodyAnyOf7` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::BodyAnyOf7`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'_not') + self._not = attributes[:'_not'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'xml') + self.xml = attributes[:'xml'] + end + + if attributes.key?(:'content_type') + self.content_type = attributes[:'content_type'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + type_validator = EnumAttributeValidator.new('String', ["XML"]) + return false unless type_validator.valid?(@type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["XML"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _not == o._not && + type == o.type && + xml == o.xml && + content_type == o.content_type + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [_not, type, xml, content_type].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/mockserver-client/models/body_any_of8.rb b/lib/mockserver-client/models/body_any_of8.rb new file mode 100644 index 0000000..ecd609d --- /dev/null +++ b/lib/mockserver-client/models/body_any_of8.rb @@ -0,0 +1,271 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module MockServer + # xml schema body matcher + class BodyAnyOf8 + attr_accessor :_not + + attr_accessor :type + + attr_accessor :xml_schema + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'_not' => :'not', + :'type' => :'type', + :'xml_schema' => :'xmlSchema' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'_not' => :'Boolean', + :'type' => :'String', + :'xml_schema' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::BodyAnyOf8` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::BodyAnyOf8`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'_not') + self._not = attributes[:'_not'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'xml_schema') + self.xml_schema = attributes[:'xml_schema'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + type_validator = EnumAttributeValidator.new('String', ["XML_SCHEMA"]) + return false unless type_validator.valid?(@type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["XML_SCHEMA"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _not == o._not && + type == o.type && + xml_schema == o.xml_schema + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [_not, type, xml_schema].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/mockserver-client/models/body_any_of9.rb b/lib/mockserver-client/models/body_any_of9.rb new file mode 100644 index 0000000..4e0d120 --- /dev/null +++ b/lib/mockserver-client/models/body_any_of9.rb @@ -0,0 +1,271 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module MockServer + # xpath body matcher + class BodyAnyOf9 + attr_accessor :_not + + attr_accessor :type + + attr_accessor :xpath + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'_not' => :'not', + :'type' => :'type', + :'xpath' => :'xpath' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'_not' => :'Boolean', + :'type' => :'String', + :'xpath' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::BodyAnyOf9` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::BodyAnyOf9`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'_not') + self._not = attributes[:'_not'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'xpath') + self.xpath = attributes[:'xpath'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + type_validator = EnumAttributeValidator.new('String', ["XPATH"]) + return false unless type_validator.valid?(@type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["XPATH"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _not == o._not && + type == o.type && + xpath == o.xpath + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [_not, type, xpath].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/mockserver-client/models/body_with_content_type.rb b/lib/mockserver-client/models/body_with_content_type.rb index 5f4af23..f5cf851 100644 --- a/lib/mockserver-client/models/body_with_content_type.rb +++ b/lib/mockserver-client/models/body_with_content_type.rb @@ -1,38 +1,148 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end require 'date' +require 'time' module MockServer + # response body class BodyWithContentType + attr_accessor :_not + + attr_accessor :type + + attr_accessor :base64_bytes + + attr_accessor :content_type + + attr_accessor :json + + attr_accessor :string + + attr_accessor :xml + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'_not' => :'not', + :'type' => :'type', + :'base64_bytes' => :'base64Bytes', + :'content_type' => :'contentType', + :'json' => :'json', + :'string' => :'string', + :'xml' => :'xml' } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. def self.openapi_types { + :'_not' => :'Boolean', + :'type' => :'String', + :'base64_bytes' => :'String', + :'content_type' => :'String', + :'json' => :'String', + :'string' => :'String', + :'xml' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # List of class defined in anyOf (OpenAPI v3) + def self.openapi_any_of + [ + :'BodyWithContentTypeAnyOf', + :'BodyWithContentTypeAnyOf1', + :'BodyWithContentTypeAnyOf2', + :'BodyWithContentTypeAnyOf3', + :'Hash', + :'String' + ] + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::BodyWithContentType` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::BodyWithContentType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'_not') + self._not = attributes[:'_not'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'base64_bytes') + self.base64_bytes = attributes[:'base64_bytes'] + end + + if attributes.key?(:'content_type') + self.content_type = attributes[:'content_type'] + end + + if attributes.key?(:'json') + self.json = attributes[:'json'] + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + if attributes.key?(:'string') + self.string = attributes[:'string'] + end + + if attributes.key?(:'xml') + self.xml = attributes[:'xml'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -45,14 +155,45 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + type_validator = EnumAttributeValidator.new('String', ["XML"]) + return false unless type_validator.valid?(@type) + _any_of_found = false + self.class.openapi_any_of.each do |_class| + _any_of = MockServer.const_get(_class).build_from_hash(self.to_hash) + if _any_of.valid? + _any_of_found = true + end + end + + if !_any_of_found + return false + end + true end + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["XML"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) - self.class == o.class + self.class == o.class && + _not == o._not && + type == o.type && + base64_bytes == o.base64_bytes && + content_type == o.content_type && + json == o.json && + string == o.string && + xml == o.xml end # @see the `==` method @@ -62,9 +203,16 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash - [].hash + [_not, type, base64_bytes, content_type, json, string, xml].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) end # Builds the object from hash @@ -73,15 +221,17 @@ def hash def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -93,8 +243,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -103,7 +253,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -124,8 +274,9 @@ def _deserialize(type, value) end end else # model - temp_model = MockServer.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -147,7 +298,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -170,5 +325,7 @@ def _to_hash(value) value end end + end + end diff --git a/lib/mockserver-client/models/body_with_content_type_any_of.rb b/lib/mockserver-client/models/body_with_content_type_any_of.rb new file mode 100644 index 0000000..c517925 --- /dev/null +++ b/lib/mockserver-client/models/body_with_content_type_any_of.rb @@ -0,0 +1,280 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module MockServer + # binary response body + class BodyWithContentTypeAnyOf + attr_accessor :_not + + attr_accessor :type + + attr_accessor :base64_bytes + + attr_accessor :content_type + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'_not' => :'not', + :'type' => :'type', + :'base64_bytes' => :'base64Bytes', + :'content_type' => :'contentType' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'_not' => :'Boolean', + :'type' => :'String', + :'base64_bytes' => :'String', + :'content_type' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::BodyWithContentTypeAnyOf` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::BodyWithContentTypeAnyOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'_not') + self._not = attributes[:'_not'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'base64_bytes') + self.base64_bytes = attributes[:'base64_bytes'] + end + + if attributes.key?(:'content_type') + self.content_type = attributes[:'content_type'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + type_validator = EnumAttributeValidator.new('String', ["BINARY"]) + return false unless type_validator.valid?(@type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["BINARY"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _not == o._not && + type == o.type && + base64_bytes == o.base64_bytes && + content_type == o.content_type + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [_not, type, base64_bytes, content_type].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/mockserver-client/models/body_with_content_type_any_of1.rb b/lib/mockserver-client/models/body_with_content_type_any_of1.rb new file mode 100644 index 0000000..627b4a0 --- /dev/null +++ b/lib/mockserver-client/models/body_with_content_type_any_of1.rb @@ -0,0 +1,280 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module MockServer + # json response body + class BodyWithContentTypeAnyOf1 + attr_accessor :_not + + attr_accessor :type + + attr_accessor :json + + attr_accessor :content_type + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'_not' => :'not', + :'type' => :'type', + :'json' => :'json', + :'content_type' => :'contentType' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'_not' => :'Boolean', + :'type' => :'String', + :'json' => :'String', + :'content_type' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::BodyWithContentTypeAnyOf1` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::BodyWithContentTypeAnyOf1`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'_not') + self._not = attributes[:'_not'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'json') + self.json = attributes[:'json'] + end + + if attributes.key?(:'content_type') + self.content_type = attributes[:'content_type'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + type_validator = EnumAttributeValidator.new('String', ["JSON"]) + return false unless type_validator.valid?(@type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["JSON"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _not == o._not && + type == o.type && + json == o.json && + content_type == o.content_type + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [_not, type, json, content_type].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/mockserver-client/models/body_with_content_type_any_of2.rb b/lib/mockserver-client/models/body_with_content_type_any_of2.rb new file mode 100644 index 0000000..d6b02f5 --- /dev/null +++ b/lib/mockserver-client/models/body_with_content_type_any_of2.rb @@ -0,0 +1,280 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module MockServer + # string response body + class BodyWithContentTypeAnyOf2 + attr_accessor :_not + + attr_accessor :type + + attr_accessor :string + + attr_accessor :content_type + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'_not' => :'not', + :'type' => :'type', + :'string' => :'string', + :'content_type' => :'contentType' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'_not' => :'Boolean', + :'type' => :'String', + :'string' => :'String', + :'content_type' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::BodyWithContentTypeAnyOf2` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::BodyWithContentTypeAnyOf2`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'_not') + self._not = attributes[:'_not'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'string') + self.string = attributes[:'string'] + end + + if attributes.key?(:'content_type') + self.content_type = attributes[:'content_type'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + type_validator = EnumAttributeValidator.new('String', ["STRING"]) + return false unless type_validator.valid?(@type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["STRING"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _not == o._not && + type == o.type && + string == o.string && + content_type == o.content_type + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [_not, type, string, content_type].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/mockserver-client/models/body_with_content_type_any_of3.rb b/lib/mockserver-client/models/body_with_content_type_any_of3.rb new file mode 100644 index 0000000..3ad7071 --- /dev/null +++ b/lib/mockserver-client/models/body_with_content_type_any_of3.rb @@ -0,0 +1,280 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module MockServer + # xml response body + class BodyWithContentTypeAnyOf3 + attr_accessor :_not + + attr_accessor :type + + attr_accessor :xml + + attr_accessor :content_type + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'_not' => :'not', + :'type' => :'type', + :'xml' => :'xml', + :'content_type' => :'contentType' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'_not' => :'Boolean', + :'type' => :'String', + :'xml' => :'String', + :'content_type' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::BodyWithContentTypeAnyOf3` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::BodyWithContentTypeAnyOf3`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'_not') + self._not = attributes[:'_not'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'xml') + self.xml = attributes[:'xml'] + end + + if attributes.key?(:'content_type') + self.content_type = attributes[:'content_type'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + type_validator = EnumAttributeValidator.new('String', ["XML"]) + return false unless type_validator.valid?(@type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["XML"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _not == o._not && + type == o.type && + xml == o.xml && + content_type == o.content_type + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [_not, type, xml, content_type].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/mockserver-client/models/connection_options.rb b/lib/mockserver-client/models/connection_options.rb index f51ecd9..afc8964 100644 --- a/lib/mockserver-client/models/connection_options.rb +++ b/lib/mockserver-client/models/connection_options.rb @@ -1,77 +1,113 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end require 'date' +require 'time' module MockServer + # connection options class ConnectionOptions - attr_accessor :close_socket + attr_accessor :suppress_content_length_header attr_accessor :content_length_header_override - attr_accessor :suppress_content_length_header - attr_accessor :suppress_connection_header + attr_accessor :chunk_size + attr_accessor :keep_alive_override + attr_accessor :close_socket + + attr_accessor :close_socket_delay + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'close_socket' => :'closeSocket', - :'content_length_header_override' => :'contentLengthHeaderOverride', :'suppress_content_length_header' => :'suppressContentLengthHeader', + :'content_length_header_override' => :'contentLengthHeaderOverride', :'suppress_connection_header' => :'suppressConnectionHeader', - :'keep_alive_override' => :'keepAliveOverride' + :'chunk_size' => :'chunkSize', + :'keep_alive_override' => :'keepAliveOverride', + :'close_socket' => :'closeSocket', + :'close_socket_delay' => :'closeSocketDelay' } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. def self.openapi_types { - :'close_socket' => :'BOOLEAN', + :'suppress_content_length_header' => :'Boolean', :'content_length_header_override' => :'Integer', - :'suppress_content_length_header' => :'BOOLEAN', - :'suppress_connection_header' => :'BOOLEAN', - :'keep_alive_override' => :'BOOLEAN' + :'suppress_connection_header' => :'Boolean', + :'chunk_size' => :'Integer', + :'keep_alive_override' => :'Boolean', + :'close_socket' => :'Boolean', + :'close_socket_delay' => :'Delay' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::ConnectionOptions` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::ConnectionOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'closeSocket') - self.close_socket = attributes[:'closeSocket'] + if attributes.key?(:'suppress_content_length_header') + self.suppress_content_length_header = attributes[:'suppress_content_length_header'] end - if attributes.has_key?(:'contentLengthHeaderOverride') - self.content_length_header_override = attributes[:'contentLengthHeaderOverride'] + if attributes.key?(:'content_length_header_override') + self.content_length_header_override = attributes[:'content_length_header_override'] end - if attributes.has_key?(:'suppressContentLengthHeader') - self.suppress_content_length_header = attributes[:'suppressContentLengthHeader'] + if attributes.key?(:'suppress_connection_header') + self.suppress_connection_header = attributes[:'suppress_connection_header'] end - if attributes.has_key?(:'suppressConnectionHeader') - self.suppress_connection_header = attributes[:'suppressConnectionHeader'] + if attributes.key?(:'chunk_size') + self.chunk_size = attributes[:'chunk_size'] end - if attributes.has_key?(:'keepAliveOverride') - self.keep_alive_override = attributes[:'keepAliveOverride'] + if attributes.key?(:'keep_alive_override') + self.keep_alive_override = attributes[:'keep_alive_override'] + end + + if attributes.key?(:'close_socket') + self.close_socket = attributes[:'close_socket'] + end + + if attributes.key?(:'close_socket_delay') + self.close_socket_delay = attributes[:'close_socket_delay'] end end @@ -93,11 +129,13 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - close_socket == o.close_socket && - content_length_header_override == o.content_length_header_override && suppress_content_length_header == o.suppress_content_length_header && + content_length_header_override == o.content_length_header_override && suppress_connection_header == o.suppress_connection_header && - keep_alive_override == o.keep_alive_override + chunk_size == o.chunk_size && + keep_alive_override == o.keep_alive_override && + close_socket == o.close_socket && + close_socket_delay == o.close_socket_delay end # @see the `==` method @@ -107,9 +145,16 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash - [close_socket, content_length_header_override, suppress_content_length_header, suppress_connection_header, keep_alive_override].hash + [suppress_content_length_header, content_length_header_override, suppress_connection_header, chunk_size, keep_alive_override, close_socket, close_socket_delay].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) end # Builds the object from hash @@ -118,15 +163,17 @@ def hash def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -138,8 +185,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -148,7 +195,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -169,8 +216,9 @@ def _deserialize(type, value) end end else # model - temp_model = MockServer.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -192,7 +240,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -215,5 +267,7 @@ def _to_hash(value) value end end + end + end diff --git a/lib/mockserver-client/models/delay.rb b/lib/mockserver-client/models/delay.rb index fa8ca8b..69aaf2a 100644 --- a/lib/mockserver-client/models/delay.rb +++ b/lib/mockserver-client/models/delay.rb @@ -1,18 +1,20 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end require 'date' +require 'time' module MockServer + # response delay class Delay attr_accessor :time_unit @@ -26,6 +28,11 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. def self.openapi_types { @@ -34,19 +41,32 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::Delay` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::Delay`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'timeUnit') - self.time_unit = attributes[:'timeUnit'] + if attributes.key?(:'time_unit') + self.time_unit = attributes[:'time_unit'] end - if attributes.has_key?(:'value') + if attributes.key?(:'value') self.value = attributes[:'value'] end end @@ -80,26 +100,35 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [time_unit, value].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -111,8 +140,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -121,7 +150,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -142,8 +171,9 @@ def _deserialize(type, value) end end else # model - temp_model = MockServer.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -165,7 +195,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -188,5 +222,7 @@ def _to_hash(value) value end end + end + end diff --git a/lib/mockserver-client/models/expectation.rb b/lib/mockserver-client/models/expectation.rb index d5608c5..8c59d76 100644 --- a/lib/mockserver-client/models/expectation.rb +++ b/lib/mockserver-client/models/expectation.rb @@ -1,174 +1,104 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end require 'date' +require 'time' module MockServer - class Expectation - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - return unless attributes.is_a?(Hash) - - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + module Expectation + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Object' + ] end - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :BOOLEAN - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises end end - else # model - temp_model = MockServer.const_get(type).new - temp_model.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) + openapi_one_of.include?(:AnyType) ? data : nil end - hash - end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + else # model + const = MockServer.const_get(klass) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + raise unless (data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model && model.valid? + end + end end - elsif value.respond_to? :to_hash - value.to_hash - else - value + + raise # if no match by now, raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" end end end + end diff --git a/lib/mockserver-client/models/expectation_id.rb b/lib/mockserver-client/models/expectation_id.rb new file mode 100644 index 0000000..c00ec7f --- /dev/null +++ b/lib/mockserver-client/models/expectation_id.rb @@ -0,0 +1,223 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module MockServer + class ExpectationId + attr_accessor :id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::ExpectationId` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::ExpectationId`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @id.nil? + invalid_properties.push('invalid value for "id", id cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @id.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/mockserver-client/models/expectations.rb b/lib/mockserver-client/models/expectations.rb index 19284c7..5393113 100644 --- a/lib/mockserver-client/models/expectations.rb +++ b/lib/mockserver-client/models/expectations.rb @@ -1,174 +1,105 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end require 'date' +require 'time' module MockServer - class Expectations - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - return unless attributes.is_a?(Hash) - - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + module Expectations + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Array', + :'Expectation' + ] end - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :BOOLEAN - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises end end - else # model - temp_model = MockServer.const_get(type).new - temp_model.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) + openapi_one_of.include?(:AnyType) ? data : nil end - hash - end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + else # model + const = MockServer.const_get(klass) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + raise unless (data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model && model.valid? + end + end end - elsif value.respond_to? :to_hash - value.to_hash - else - value + + raise # if no match by now, raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" end end end + end diff --git a/lib/mockserver-client/models/http_class_callback.rb b/lib/mockserver-client/models/http_class_callback.rb index ba5a4fc..307eb15 100644 --- a/lib/mockserver-client/models/http_class_callback.rb +++ b/lib/mockserver-client/models/http_class_callback.rb @@ -1,45 +1,72 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end require 'date' +require 'time' module MockServer class HttpClassCallback + attr_accessor :delay + attr_accessor :callback_class # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'delay' => :'delay', :'callback_class' => :'callbackClass' } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. def self.openapi_types { + :'delay' => :'Delay', :'callback_class' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::HttpClassCallback` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::HttpClassCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'delay') + self.delay = attributes[:'delay'] + end - if attributes.has_key?(:'callbackClass') - self.callback_class = attributes[:'callbackClass'] + if attributes.key?(:'callback_class') + self.callback_class = attributes[:'callback_class'] end end @@ -61,6 +88,7 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && + delay == o.delay && callback_class == o.callback_class end @@ -71,9 +99,16 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash - [callback_class].hash + [delay, callback_class].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) end # Builds the object from hash @@ -82,15 +117,17 @@ def hash def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -102,8 +139,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -112,7 +149,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -133,8 +170,9 @@ def _deserialize(type, value) end end else # model - temp_model = MockServer.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -156,7 +194,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -179,5 +221,7 @@ def _to_hash(value) value end end + end + end diff --git a/lib/mockserver-client/models/http_error.rb b/lib/mockserver-client/models/http_error.rb index f96909c..4738902 100644 --- a/lib/mockserver-client/models/http_error.rb +++ b/lib/mockserver-client/models/http_error.rb @@ -1,16 +1,17 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end require 'date' +require 'time' module MockServer class HttpError @@ -29,33 +30,51 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. def self.openapi_types { :'delay' => :'Delay', - :'drop_connection' => :'BOOLEAN', + :'drop_connection' => :'Boolean', :'response_bytes' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::HttpError` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::HttpError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'delay') + if attributes.key?(:'delay') self.delay = attributes[:'delay'] end - if attributes.has_key?(:'dropConnection') - self.drop_connection = attributes[:'dropConnection'] + if attributes.key?(:'drop_connection') + self.drop_connection = attributes[:'drop_connection'] end - if attributes.has_key?(:'responseBytes') - self.response_bytes = attributes[:'responseBytes'] + if attributes.key?(:'response_bytes') + self.response_bytes = attributes[:'response_bytes'] end end @@ -89,26 +108,35 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [delay, drop_connection, response_bytes].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -120,8 +148,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -130,7 +158,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -151,8 +179,9 @@ def _deserialize(type, value) end end else # model - temp_model = MockServer.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -174,7 +203,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -197,5 +230,7 @@ def _to_hash(value) value end end + end + end diff --git a/lib/mockserver-client/models/http_forward.rb b/lib/mockserver-client/models/http_forward.rb index f18a69f..2526dbc 100644 --- a/lib/mockserver-client/models/http_forward.rb +++ b/lib/mockserver-client/models/http_forward.rb @@ -1,27 +1,28 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end require 'date' +require 'time' module MockServer class HttpForward + attr_accessor :delay + attr_accessor :host attr_accessor :port attr_accessor :scheme - attr_accessor :delay - class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -47,46 +48,64 @@ def valid?(value) # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'delay' => :'delay', :'host' => :'host', :'port' => :'port', - :'scheme' => :'scheme', - :'delay' => :'delay' + :'scheme' => :'scheme' } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. def self.openapi_types { + :'delay' => :'Delay', :'host' => :'String', :'port' => :'Integer', - :'scheme' => :'String', - :'delay' => :'Delay' + :'scheme' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::HttpForward` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::HttpForward`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'delay') + self.delay = attributes[:'delay'] + end - if attributes.has_key?(:'host') + if attributes.key?(:'host') self.host = attributes[:'host'] end - if attributes.has_key?(:'port') + if attributes.key?(:'port') self.port = attributes[:'port'] end - if attributes.has_key?(:'scheme') + if attributes.key?(:'scheme') self.scheme = attributes[:'scheme'] end - - if attributes.has_key?(:'delay') - self.delay = attributes[:'delay'] - end end # Show invalid properties with the reasons. Usually used together with valid? @@ -99,7 +118,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - scheme_validator = EnumAttributeValidator.new('String', ['HTTP', 'HTTPS']) + scheme_validator = EnumAttributeValidator.new('String', ["HTTP", "HTTPS"]) return false unless scheme_validator.valid?(@scheme) true end @@ -107,9 +126,9 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] scheme Object to be assigned def scheme=(scheme) - validator = EnumAttributeValidator.new('String', ['HTTP', 'HTTPS']) + validator = EnumAttributeValidator.new('String', ["HTTP", "HTTPS"]) unless validator.valid?(scheme) - fail ArgumentError, 'invalid value for "scheme", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"scheme\", must be one of #{validator.allowable_values}." end @scheme = scheme end @@ -119,10 +138,10 @@ def scheme=(scheme) def ==(o) return true if self.equal?(o) self.class == o.class && + delay == o.delay && host == o.host && port == o.port && - scheme == o.scheme && - delay == o.delay + scheme == o.scheme end # @see the `==` method @@ -132,9 +151,16 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash - [host, port, scheme, delay].hash + [delay, host, port, scheme].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) end # Builds the object from hash @@ -143,15 +169,17 @@ def hash def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -163,8 +191,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -173,7 +201,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -194,8 +222,9 @@ def _deserialize(type, value) end end else # model - temp_model = MockServer.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -217,7 +246,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -240,5 +273,7 @@ def _to_hash(value) value end end + end + end diff --git a/lib/mockserver-client/models/http_object_callback.rb b/lib/mockserver-client/models/http_object_callback.rb index f0cd2f6..e2b65e3 100644 --- a/lib/mockserver-client/models/http_object_callback.rb +++ b/lib/mockserver-client/models/http_object_callback.rb @@ -1,45 +1,80 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end require 'date' +require 'time' module MockServer class HttpObjectCallback + attr_accessor :delay + attr_accessor :client_id + attr_accessor :response_callback + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'client_id' => :'clientId' + :'delay' => :'delay', + :'client_id' => :'clientId', + :'response_callback' => :'responseCallback' } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. def self.openapi_types { - :'client_id' => :'String' + :'delay' => :'Delay', + :'client_id' => :'String', + :'response_callback' => :'Boolean' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::HttpObjectCallback` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::HttpObjectCallback`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + if attributes.key?(:'delay') + self.delay = attributes[:'delay'] + end - if attributes.has_key?(:'clientId') - self.client_id = attributes[:'clientId'] + if attributes.key?(:'client_id') + self.client_id = attributes[:'client_id'] + end + + if attributes.key?(:'response_callback') + self.response_callback = attributes[:'response_callback'] end end @@ -61,7 +96,9 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - client_id == o.client_id + delay == o.delay && + client_id == o.client_id && + response_callback == o.response_callback end # @see the `==` method @@ -71,9 +108,16 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash - [client_id].hash + [delay, client_id, response_callback].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) end # Builds the object from hash @@ -82,15 +126,17 @@ def hash def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -102,8 +148,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -112,7 +158,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -133,8 +179,9 @@ def _deserialize(type, value) end end else # model - temp_model = MockServer.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -156,7 +203,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -179,5 +230,7 @@ def _to_hash(value) value end end + end + end diff --git a/lib/mockserver-client/models/http_override_forwarded_request.rb b/lib/mockserver-client/models/http_override_forwarded_request.rb index 631a18c..b1b9fb2 100644 --- a/lib/mockserver-client/models/http_override_forwarded_request.rb +++ b/lib/mockserver-client/models/http_override_forwarded_request.rb @@ -1,192 +1,105 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end require 'date' +require 'time' module MockServer - class HttpOverrideForwardedRequest - attr_accessor :http_request - - attr_accessor :delay - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'http_request' => :'httpRequest', - :'delay' => :'delay' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'http_request' => :'HttpRequest', - :'delay' => :'Delay' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - return unless attributes.is_a?(Hash) - - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - - if attributes.has_key?(:'httpRequest') - self.http_request = attributes[:'httpRequest'] - end - - if attributes.has_key?(:'delay') - self.delay = attributes[:'delay'] + module HttpOverrideForwardedRequest + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'HttpOverrideForwardedRequestOneOf', + :'HttpOverrideForwardedRequestOneOf1' + ] end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - http_request == o.http_request && - delay == o.delay - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code - def hash - [http_request, delay].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :BOOLEAN - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises end end - else # model - temp_model = MockServer.const_get(type).new - temp_model.build_from_hash(value) - end - end - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) + openapi_one_of.include?(:AnyType) ? data : nil end - hash - end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + else # model + const = MockServer.const_get(klass) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + raise unless (data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model && model.valid? + end + end end - elsif value.respond_to? :to_hash - value.to_hash - else - value + + raise # if no match by now, raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" end end end + end diff --git a/lib/mockserver-client/models/http_override_forwarded_request_one_of.rb b/lib/mockserver-client/models/http_override_forwarded_request_one_of.rb new file mode 100644 index 0000000..1a3732d --- /dev/null +++ b/lib/mockserver-client/models/http_override_forwarded_request_one_of.rb @@ -0,0 +1,254 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module MockServer + class HttpOverrideForwardedRequestOneOf + attr_accessor :delay + + attr_accessor :request_override + + attr_accessor :request_modifier + + attr_accessor :response_override + + attr_accessor :response_modifier + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'delay' => :'delay', + :'request_override' => :'requestOverride', + :'request_modifier' => :'requestModifier', + :'response_override' => :'responseOverride', + :'response_modifier' => :'responseModifier' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'delay' => :'Delay', + :'request_override' => :'HttpRequest', + :'request_modifier' => :'HttpOverrideForwardedRequestOneOfRequestModifier', + :'response_override' => :'HttpResponse', + :'response_modifier' => :'HttpOverrideForwardedRequestOneOfResponseModifier' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::HttpOverrideForwardedRequestOneOf` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::HttpOverrideForwardedRequestOneOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'delay') + self.delay = attributes[:'delay'] + end + + if attributes.key?(:'request_override') + self.request_override = attributes[:'request_override'] + end + + if attributes.key?(:'request_modifier') + self.request_modifier = attributes[:'request_modifier'] + end + + if attributes.key?(:'response_override') + self.response_override = attributes[:'response_override'] + end + + if attributes.key?(:'response_modifier') + self.response_modifier = attributes[:'response_modifier'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + delay == o.delay && + request_override == o.request_override && + request_modifier == o.request_modifier && + response_override == o.response_override && + response_modifier == o.response_modifier + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [delay, request_override, request_modifier, response_override, response_modifier].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/mockserver-client/models/http_override_forwarded_request_one_of1.rb b/lib/mockserver-client/models/http_override_forwarded_request_one_of1.rb new file mode 100644 index 0000000..5209d40 --- /dev/null +++ b/lib/mockserver-client/models/http_override_forwarded_request_one_of1.rb @@ -0,0 +1,236 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module MockServer + class HttpOverrideForwardedRequestOneOf1 + attr_accessor :delay + + attr_accessor :http_request + + attr_accessor :http_response + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'delay' => :'delay', + :'http_request' => :'httpRequest', + :'http_response' => :'httpResponse' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'delay' => :'Delay', + :'http_request' => :'HttpRequest', + :'http_response' => :'HttpResponse' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::HttpOverrideForwardedRequestOneOf1` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::HttpOverrideForwardedRequestOneOf1`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'delay') + self.delay = attributes[:'delay'] + end + + if attributes.key?(:'http_request') + self.http_request = attributes[:'http_request'] + end + + if attributes.key?(:'http_response') + self.http_response = attributes[:'http_response'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + delay == o.delay && + http_request == o.http_request && + http_response == o.http_response + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [delay, http_request, http_response].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/mockserver-client/models/http_override_forwarded_request_one_of_request_modifier.rb b/lib/mockserver-client/models/http_override_forwarded_request_one_of_request_modifier.rb new file mode 100644 index 0000000..9d4f605 --- /dev/null +++ b/lib/mockserver-client/models/http_override_forwarded_request_one_of_request_modifier.rb @@ -0,0 +1,245 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module MockServer + class HttpOverrideForwardedRequestOneOfRequestModifier + attr_accessor :path + + attr_accessor :query_string_parameters + + attr_accessor :headers + + attr_accessor :cookies + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'path' => :'path', + :'query_string_parameters' => :'queryStringParameters', + :'headers' => :'headers', + :'cookies' => :'cookies' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'path' => :'HttpOverrideForwardedRequestOneOfRequestModifierPath', + :'query_string_parameters' => :'HttpOverrideForwardedRequestOneOfRequestModifierQueryStringParameters', + :'headers' => :'HttpOverrideForwardedRequestOneOfRequestModifierQueryStringParameters', + :'cookies' => :'HttpOverrideForwardedRequestOneOfRequestModifierCookies' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::HttpOverrideForwardedRequestOneOfRequestModifier` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::HttpOverrideForwardedRequestOneOfRequestModifier`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'path') + self.path = attributes[:'path'] + end + + if attributes.key?(:'query_string_parameters') + self.query_string_parameters = attributes[:'query_string_parameters'] + end + + if attributes.key?(:'headers') + self.headers = attributes[:'headers'] + end + + if attributes.key?(:'cookies') + self.cookies = attributes[:'cookies'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + path == o.path && + query_string_parameters == o.query_string_parameters && + headers == o.headers && + cookies == o.cookies + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [path, query_string_parameters, headers, cookies].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/mockserver-client/models/http_override_forwarded_request_one_of_request_modifier_cookies.rb b/lib/mockserver-client/models/http_override_forwarded_request_one_of_request_modifier_cookies.rb new file mode 100644 index 0000000..18c5821 --- /dev/null +++ b/lib/mockserver-client/models/http_override_forwarded_request_one_of_request_modifier_cookies.rb @@ -0,0 +1,238 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module MockServer + class HttpOverrideForwardedRequestOneOfRequestModifierCookies + attr_accessor :add + + attr_accessor :replace + + attr_accessor :remove + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'add' => :'add', + :'replace' => :'replace', + :'remove' => :'remove' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'add' => :'KeyToValue', + :'replace' => :'KeyToValue', + :'remove' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::HttpOverrideForwardedRequestOneOfRequestModifierCookies` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::HttpOverrideForwardedRequestOneOfRequestModifierCookies`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'add') + self.add = attributes[:'add'] + end + + if attributes.key?(:'replace') + self.replace = attributes[:'replace'] + end + + if attributes.key?(:'remove') + if (value = attributes[:'remove']).is_a?(Array) + self.remove = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + add == o.add && + replace == o.replace && + remove == o.remove + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [add, replace, remove].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/mockserver-client/models/http_override_forwarded_request_one_of_request_modifier_path.rb b/lib/mockserver-client/models/http_override_forwarded_request_one_of_request_modifier_path.rb new file mode 100644 index 0000000..c157ff4 --- /dev/null +++ b/lib/mockserver-client/models/http_override_forwarded_request_one_of_request_modifier_path.rb @@ -0,0 +1,227 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module MockServer + class HttpOverrideForwardedRequestOneOfRequestModifierPath + attr_accessor :regex + + attr_accessor :substitution + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'regex' => :'regex', + :'substitution' => :'substitution' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'regex' => :'String', + :'substitution' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::HttpOverrideForwardedRequestOneOfRequestModifierPath` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::HttpOverrideForwardedRequestOneOfRequestModifierPath`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'regex') + self.regex = attributes[:'regex'] + end + + if attributes.key?(:'substitution') + self.substitution = attributes[:'substitution'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + regex == o.regex && + substitution == o.substitution + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [regex, substitution].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/mockserver-client/models/http_override_forwarded_request_one_of_request_modifier_query_string_parameters.rb b/lib/mockserver-client/models/http_override_forwarded_request_one_of_request_modifier_query_string_parameters.rb new file mode 100644 index 0000000..0d099f6 --- /dev/null +++ b/lib/mockserver-client/models/http_override_forwarded_request_one_of_request_modifier_query_string_parameters.rb @@ -0,0 +1,238 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module MockServer + class HttpOverrideForwardedRequestOneOfRequestModifierQueryStringParameters + attr_accessor :add + + attr_accessor :replace + + attr_accessor :remove + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'add' => :'add', + :'replace' => :'replace', + :'remove' => :'remove' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'add' => :'KeyToMultiValue', + :'replace' => :'KeyToMultiValue', + :'remove' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::HttpOverrideForwardedRequestOneOfRequestModifierQueryStringParameters` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::HttpOverrideForwardedRequestOneOfRequestModifierQueryStringParameters`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'add') + self.add = attributes[:'add'] + end + + if attributes.key?(:'replace') + self.replace = attributes[:'replace'] + end + + if attributes.key?(:'remove') + if (value = attributes[:'remove']).is_a?(Array) + self.remove = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + add == o.add && + replace == o.replace && + remove == o.remove + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [add, replace, remove].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/mockserver-client/models/http_override_forwarded_request_one_of_response_modifier.rb b/lib/mockserver-client/models/http_override_forwarded_request_one_of_response_modifier.rb new file mode 100644 index 0000000..71b8b5d --- /dev/null +++ b/lib/mockserver-client/models/http_override_forwarded_request_one_of_response_modifier.rb @@ -0,0 +1,227 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module MockServer + class HttpOverrideForwardedRequestOneOfResponseModifier + attr_accessor :headers + + attr_accessor :cookies + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'headers' => :'headers', + :'cookies' => :'cookies' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'headers' => :'HttpOverrideForwardedRequestOneOfRequestModifierQueryStringParameters', + :'cookies' => :'HttpOverrideForwardedRequestOneOfRequestModifierCookies' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::HttpOverrideForwardedRequestOneOfResponseModifier` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::HttpOverrideForwardedRequestOneOfResponseModifier`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'headers') + self.headers = attributes[:'headers'] + end + + if attributes.key?(:'cookies') + self.cookies = attributes[:'cookies'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + headers == o.headers && + cookies == o.cookies + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [headers, cookies].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/mockserver-client/models/http_request.rb b/lib/mockserver-client/models/http_request.rb index 951b3ef..ac375fa 100644 --- a/lib/mockserver-client/models/http_request.rb +++ b/lib/mockserver-client/models/http_request.rb @@ -1,101 +1,136 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end require 'date' +require 'time' module MockServer class HttpRequest - attr_accessor :body + attr_accessor :secure - attr_accessor :headers + attr_accessor :keep_alive - attr_accessor :cookies + attr_accessor :method + + attr_accessor :path + + attr_accessor :path_parameters attr_accessor :query_string_parameters - attr_accessor :path + attr_accessor :body - attr_accessor :method + attr_accessor :headers - attr_accessor :secure + attr_accessor :cookies - attr_accessor :keep_alive + attr_accessor :socket_address # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'secure' => :'secure', + :'keep_alive' => :'keepAlive', + :'method' => :'method', + :'path' => :'path', + :'path_parameters' => :'pathParameters', + :'query_string_parameters' => :'queryStringParameters', :'body' => :'body', :'headers' => :'headers', :'cookies' => :'cookies', - :'query_string_parameters' => :'queryStringParameters', - :'path' => :'path', - :'method' => :'method', - :'secure' => :'secure', - :'keep_alive' => :'keepAlive' + :'socket_address' => :'socketAddress' } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. def self.openapi_types { + :'secure' => :'Boolean', + :'keep_alive' => :'Boolean', + :'method' => :'StringOrJsonSchema', + :'path' => :'StringOrJsonSchema', + :'path_parameters' => :'KeyToMultiValue', + :'query_string_parameters' => :'KeyToMultiValue', :'body' => :'Body', :'headers' => :'KeyToMultiValue', :'cookies' => :'KeyToValue', - :'query_string_parameters' => :'KeyToMultiValue', - :'path' => :'String', - :'method' => :'String', - :'secure' => :'BOOLEAN', - :'keep_alive' => :'BOOLEAN' + :'socket_address' => :'SocketAddress' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::HttpRequest` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::HttpRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'body') - self.body = attributes[:'body'] + if attributes.key?(:'secure') + self.secure = attributes[:'secure'] end - if attributes.has_key?(:'headers') - self.headers = attributes[:'headers'] + if attributes.key?(:'keep_alive') + self.keep_alive = attributes[:'keep_alive'] end - if attributes.has_key?(:'cookies') - self.cookies = attributes[:'cookies'] + if attributes.key?(:'method') + self.method = attributes[:'method'] end - if attributes.has_key?(:'queryStringParameters') - self.query_string_parameters = attributes[:'queryStringParameters'] + if attributes.key?(:'path') + self.path = attributes[:'path'] end - if attributes.has_key?(:'path') - self.path = attributes[:'path'] + if attributes.key?(:'path_parameters') + self.path_parameters = attributes[:'path_parameters'] end - if attributes.has_key?(:'method') - self.method = attributes[:'method'] + if attributes.key?(:'query_string_parameters') + self.query_string_parameters = attributes[:'query_string_parameters'] end - if attributes.has_key?(:'secure') - self.secure = attributes[:'secure'] + if attributes.key?(:'body') + self.body = attributes[:'body'] end - if attributes.has_key?(:'keepAlive') - self.keep_alive = attributes[:'keepAlive'] + if attributes.key?(:'headers') + self.headers = attributes[:'headers'] + end + + if attributes.key?(:'cookies') + self.cookies = attributes[:'cookies'] + end + + if attributes.key?(:'socket_address') + self.socket_address = attributes[:'socket_address'] end end @@ -117,14 +152,16 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && + secure == o.secure && + keep_alive == o.keep_alive && + method == o.method && + path == o.path && + path_parameters == o.path_parameters && + query_string_parameters == o.query_string_parameters && body == o.body && headers == o.headers && cookies == o.cookies && - query_string_parameters == o.query_string_parameters && - path == o.path && - method == o.method && - secure == o.secure && - keep_alive == o.keep_alive + socket_address == o.socket_address end # @see the `==` method @@ -134,9 +171,16 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash - [body, headers, cookies, query_string_parameters, path, method, secure, keep_alive].hash + [secure, keep_alive, method, path, path_parameters, query_string_parameters, body, headers, cookies, socket_address].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) end # Builds the object from hash @@ -145,15 +189,17 @@ def hash def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -165,8 +211,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -175,7 +221,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -196,8 +242,9 @@ def _deserialize(type, value) end end else # model - temp_model = MockServer.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -219,7 +266,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -242,5 +293,7 @@ def _to_hash(value) value end end + end + end diff --git a/lib/mockserver-client/models/http_response.rb b/lib/mockserver-client/models/http_response.rb index c92292f..07e3c97 100644 --- a/lib/mockserver-client/models/http_response.rb +++ b/lib/mockserver-client/models/http_response.rb @@ -1,23 +1,24 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end require 'date' +require 'time' module MockServer class HttpResponse - attr_accessor :body - attr_accessor :delay + attr_accessor :body + attr_accessor :cookies attr_accessor :connection_options @@ -31,8 +32,8 @@ class HttpResponse # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'body' => :'body', :'delay' => :'delay', + :'body' => :'body', :'cookies' => :'cookies', :'connection_options' => :'connectionOptions', :'headers' => :'headers', @@ -41,11 +42,16 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. def self.openapi_types { - :'body' => :'BodyWithContentType', :'delay' => :'Delay', + :'body' => :'BodyWithContentType', :'cookies' => :'KeyToValue', :'connection_options' => :'ConnectionOptions', :'headers' => :'KeyToMultiValue', @@ -54,40 +60,53 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::HttpResponse` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::HttpResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'body') - self.body = attributes[:'body'] + if attributes.key?(:'delay') + self.delay = attributes[:'delay'] end - if attributes.has_key?(:'delay') - self.delay = attributes[:'delay'] + if attributes.key?(:'body') + self.body = attributes[:'body'] end - if attributes.has_key?(:'cookies') + if attributes.key?(:'cookies') self.cookies = attributes[:'cookies'] end - if attributes.has_key?(:'connectionOptions') - self.connection_options = attributes[:'connectionOptions'] + if attributes.key?(:'connection_options') + self.connection_options = attributes[:'connection_options'] end - if attributes.has_key?(:'headers') + if attributes.key?(:'headers') self.headers = attributes[:'headers'] end - if attributes.has_key?(:'statusCode') - self.status_code = attributes[:'statusCode'] + if attributes.key?(:'status_code') + self.status_code = attributes[:'status_code'] end - if attributes.has_key?(:'reasonPhrase') - self.reason_phrase = attributes[:'reasonPhrase'] + if attributes.key?(:'reason_phrase') + self.reason_phrase = attributes[:'reason_phrase'] end end @@ -109,8 +128,8 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - body == o.body && delay == o.delay && + body == o.body && cookies == o.cookies && connection_options == o.connection_options && headers == o.headers && @@ -125,9 +144,16 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash - [body, delay, cookies, connection_options, headers, status_code, reason_phrase].hash + [delay, body, cookies, connection_options, headers, status_code, reason_phrase].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) end # Builds the object from hash @@ -136,15 +162,17 @@ def hash def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -156,8 +184,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -166,7 +194,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -187,8 +215,9 @@ def _deserialize(type, value) end end else # model - temp_model = MockServer.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -210,7 +239,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -233,5 +266,7 @@ def _to_hash(value) value end end + end + end diff --git a/lib/mockserver-client/models/http_template.rb b/lib/mockserver-client/models/http_template.rb index d1787e5..4229983 100644 --- a/lib/mockserver-client/models/http_template.rb +++ b/lib/mockserver-client/models/http_template.rb @@ -1,25 +1,26 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end require 'date' +require 'time' module MockServer class HttpTemplate + attr_accessor :delay + attr_accessor :template_type attr_accessor :template - attr_accessor :delay - class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values @@ -45,39 +46,57 @@ def valid?(value) # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'delay' => :'delay', :'template_type' => :'templateType', - :'template' => :'template', - :'delay' => :'delay' + :'template' => :'template' } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. def self.openapi_types { + :'delay' => :'Delay', :'template_type' => :'String', - :'template' => :'String', - :'delay' => :'Delay' + :'template' => :'String' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::HttpTemplate` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::HttpTemplate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'templateType') - self.template_type = attributes[:'templateType'] + if attributes.key?(:'delay') + self.delay = attributes[:'delay'] end - if attributes.has_key?(:'template') - self.template = attributes[:'template'] + if attributes.key?(:'template_type') + self.template_type = attributes[:'template_type'] end - if attributes.has_key?(:'delay') - self.delay = attributes[:'delay'] + if attributes.key?(:'template') + self.template = attributes[:'template'] end end @@ -91,7 +110,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - template_type_validator = EnumAttributeValidator.new('String', ['JAVASCRIPT', 'VELOCITY']) + template_type_validator = EnumAttributeValidator.new('String', ["VELOCITY", "JAVASCRIPT", "MUSTACHE"]) return false unless template_type_validator.valid?(@template_type) true end @@ -99,9 +118,9 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] template_type Object to be assigned def template_type=(template_type) - validator = EnumAttributeValidator.new('String', ['JAVASCRIPT', 'VELOCITY']) + validator = EnumAttributeValidator.new('String', ["VELOCITY", "JAVASCRIPT", "MUSTACHE"]) unless validator.valid?(template_type) - fail ArgumentError, 'invalid value for "template_type", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"template_type\", must be one of #{validator.allowable_values}." end @template_type = template_type end @@ -111,9 +130,9 @@ def template_type=(template_type) def ==(o) return true if self.equal?(o) self.class == o.class && + delay == o.delay && template_type == o.template_type && - template == o.template && - delay == o.delay + template == o.template end # @see the `==` method @@ -123,9 +142,16 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash - [template_type, template, delay].hash + [delay, template_type, template].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) end # Builds the object from hash @@ -134,15 +160,17 @@ def hash def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -154,8 +182,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -164,7 +192,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -185,8 +213,9 @@ def _deserialize(type, value) end end else # model - temp_model = MockServer.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -208,7 +237,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -231,5 +264,7 @@ def _to_hash(value) value end end + end + end diff --git a/lib/mockserver-client/models/key_to_multi_value.rb b/lib/mockserver-client/models/key_to_multi_value.rb index 82a1930..6176b43 100644 --- a/lib/mockserver-client/models/key_to_multi_value.rb +++ b/lib/mockserver-client/models/key_to_multi_value.rb @@ -1,174 +1,105 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end require 'date' +require 'time' module MockServer - class KeyToMultiValue - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - return unless attributes.is_a?(Hash) - - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + module KeyToMultiValue + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Array', + :'KeyToMultiValueOneOf' + ] end - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :BOOLEAN - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises end end - else # model - temp_model = MockServer.const_get(type).new - temp_model.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) + openapi_one_of.include?(:AnyType) ? data : nil end - hash - end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + else # model + const = MockServer.const_get(klass) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + raise unless (data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model && model.valid? + end + end end - elsif value.respond_to? :to_hash - value.to_hash - else - value + + raise # if no match by now, raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" end end end + end diff --git a/lib/mockserver-client/models/key_to_multi_value_one_of.rb b/lib/mockserver-client/models/key_to_multi_value_one_of.rb new file mode 100644 index 0000000..48d037f --- /dev/null +++ b/lib/mockserver-client/models/key_to_multi_value_one_of.rb @@ -0,0 +1,254 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module MockServer + class KeyToMultiValueOneOf + attr_accessor :key_match_style + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'key_match_style' => :'keyMatchStyle' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'key_match_style' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::KeyToMultiValueOneOf` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::KeyToMultiValueOneOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'key_match_style') + self.key_match_style = attributes[:'key_match_style'] + else + self.key_match_style = 'SUB_SET' + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + key_match_style_validator = EnumAttributeValidator.new('String', ["MATCHING_KEY", "SUB_SET"]) + return false unless key_match_style_validator.valid?(@key_match_style) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] key_match_style Object to be assigned + def key_match_style=(key_match_style) + validator = EnumAttributeValidator.new('String', ["MATCHING_KEY", "SUB_SET"]) + unless validator.valid?(key_match_style) + fail ArgumentError, "invalid value for \"key_match_style\", must be one of #{validator.allowable_values}." + end + @key_match_style = key_match_style + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + key_match_style == o.key_match_style + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [key_match_style].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/mockserver-client/models/key_to_value.rb b/lib/mockserver-client/models/key_to_value.rb index e205498..4190903 100644 --- a/lib/mockserver-client/models/key_to_value.rb +++ b/lib/mockserver-client/models/key_to_value.rb @@ -1,174 +1,105 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end require 'date' +require 'time' module MockServer - class KeyToValue - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - return unless attributes.is_a?(Hash) - - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + module KeyToValue + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Array', + :'Hash' + ] end - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :BOOLEAN - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises end end - else # model - temp_model = MockServer.const_get(type).new - temp_model.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) + openapi_one_of.include?(:AnyType) ? data : nil end - hash - end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + else # model + const = MockServer.const_get(klass) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + raise unless (data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model && model.valid? + end + end end - elsif value.respond_to? :to_hash - value.to_hash - else - value + + raise # if no match by now, raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" end end end + end diff --git a/lib/mockserver-client/models/open_api_definition.rb b/lib/mockserver-client/models/open_api_definition.rb new file mode 100644 index 0000000..948fbc8 --- /dev/null +++ b/lib/mockserver-client/models/open_api_definition.rb @@ -0,0 +1,227 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module MockServer + class OpenAPIDefinition + attr_accessor :spec_url_or_payload + + attr_accessor :operation_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'spec_url_or_payload' => :'specUrlOrPayload', + :'operation_id' => :'operationId' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'spec_url_or_payload' => :'String', + :'operation_id' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::OpenAPIDefinition` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::OpenAPIDefinition`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'spec_url_or_payload') + self.spec_url_or_payload = attributes[:'spec_url_or_payload'] + end + + if attributes.key?(:'operation_id') + self.operation_id = attributes[:'operation_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + spec_url_or_payload == o.spec_url_or_payload && + operation_id == o.operation_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [spec_url_or_payload, operation_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/mockserver-client/models/open_api_expectation.rb b/lib/mockserver-client/models/open_api_expectation.rb new file mode 100644 index 0000000..1f03c71 --- /dev/null +++ b/lib/mockserver-client/models/open_api_expectation.rb @@ -0,0 +1,230 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module MockServer + class OpenAPIExpectation + attr_accessor :spec_url_or_payload + + attr_accessor :operations_and_responses + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'spec_url_or_payload' => :'specUrlOrPayload', + :'operations_and_responses' => :'operationsAndResponses' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'spec_url_or_payload' => :'AnyOfstringobject', + :'operations_and_responses' => :'Hash' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'spec_url_or_payload', + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::OpenAPIExpectation` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::OpenAPIExpectation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'spec_url_or_payload') + self.spec_url_or_payload = attributes[:'spec_url_or_payload'] + end + + if attributes.key?(:'operations_and_responses') + if (value = attributes[:'operations_and_responses']).is_a?(Hash) + self.operations_and_responses = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + spec_url_or_payload == o.spec_url_or_payload && + operations_and_responses == o.operations_and_responses + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [spec_url_or_payload, operations_and_responses].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/mockserver-client/models/open_api_expectations.rb b/lib/mockserver-client/models/open_api_expectations.rb new file mode 100644 index 0000000..ac5c784 --- /dev/null +++ b/lib/mockserver-client/models/open_api_expectations.rb @@ -0,0 +1,105 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module MockServer + module OpenAPIExpectations + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Array', + :'OpenAPIExpectation' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + else # model + const = MockServer.const_get(klass) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + raise unless (data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model && model.valid? + end + end + end + + raise # if no match by now, raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" + end + end + end + +end diff --git a/lib/mockserver-client/models/ports.rb b/lib/mockserver-client/models/ports.rb index fd3b4e4..af965d4 100644 --- a/lib/mockserver-client/models/ports.rb +++ b/lib/mockserver-client/models/ports.rb @@ -1,18 +1,20 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end require 'date' +require 'time' module MockServer + # list of ports class Ports attr_accessor :ports @@ -23,6 +25,11 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. def self.openapi_types { @@ -30,15 +37,28 @@ def self.openapi_types } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::Ports` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::Ports`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'ports') + if attributes.key?(:'ports') if (value = attributes[:'ports']).is_a?(Array) self.ports = value end @@ -73,26 +93,35 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [ports].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -104,8 +133,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -114,7 +143,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -135,8 +164,9 @@ def _deserialize(type, value) end end else # model - temp_model = MockServer.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -158,7 +188,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -181,5 +215,7 @@ def _to_hash(value) value end end + end + end diff --git a/lib/mockserver-client/models/positive_integer_default0.rb b/lib/mockserver-client/models/positive_integer_default0.rb new file mode 100644 index 0000000..24723d5 --- /dev/null +++ b/lib/mockserver-client/models/positive_integer_default0.rb @@ -0,0 +1,209 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module MockServer + class PositiveIntegerDefault0 + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::PositiveIntegerDefault0` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::PositiveIntegerDefault0`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/mockserver-client/models/request_definition.rb b/lib/mockserver-client/models/request_definition.rb new file mode 100644 index 0000000..aeedb0c --- /dev/null +++ b/lib/mockserver-client/models/request_definition.rb @@ -0,0 +1,105 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module MockServer + module RequestDefinition + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'HttpRequest', + :'OpenAPIDefinition' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + else # model + const = MockServer.const_get(klass) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + raise unless (data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model && model.valid? + end + end + end + + raise # if no match by now, raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" + end + end + end + +end diff --git a/lib/mockserver-client/models/schema.rb b/lib/mockserver-client/models/schema.rb new file mode 100644 index 0000000..3c2d197 --- /dev/null +++ b/lib/mockserver-client/models/schema.rb @@ -0,0 +1,602 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module MockServer + # Core schema meta-schema + class Schema + attr_accessor :id + + attr_accessor :schema + + attr_accessor :title + + attr_accessor :description + + attr_accessor :default + + attr_accessor :multiple_of + + attr_accessor :maximum + + attr_accessor :exclusive_maximum + + attr_accessor :minimum + + attr_accessor :exclusive_minimum + + attr_accessor :max_length + + attr_accessor :min_length + + attr_accessor :pattern + + attr_accessor :additional_items + + attr_accessor :items + + attr_accessor :max_items + + attr_accessor :min_items + + attr_accessor :unique_items + + attr_accessor :max_properties + + attr_accessor :min_properties + + attr_accessor :required + + attr_accessor :additional_properties + + attr_accessor :definitions + + attr_accessor :properties + + attr_accessor :pattern_properties + + attr_accessor :dependencies + + attr_accessor :enum + + attr_accessor :type + + attr_accessor :format + + attr_accessor :all_of + + attr_accessor :any_of + + attr_accessor :one_of + + attr_accessor :_not + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'schema' => :'$schema', + :'title' => :'title', + :'description' => :'description', + :'default' => :'default', + :'multiple_of' => :'multipleOf', + :'maximum' => :'maximum', + :'exclusive_maximum' => :'exclusiveMaximum', + :'minimum' => :'minimum', + :'exclusive_minimum' => :'exclusiveMinimum', + :'max_length' => :'maxLength', + :'min_length' => :'minLength', + :'pattern' => :'pattern', + :'additional_items' => :'additionalItems', + :'items' => :'items', + :'max_items' => :'maxItems', + :'min_items' => :'minItems', + :'unique_items' => :'uniqueItems', + :'max_properties' => :'maxProperties', + :'min_properties' => :'minProperties', + :'required' => :'required', + :'additional_properties' => :'additionalProperties', + :'definitions' => :'definitions', + :'properties' => :'properties', + :'pattern_properties' => :'patternProperties', + :'dependencies' => :'dependencies', + :'enum' => :'enum', + :'type' => :'type', + :'format' => :'format', + :'all_of' => :'allOf', + :'any_of' => :'anyOf', + :'one_of' => :'oneOf', + :'_not' => :'not' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'schema' => :'String', + :'title' => :'String', + :'description' => :'String', + :'default' => :'Object', + :'multiple_of' => :'Float', + :'maximum' => :'Float', + :'exclusive_maximum' => :'Boolean', + :'minimum' => :'Float', + :'exclusive_minimum' => :'Boolean', + :'max_length' => :'Integer', + :'min_length' => :'PositiveIntegerDefault0', + :'pattern' => :'String', + :'additional_items' => :'AnyOfboolean', + :'items' => :'AnyOfschemaArray', + :'max_items' => :'Integer', + :'min_items' => :'PositiveIntegerDefault0', + :'unique_items' => :'Boolean', + :'max_properties' => :'Integer', + :'min_properties' => :'PositiveIntegerDefault0', + :'required' => :'StringArray', + :'additional_properties' => :'AnyOfboolean', + :'definitions' => :'Hash', + :'properties' => :'Hash', + :'pattern_properties' => :'Hash', + :'dependencies' => :'Hash', + :'enum' => :'Array', + :'type' => :'AnyOfsimpleTypesset', + :'format' => :'String', + :'all_of' => :'SchemaArray', + :'any_of' => :'SchemaArray', + :'one_of' => :'SchemaArray', + :'_not' => :'' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + :'additional_items', + :'items', + :'additional_properties', + :'type', + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::Schema` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::Schema`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'schema') + self.schema = attributes[:'schema'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'default') + self.default = attributes[:'default'] + end + + if attributes.key?(:'multiple_of') + self.multiple_of = attributes[:'multiple_of'] + end + + if attributes.key?(:'maximum') + self.maximum = attributes[:'maximum'] + end + + if attributes.key?(:'exclusive_maximum') + self.exclusive_maximum = attributes[:'exclusive_maximum'] + else + self.exclusive_maximum = false + end + + if attributes.key?(:'minimum') + self.minimum = attributes[:'minimum'] + end + + if attributes.key?(:'exclusive_minimum') + self.exclusive_minimum = attributes[:'exclusive_minimum'] + else + self.exclusive_minimum = false + end + + if attributes.key?(:'max_length') + self.max_length = attributes[:'max_length'] + end + + if attributes.key?(:'min_length') + self.min_length = attributes[:'min_length'] + end + + if attributes.key?(:'pattern') + self.pattern = attributes[:'pattern'] + end + + if attributes.key?(:'additional_items') + self.additional_items = attributes[:'additional_items'] + end + + if attributes.key?(:'items') + self.items = attributes[:'items'] + end + + if attributes.key?(:'max_items') + self.max_items = attributes[:'max_items'] + end + + if attributes.key?(:'min_items') + self.min_items = attributes[:'min_items'] + end + + if attributes.key?(:'unique_items') + self.unique_items = attributes[:'unique_items'] + else + self.unique_items = false + end + + if attributes.key?(:'max_properties') + self.max_properties = attributes[:'max_properties'] + end + + if attributes.key?(:'min_properties') + self.min_properties = attributes[:'min_properties'] + end + + if attributes.key?(:'required') + self.required = attributes[:'required'] + end + + if attributes.key?(:'additional_properties') + self.additional_properties = attributes[:'additional_properties'] + end + + if attributes.key?(:'definitions') + if (value = attributes[:'definitions']).is_a?(Hash) + self.definitions = value + end + end + + if attributes.key?(:'properties') + if (value = attributes[:'properties']).is_a?(Hash) + self.properties = value + end + end + + if attributes.key?(:'pattern_properties') + if (value = attributes[:'pattern_properties']).is_a?(Hash) + self.pattern_properties = value + end + end + + if attributes.key?(:'dependencies') + if (value = attributes[:'dependencies']).is_a?(Hash) + self.dependencies = value + end + end + + if attributes.key?(:'enum') + if (value = attributes[:'enum']).is_a?(Array) + self.enum = value + end + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'format') + self.format = attributes[:'format'] + end + + if attributes.key?(:'all_of') + self.all_of = attributes[:'all_of'] + end + + if attributes.key?(:'any_of') + self.any_of = attributes[:'any_of'] + end + + if attributes.key?(:'one_of') + self.one_of = attributes[:'one_of'] + end + + if attributes.key?(:'_not') + self._not = attributes[:'_not'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@multiple_of.nil? && @multiple_of <= 0 + invalid_properties.push('invalid value for "multiple_of", must be greater than 0.') + end + + if !@max_length.nil? && @max_length < 0 + invalid_properties.push('invalid value for "max_length", must be greater than or equal to 0.') + end + + if !@max_items.nil? && @max_items < 0 + invalid_properties.push('invalid value for "max_items", must be greater than or equal to 0.') + end + + if !@max_properties.nil? && @max_properties < 0 + invalid_properties.push('invalid value for "max_properties", must be greater than or equal to 0.') + end + + if !@enum.nil? && @enum.length < 1 + invalid_properties.push('invalid value for "enum", number of items must be greater than or equal to 1.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@multiple_of.nil? && @multiple_of <= 0 + return false if !@max_length.nil? && @max_length < 0 + return false if !@max_items.nil? && @max_items < 0 + return false if !@max_properties.nil? && @max_properties < 0 + return false if !@enum.nil? && @enum.length < 1 + true + end + + # Custom attribute writer method with validation + # @param [Object] multiple_of Value to be assigned + def multiple_of=(multiple_of) + if !multiple_of.nil? && multiple_of <= 0 + fail ArgumentError, 'invalid value for "multiple_of", must be greater than 0.' + end + + @multiple_of = multiple_of + end + + # Custom attribute writer method with validation + # @param [Object] max_length Value to be assigned + def max_length=(max_length) + if !max_length.nil? && max_length < 0 + fail ArgumentError, 'invalid value for "max_length", must be greater than or equal to 0.' + end + + @max_length = max_length + end + + # Custom attribute writer method with validation + # @param [Object] max_items Value to be assigned + def max_items=(max_items) + if !max_items.nil? && max_items < 0 + fail ArgumentError, 'invalid value for "max_items", must be greater than or equal to 0.' + end + + @max_items = max_items + end + + # Custom attribute writer method with validation + # @param [Object] max_properties Value to be assigned + def max_properties=(max_properties) + if !max_properties.nil? && max_properties < 0 + fail ArgumentError, 'invalid value for "max_properties", must be greater than or equal to 0.' + end + + @max_properties = max_properties + end + + # Custom attribute writer method with validation + # @param [Object] enum Value to be assigned + def enum=(enum) + if !enum.nil? && enum.length < 1 + fail ArgumentError, 'invalid value for "enum", number of items must be greater than or equal to 1.' + end + + @enum = enum + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + schema == o.schema && + title == o.title && + description == o.description && + default == o.default && + multiple_of == o.multiple_of && + maximum == o.maximum && + exclusive_maximum == o.exclusive_maximum && + minimum == o.minimum && + exclusive_minimum == o.exclusive_minimum && + max_length == o.max_length && + min_length == o.min_length && + pattern == o.pattern && + additional_items == o.additional_items && + items == o.items && + max_items == o.max_items && + min_items == o.min_items && + unique_items == o.unique_items && + max_properties == o.max_properties && + min_properties == o.min_properties && + required == o.required && + additional_properties == o.additional_properties && + definitions == o.definitions && + properties == o.properties && + pattern_properties == o.pattern_properties && + dependencies == o.dependencies && + enum == o.enum && + type == o.type && + format == o.format && + all_of == o.all_of && + any_of == o.any_of && + one_of == o.one_of && + _not == o._not + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, schema, title, description, default, multiple_of, maximum, exclusive_maximum, minimum, exclusive_minimum, max_length, min_length, pattern, additional_items, items, max_items, min_items, unique_items, max_properties, min_properties, required, additional_properties, definitions, properties, pattern_properties, dependencies, enum, type, format, all_of, any_of, one_of, _not].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/mockserver-client/models/socket_address.rb b/lib/mockserver-client/models/socket_address.rb new file mode 100644 index 0000000..12a958e --- /dev/null +++ b/lib/mockserver-client/models/socket_address.rb @@ -0,0 +1,270 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module MockServer + class SocketAddress + attr_accessor :host + + attr_accessor :port + + attr_accessor :scheme + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'host' => :'host', + :'port' => :'port', + :'scheme' => :'scheme' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'host' => :'String', + :'port' => :'Integer', + :'scheme' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::SocketAddress` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::SocketAddress`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'host') + self.host = attributes[:'host'] + end + + if attributes.key?(:'port') + self.port = attributes[:'port'] + end + + if attributes.key?(:'scheme') + self.scheme = attributes[:'scheme'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + scheme_validator = EnumAttributeValidator.new('String', ["HTTP", "HTTPS"]) + return false unless scheme_validator.valid?(@scheme) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] scheme Object to be assigned + def scheme=(scheme) + validator = EnumAttributeValidator.new('String', ["HTTP", "HTTPS"]) + unless validator.valid?(scheme) + fail ArgumentError, "invalid value for \"scheme\", must be one of #{validator.allowable_values}." + end + @scheme = scheme + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + host == o.host && + port == o.port && + scheme == o.scheme + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [host, port, scheme].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/mockserver-client/models/string_or_json_schema.rb b/lib/mockserver-client/models/string_or_json_schema.rb new file mode 100644 index 0000000..2fdcc6f --- /dev/null +++ b/lib/mockserver-client/models/string_or_json_schema.rb @@ -0,0 +1,105 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module MockServer + module StringOrJsonSchema + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'String', + :'StringOrJsonSchemaOneOf' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + else # model + const = MockServer.const_get(klass) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + raise unless (data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model && model.valid? + end + end + end + + raise # if no match by now, raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" + end + end + end + +end diff --git a/lib/mockserver-client/models/string_or_json_schema_one_of.rb b/lib/mockserver-client/models/string_or_json_schema_one_of.rb new file mode 100644 index 0000000..a8fba67 --- /dev/null +++ b/lib/mockserver-client/models/string_or_json_schema_one_of.rb @@ -0,0 +1,288 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'date' +require 'time' + +module MockServer + class StringOrJsonSchemaOneOf + attr_accessor :_not + + attr_accessor :optional + + attr_accessor :value + + attr_accessor :schema + + attr_accessor :parameter_style + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'_not' => :'not', + :'optional' => :'optional', + :'value' => :'value', + :'schema' => :'schema', + :'parameter_style' => :'parameterStyle' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'_not' => :'Boolean', + :'optional' => :'Boolean', + :'value' => :'String', + :'schema' => :'Object', + :'parameter_style' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::StringOrJsonSchemaOneOf` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::StringOrJsonSchemaOneOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'_not') + self._not = attributes[:'_not'] + end + + if attributes.key?(:'optional') + self.optional = attributes[:'optional'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + + if attributes.key?(:'schema') + self.schema = attributes[:'schema'] + end + + if attributes.key?(:'parameter_style') + self.parameter_style = attributes[:'parameter_style'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + parameter_style_validator = EnumAttributeValidator.new('String', ["SIMPLE", "SIMPLE_EXPLODED", "LABEL", "LABEL_EXPLODED", "MATRIX", "MATRIX_EXPLODED", "FORM_EXPLODED", "FORM", "SPACE_DELIMITED_EXPLODED", "SPACE_DELIMITED", "PIPE_DELIMITED_EXPLODED", "PIPE_DELIMITED", "DEEP_OBJECT"]) + return false unless parameter_style_validator.valid?(@parameter_style) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] parameter_style Object to be assigned + def parameter_style=(parameter_style) + validator = EnumAttributeValidator.new('String', ["SIMPLE", "SIMPLE_EXPLODED", "LABEL", "LABEL_EXPLODED", "MATRIX", "MATRIX_EXPLODED", "FORM_EXPLODED", "FORM", "SPACE_DELIMITED_EXPLODED", "SPACE_DELIMITED", "PIPE_DELIMITED_EXPLODED", "PIPE_DELIMITED", "DEEP_OBJECT"]) + unless validator.valid?(parameter_style) + fail ArgumentError, "invalid value for \"parameter_style\", must be one of #{validator.allowable_values}." + end + @parameter_style = parameter_style + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _not == o._not && + optional == o.optional && + value == o.value && + schema == o.schema && + parameter_style == o.parameter_style + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [_not, optional, value, schema, parameter_style].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/mockserver-client/models/time_to_live.rb b/lib/mockserver-client/models/time_to_live.rb index 2223f05..2dfba6a 100644 --- a/lib/mockserver-client/models/time_to_live.rb +++ b/lib/mockserver-client/models/time_to_live.rb @@ -1,16 +1,17 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end require 'date' +require 'time' module MockServer class TimeToLive @@ -51,32 +52,50 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. def self.openapi_types { :'time_unit' => :'String', :'time_to_live' => :'Integer', - :'unlimited' => :'BOOLEAN' + :'unlimited' => :'Boolean' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::TimeToLive` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::TimeToLive`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'timeUnit') - self.time_unit = attributes[:'timeUnit'] + if attributes.key?(:'time_unit') + self.time_unit = attributes[:'time_unit'] end - if attributes.has_key?(:'timeToLive') - self.time_to_live = attributes[:'timeToLive'] + if attributes.key?(:'time_to_live') + self.time_to_live = attributes[:'time_to_live'] end - if attributes.has_key?(:'unlimited') + if attributes.key?(:'unlimited') self.unlimited = attributes[:'unlimited'] end end @@ -91,7 +110,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - time_unit_validator = EnumAttributeValidator.new('String', ['HOURS', 'MINUTES', 'SECONDS', 'MILLISECONDS', 'MICROSECONDS', 'NANOSECONDS']) + time_unit_validator = EnumAttributeValidator.new('String', ["DAYS", "HOURS", "MINUTES", "SECONDS", "MILLISECONDS", "MICROSECONDS", "NANOSECONDS"]) return false unless time_unit_validator.valid?(@time_unit) true end @@ -99,9 +118,9 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] time_unit Object to be assigned def time_unit=(time_unit) - validator = EnumAttributeValidator.new('String', ['HOURS', 'MINUTES', 'SECONDS', 'MILLISECONDS', 'MICROSECONDS', 'NANOSECONDS']) + validator = EnumAttributeValidator.new('String', ["DAYS", "HOURS", "MINUTES", "SECONDS", "MILLISECONDS", "MICROSECONDS", "NANOSECONDS"]) unless validator.valid?(time_unit) - fail ArgumentError, 'invalid value for "time_unit", must be one of #{validator.allowable_values}.' + fail ArgumentError, "invalid value for \"time_unit\", must be one of #{validator.allowable_values}." end @time_unit = time_unit end @@ -123,26 +142,35 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [time_unit, time_to_live, unlimited].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -154,8 +182,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -164,7 +192,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -185,8 +213,9 @@ def _deserialize(type, value) end end else # model - temp_model = MockServer.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -208,7 +237,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -231,5 +264,7 @@ def _to_hash(value) value end end + end + end diff --git a/lib/mockserver-client/models/times.rb b/lib/mockserver-client/models/times.rb index cd8aa19..36994f1 100644 --- a/lib/mockserver-client/models/times.rb +++ b/lib/mockserver-client/models/times.rb @@ -1,16 +1,17 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end require 'date' +require 'time' module MockServer class Times @@ -26,27 +27,45 @@ def self.attribute_map } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. def self.openapi_types { :'remaining_times' => :'Integer', - :'unlimited' => :'BOOLEAN' + :'unlimited' => :'Boolean' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::Times` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::Times`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'remainingTimes') - self.remaining_times = attributes[:'remainingTimes'] + if attributes.key?(:'remaining_times') + self.remaining_times = attributes[:'remaining_times'] end - if attributes.has_key?(:'unlimited') + if attributes.key?(:'unlimited') self.unlimited = attributes[:'unlimited'] end end @@ -80,26 +99,35 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash [remaining_times, unlimited].hash end + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -111,8 +139,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -121,7 +149,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -142,8 +170,9 @@ def _deserialize(type, value) end end else # model - temp_model = MockServer.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -165,7 +194,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -188,5 +221,7 @@ def _to_hash(value) value end end + end + end diff --git a/lib/mockserver-client/models/verification.rb b/lib/mockserver-client/models/verification.rb index 07c24e9..63dd4bb 100644 --- a/lib/mockserver-client/models/verification.rb +++ b/lib/mockserver-client/models/verification.rb @@ -1,192 +1,105 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end require 'date' +require 'time' module MockServer - class Verification - attr_accessor :http_request - - attr_accessor :times - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'http_request' => :'httpRequest', - :'times' => :'times' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'http_request' => :'HttpRequest', - :'times' => :'VerificationTimes' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - return unless attributes.is_a?(Hash) - - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - - if attributes.has_key?(:'httpRequest') - self.http_request = attributes[:'httpRequest'] - end - - if attributes.has_key?(:'times') - self.times = attributes[:'times'] + # verification + module Verification + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Object' + ] end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - http_request == o.http_request && - times == o.times - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code - def hash - [http_request, times].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :BOOLEAN - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises end end - else # model - temp_model = MockServer.const_get(type).new - temp_model.build_from_hash(value) - end - end - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) + openapi_one_of.include?(:AnyType) ? data : nil end - hash - end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + else # model + const = MockServer.const_get(klass) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + raise unless (data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model && model.valid? + end + end end - elsif value.respond_to? :to_hash - value.to_hash - else - value + + raise # if no match by now, raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" end end end + end diff --git a/lib/mockserver-client/models/verification_sequence.rb b/lib/mockserver-client/models/verification_sequence.rb index 1022966..d67d6b7 100644 --- a/lib/mockserver-client/models/verification_sequence.rb +++ b/lib/mockserver-client/models/verification_sequence.rb @@ -1,185 +1,105 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end require 'date' +require 'time' module MockServer - class VerificationSequence - attr_accessor :http_requests - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'http_requests' => :'httpRequests' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'http_requests' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - return unless attributes.is_a?(Hash) - - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - - if attributes.has_key?(:'httpRequests') - if (value = attributes[:'httpRequests']).is_a?(Array) - self.http_requests = value - end + # verification sequence + module VerificationSequence + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Object' + ] end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - http_requests == o.http_requests - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code - def hash - [http_requests].hash - end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :BOOLEAN - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - temp_model = MockServer.const_get(type).new - temp_model.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) + openapi_one_of.include?(:AnyType) ? data : nil end - hash - end - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + else # model + const = MockServer.const_get(klass) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + raise unless (data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model && model.valid? + end + end end - elsif value.respond_to? :to_hash - value.to_hash - else - value + + raise # if no match by now, raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" end end end + end diff --git a/lib/mockserver-client/models/verification_times.rb b/lib/mockserver-client/models/verification_times.rb index 074bfc4..7417cc2 100644 --- a/lib/mockserver-client/models/verification_times.rb +++ b/lib/mockserver-client/models/verification_times.rb @@ -1,53 +1,73 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end require 'date' +require 'time' module MockServer + # number of request to verify class VerificationTimes - attr_accessor :count + attr_accessor :at_least - attr_accessor :exact + attr_accessor :at_most # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'count' => :'count', - :'exact' => :'exact' + :'at_least' => :'atLeast', + :'at_most' => :'atMost' } end + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + # Attribute type mapping. def self.openapi_types { - :'count' => :'Integer', - :'exact' => :'BOOLEAN' + :'at_least' => :'Integer', + :'at_most' => :'Integer' } end + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - return unless attributes.is_a?(Hash) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `MockServer::VerificationTimes` initialize method" + end - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `MockServer::VerificationTimes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } - if attributes.has_key?(:'count') - self.count = attributes[:'count'] + if attributes.key?(:'at_least') + self.at_least = attributes[:'at_least'] end - if attributes.has_key?(:'exact') - self.exact = attributes[:'exact'] + if attributes.key?(:'at_most') + self.at_most = attributes[:'at_most'] end end @@ -69,8 +89,8 @@ def valid? def ==(o) return true if self.equal?(o) self.class == o.class && - count == o.count && - exact == o.exact + at_least == o.at_least && + at_most == o.at_most end # @see the `==` method @@ -80,9 +100,16 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code + # @return [Integer] Hash code def hash - [count, exact].hash + [at_least, at_most].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) end # Builds the object from hash @@ -91,15 +118,17 @@ def hash def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional + end end self @@ -111,8 +140,8 @@ def build_from_hash(attributes) # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym - when :DateTime - DateTime.parse(value) + when :Time + Time.parse(value) when :Date Date.parse(value) when :String @@ -121,7 +150,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :BOOLEAN + when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -142,8 +171,9 @@ def _deserialize(type, value) end end else # model - temp_model = MockServer.const_get(type).new - temp_model.build_from_hash(value) + # models (e.g. Pet) or oneOf + klass = MockServer.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end @@ -165,7 +195,11 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - next if value.nil? + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + hash[param] = _to_hash(value) end hash @@ -188,5 +222,7 @@ def _to_hash(value) value end end + end + end diff --git a/lib/mockserver-client/version.rb b/lib/mockserver-client/version.rb index 9afb2f3..e8fcb62 100644 --- a/lib/mockserver-client/version.rb +++ b/lib/mockserver-client/version.rb @@ -1,15 +1,15 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end module MockServer - VERSION = '5.3.1' + VERSION = '5.13.2' end diff --git a/mockserver-client.gemspec b/mockserver-client.gemspec index 5a1a245..3c245c3 100644 --- a/mockserver-client.gemspec +++ b/mockserver-client.gemspec @@ -1,14 +1,14 @@ # -*- encoding: utf-8 -*- =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -19,24 +19,17 @@ Gem::Specification.new do |s| s.name = "mockserver-client" s.version = MockServer::VERSION s.platform = Gem::Platform::RUBY - s.authors = ["James D Bloom"] - s.email = ["jamesdbloom@gmail.com"] - s.homepage = "https://www.mock-server.com" - s.summary = "Mock Server API Ruby Gem" + s.authors = ["OpenAPI-Generator"] + s.email = [""] + s.homepage = "https://openapi-generator.tech" + s.summary = "MockServer API Ruby Gem" s.description = "MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test." - s.license = 'Apache-2.0' - s.required_ruby_version = ">= 2.0" + s.license = "Unlicense" + s.required_ruby_version = ">= 2.4" s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' - s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' - s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1' - s.add_development_dependency 'webmock', '~> 1.24', '>= 1.24.3' - s.add_development_dependency 'autotest', '~> 4.4', '>= 4.4.6' - s.add_development_dependency 'autotest-rails-pure', '~> 4.1', '>= 4.1.2' - s.add_development_dependency 'autotest-growl', '~> 0.2', '>= 0.2.16' - s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.12' s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } s.test_files = `find spec/*`.split("\n") diff --git a/spec/api/control_api_spec.rb b/spec/api/control_api_spec.rb index 1cd7921..f2b7336 100644 --- a/spec/api/control_api_spec.rb +++ b/spec/api/control_api_spec.rb @@ -1,12 +1,12 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -19,7 +19,7 @@ describe 'ControlApi' do before do # run before each test - @instance = MockServer::ControlApi.new + @api_instance = MockServer::ControlApi.new end after do @@ -28,72 +28,72 @@ describe 'test an instance of ControlApi' do it 'should create an instance of ControlApi' do - expect(@instance).to be_instance_of(MockServer::ControlApi) + expect(@api_instance).to be_instance_of(MockServer::ControlApi) end end - # unit tests for bind_put + # unit tests for mockserver_bind_put # bind additional listening ports # only supported on Netty version # @param ports list of ports to bind to, where 0 indicates dynamically bind to any available port # @param [Hash] opts the optional parameters # @return [Ports] - describe 'bind_put test' do + describe 'mockserver_bind_put test' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end - # unit tests for clear_put + # unit tests for mockserver_clear_put # clears expectations and recorded requests that match the request matcher # @param [Hash] opts the optional parameters - # @option opts [HttpRequest] :http_request request used to match expectations and recored requests to clear + # @option opts [UNKNOWN_BASE_TYPE] :unknown_base_type request used to match expectations and recored requests to clear # @return [nil] - describe 'clear_put test' do + describe 'mockserver_clear_put test' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end - # unit tests for reset_put + # unit tests for mockserver_reset_put # clears all expectations and recorded requests # @param [Hash] opts the optional parameters # @return [nil] - describe 'reset_put test' do + describe 'mockserver_reset_put test' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end - # unit tests for retrieve_put + # unit tests for mockserver_retrieve_put # retrieve recorded requests, active expectations, recorded expectations or log messages # @param [Hash] opts the optional parameters - # @option opts [String] :format changes response format, default if not specificed is \"json\", supported values are \"java\", \"json\" + # @option opts [String] :format changes response format, default if not specificed is \"json\", supported values are \"java\", \"json\", \"log_entries\" # @option opts [String] :type specifies the type of object that is retrieve, default if not specified is \"requests\", supported values are \"logs\", \"requests\", \"recorded_expectations\", \"active_expectations\" - # @option opts [HttpRequest] :http_request request used to match which recorded requests, expectations or log messages to return, an empty body matches all requests, expectations or log messages - # @return [Object] - describe 'retrieve_put test' do + # @option opts [RequestDefinition] :request_definition request used to match which recorded requests, expectations or log messages to return, an empty body matches all requests, expectations or log messages + # @return [OneOfarrayarray] + describe 'mockserver_retrieve_put test' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end - # unit tests for status_put + # unit tests for mockserver_status_put # return listening ports # @param [Hash] opts the optional parameters # @return [Ports] - describe 'status_put test' do + describe 'mockserver_status_put test' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end - # unit tests for stop_put + # unit tests for mockserver_stop_put # stop running process # only supported on Netty version # @param [Hash] opts the optional parameters # @return [nil] - describe 'stop_put test' do + describe 'mockserver_stop_put test' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end diff --git a/spec/api/expectation_api_spec.rb b/spec/api/expectation_api_spec.rb index 00c640e..256598b 100644 --- a/spec/api/expectation_api_spec.rb +++ b/spec/api/expectation_api_spec.rb @@ -1,12 +1,12 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -19,7 +19,7 @@ describe 'ExpectationApi' do before do # run before each test - @instance = MockServer::ExpectationApi.new + @api_instance = MockServer::ExpectationApi.new end after do @@ -28,16 +28,27 @@ describe 'test an instance of ExpectationApi' do it 'should create an instance of ExpectationApi' do - expect(@instance).to be_instance_of(MockServer::ExpectationApi) + expect(@api_instance).to be_instance_of(MockServer::ExpectationApi) end end - # unit tests for expectation_put + # unit tests for mockserver_expectation_put # create expectation - # @param expectations expectation to create + # @param expectations expectation(s) to create # @param [Hash] opts the optional parameters - # @return [nil] - describe 'expectation_put test' do + # @return [Array] + describe 'mockserver_expectation_put test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for mockserver_openapi_put + # create expectations from OpenAPI or Swagger + # @param open_api_expectations expectation(s) to create + # @param [Hash] opts the optional parameters + # @return [Array] + describe 'mockserver_openapi_put test' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end diff --git a/spec/api/verify_api_spec.rb b/spec/api/verify_api_spec.rb index 52a86e5..60d736e 100644 --- a/spec/api/verify_api_spec.rb +++ b/spec/api/verify_api_spec.rb @@ -1,12 +1,12 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -19,7 +19,7 @@ describe 'VerifyApi' do before do # run before each test - @instance = MockServer::VerifyApi.new + @api_instance = MockServer::VerifyApi.new end after do @@ -28,27 +28,27 @@ describe 'test an instance of VerifyApi' do it 'should create an instance of VerifyApi' do - expect(@instance).to be_instance_of(MockServer::VerifyApi) + expect(@api_instance).to be_instance_of(MockServer::VerifyApi) end end - # unit tests for verify_put + # unit tests for mockserver_verify_put # verify a request has been received a specific number of times # @param verification request matcher and the number of times to match # @param [Hash] opts the optional parameters # @return [nil] - describe 'verify_put test' do + describe 'mockserver_verify_put test' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end - # unit tests for verify_sequence_put + # unit tests for mockserver_verify_sequence_put # verify a sequence of request has been received in the specific order # @param verification_sequence the sequence of requests matchers # @param [Hash] opts the optional parameters # @return [nil] - describe 'verify_sequence_put test' do + describe 'mockserver_verify_sequence_put test' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end diff --git a/spec/api_client_spec.rb b/spec/api_client_spec.rb index 06b9ffb..376813d 100644 --- a/spec/api_client_spec.rb +++ b/spec/api_client_spec.rb @@ -1,12 +1,12 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -156,7 +156,7 @@ end it 'fails for invalid collection format' do - expect(proc { api_client.build_collection_param(param, :INVALID) }).to raise_error(RuntimeError, 'unknown collection format: :INVALID') + expect { api_client.build_collection_param(param, :INVALID) }.to raise_error(RuntimeError, 'unknown collection format: :INVALID') end end @@ -197,8 +197,8 @@ let(:api_client) { MockServer::ApiClient.new } it 'works' do - expect(api_client.select_header_content_type(nil)).to eq('application/json') - expect(api_client.select_header_content_type([])).to eq('application/json') + expect(api_client.select_header_content_type(nil)).to be_nil + expect(api_client.select_header_content_type([])).to be_nil expect(api_client.select_header_content_type(['application/json'])).to eq('application/json') expect(api_client.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8') diff --git a/spec/configuration_spec.rb b/spec/configuration_spec.rb index 3558256..90e571a 100644 --- a/spec/configuration_spec.rb +++ b/spec/configuration_spec.rb @@ -1,12 +1,12 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end diff --git a/spec/models/body_any_of1_spec.rb b/spec/models/body_any_of1_spec.rb new file mode 100644 index 0000000..1177720 --- /dev/null +++ b/spec/models/body_any_of1_spec.rb @@ -0,0 +1,66 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for MockServer::BodyAnyOf1 +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe MockServer::BodyAnyOf1 do + let(:instance) { MockServer::BodyAnyOf1.new } + + describe 'test an instance of BodyAnyOf1' do + it 'should create an instance of BodyAnyOf1' do + expect(instance).to be_instance_of(MockServer::BodyAnyOf1) + end + end + describe 'test attribute "_not"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["JSON"]) + # validator.allowable_values.each do |value| + # expect { instance.type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "json"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "content_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "match_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["STRICT", "ONLY_MATCHING_FIELDS"]) + # validator.allowable_values.each do |value| + # expect { instance.match_type = value }.not_to raise_error + # end + end + end + +end diff --git a/spec/models/body_any_of2_spec.rb b/spec/models/body_any_of2_spec.rb new file mode 100644 index 0000000..20d4ee4 --- /dev/null +++ b/spec/models/body_any_of2_spec.rb @@ -0,0 +1,50 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for MockServer::BodyAnyOf2 +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe MockServer::BodyAnyOf2 do + let(:instance) { MockServer::BodyAnyOf2.new } + + describe 'test an instance of BodyAnyOf2' do + it 'should create an instance of BodyAnyOf2' do + expect(instance).to be_instance_of(MockServer::BodyAnyOf2) + end + end + describe 'test attribute "_not"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["JSON_SCHEMA"]) + # validator.allowable_values.each do |value| + # expect { instance.type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "json_schema"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/body_any_of3_spec.rb b/spec/models/body_any_of3_spec.rb new file mode 100644 index 0000000..7bb5cb3 --- /dev/null +++ b/spec/models/body_any_of3_spec.rb @@ -0,0 +1,50 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for MockServer::BodyAnyOf3 +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe MockServer::BodyAnyOf3 do + let(:instance) { MockServer::BodyAnyOf3.new } + + describe 'test an instance of BodyAnyOf3' do + it 'should create an instance of BodyAnyOf3' do + expect(instance).to be_instance_of(MockServer::BodyAnyOf3) + end + end + describe 'test attribute "_not"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["JSON_PATH"]) + # validator.allowable_values.each do |value| + # expect { instance.type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "json_path"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/body_any_of4_spec.rb b/spec/models/body_any_of4_spec.rb new file mode 100644 index 0000000..27e822a --- /dev/null +++ b/spec/models/body_any_of4_spec.rb @@ -0,0 +1,50 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for MockServer::BodyAnyOf4 +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe MockServer::BodyAnyOf4 do + let(:instance) { MockServer::BodyAnyOf4.new } + + describe 'test an instance of BodyAnyOf4' do + it 'should create an instance of BodyAnyOf4' do + expect(instance).to be_instance_of(MockServer::BodyAnyOf4) + end + end + describe 'test attribute "_not"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["PARAMETERS"]) + # validator.allowable_values.each do |value| + # expect { instance.type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "parameters"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/body_any_of5_spec.rb b/spec/models/body_any_of5_spec.rb new file mode 100644 index 0000000..c94fa1b --- /dev/null +++ b/spec/models/body_any_of5_spec.rb @@ -0,0 +1,50 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for MockServer::BodyAnyOf5 +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe MockServer::BodyAnyOf5 do + let(:instance) { MockServer::BodyAnyOf5.new } + + describe 'test an instance of BodyAnyOf5' do + it 'should create an instance of BodyAnyOf5' do + expect(instance).to be_instance_of(MockServer::BodyAnyOf5) + end + end + describe 'test attribute "_not"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["REGEX"]) + # validator.allowable_values.each do |value| + # expect { instance.type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "regex"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/body_any_of6_spec.rb b/spec/models/body_any_of6_spec.rb new file mode 100644 index 0000000..947862e --- /dev/null +++ b/spec/models/body_any_of6_spec.rb @@ -0,0 +1,62 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for MockServer::BodyAnyOf6 +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe MockServer::BodyAnyOf6 do + let(:instance) { MockServer::BodyAnyOf6.new } + + describe 'test an instance of BodyAnyOf6' do + it 'should create an instance of BodyAnyOf6' do + expect(instance).to be_instance_of(MockServer::BodyAnyOf6) + end + end + describe 'test attribute "_not"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["STRING"]) + # validator.allowable_values.each do |value| + # expect { instance.type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "string"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "content_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "sub_string"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/body_any_of7_spec.rb b/spec/models/body_any_of7_spec.rb new file mode 100644 index 0000000..d54ff20 --- /dev/null +++ b/spec/models/body_any_of7_spec.rb @@ -0,0 +1,56 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for MockServer::BodyAnyOf7 +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe MockServer::BodyAnyOf7 do + let(:instance) { MockServer::BodyAnyOf7.new } + + describe 'test an instance of BodyAnyOf7' do + it 'should create an instance of BodyAnyOf7' do + expect(instance).to be_instance_of(MockServer::BodyAnyOf7) + end + end + describe 'test attribute "_not"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["XML"]) + # validator.allowable_values.each do |value| + # expect { instance.type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "xml"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "content_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/body_any_of8_spec.rb b/spec/models/body_any_of8_spec.rb new file mode 100644 index 0000000..95bd942 --- /dev/null +++ b/spec/models/body_any_of8_spec.rb @@ -0,0 +1,50 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for MockServer::BodyAnyOf8 +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe MockServer::BodyAnyOf8 do + let(:instance) { MockServer::BodyAnyOf8.new } + + describe 'test an instance of BodyAnyOf8' do + it 'should create an instance of BodyAnyOf8' do + expect(instance).to be_instance_of(MockServer::BodyAnyOf8) + end + end + describe 'test attribute "_not"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["XML_SCHEMA"]) + # validator.allowable_values.each do |value| + # expect { instance.type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "xml_schema"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/body_any_of9_spec.rb b/spec/models/body_any_of9_spec.rb new file mode 100644 index 0000000..eab244e --- /dev/null +++ b/spec/models/body_any_of9_spec.rb @@ -0,0 +1,50 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for MockServer::BodyAnyOf9 +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe MockServer::BodyAnyOf9 do + let(:instance) { MockServer::BodyAnyOf9.new } + + describe 'test an instance of BodyAnyOf9' do + it 'should create an instance of BodyAnyOf9' do + expect(instance).to be_instance_of(MockServer::BodyAnyOf9) + end + end + describe 'test attribute "_not"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["XPATH"]) + # validator.allowable_values.each do |value| + # expect { instance.type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "xpath"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/body_any_of_spec.rb b/spec/models/body_any_of_spec.rb new file mode 100644 index 0000000..72341ed --- /dev/null +++ b/spec/models/body_any_of_spec.rb @@ -0,0 +1,56 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for MockServer::BodyAnyOf +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe MockServer::BodyAnyOf do + let(:instance) { MockServer::BodyAnyOf.new } + + describe 'test an instance of BodyAnyOf' do + it 'should create an instance of BodyAnyOf' do + expect(instance).to be_instance_of(MockServer::BodyAnyOf) + end + end + describe 'test attribute "_not"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["BINARY"]) + # validator.allowable_values.each do |value| + # expect { instance.type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "base64_bytes"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "content_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/body_spec.rb b/spec/models/body_spec.rb index b7b9a74..3b1d831 100644 --- a/spec/models/body_spec.rb +++ b/spec/models/body_spec.rb @@ -1,12 +1,12 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -17,19 +17,110 @@ # Unit tests for MockServer::Body # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'Body' do - before do - # run before each test - @instance = MockServer::Body.new +describe MockServer::Body do + let(:instance) { MockServer::Body.new } + + describe 'test an instance of Body' do + it 'should create an instance of Body' do + expect(instance).to be_instance_of(MockServer::Body) + end + end + describe 'test attribute "_not"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end end - after do - # run after each test + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["XPATH"]) + # validator.allowable_values.each do |value| + # expect { instance.type = value }.not_to raise_error + # end + end end - describe 'test an instance of Body' do - it 'should create an instance of Body' do - expect(@instance).to be_instance_of(MockServer::Body) + describe 'test attribute "base64_bytes"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "content_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "json"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "match_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["STRICT", "ONLY_MATCHING_FIELDS"]) + # validator.allowable_values.each do |value| + # expect { instance.match_type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "json_schema"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "json_path"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "parameters"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "regex"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "string"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end + + describe 'test attribute "sub_string"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "xml"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "xml_schema"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "xpath"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + end diff --git a/spec/models/body_with_content_type_any_of1_spec.rb b/spec/models/body_with_content_type_any_of1_spec.rb new file mode 100644 index 0000000..afde20f --- /dev/null +++ b/spec/models/body_with_content_type_any_of1_spec.rb @@ -0,0 +1,56 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for MockServer::BodyWithContentTypeAnyOf1 +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe MockServer::BodyWithContentTypeAnyOf1 do + let(:instance) { MockServer::BodyWithContentTypeAnyOf1.new } + + describe 'test an instance of BodyWithContentTypeAnyOf1' do + it 'should create an instance of BodyWithContentTypeAnyOf1' do + expect(instance).to be_instance_of(MockServer::BodyWithContentTypeAnyOf1) + end + end + describe 'test attribute "_not"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["JSON"]) + # validator.allowable_values.each do |value| + # expect { instance.type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "json"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "content_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/body_with_content_type_any_of2_spec.rb b/spec/models/body_with_content_type_any_of2_spec.rb new file mode 100644 index 0000000..3bd364f --- /dev/null +++ b/spec/models/body_with_content_type_any_of2_spec.rb @@ -0,0 +1,56 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for MockServer::BodyWithContentTypeAnyOf2 +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe MockServer::BodyWithContentTypeAnyOf2 do + let(:instance) { MockServer::BodyWithContentTypeAnyOf2.new } + + describe 'test an instance of BodyWithContentTypeAnyOf2' do + it 'should create an instance of BodyWithContentTypeAnyOf2' do + expect(instance).to be_instance_of(MockServer::BodyWithContentTypeAnyOf2) + end + end + describe 'test attribute "_not"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["STRING"]) + # validator.allowable_values.each do |value| + # expect { instance.type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "string"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "content_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/body_with_content_type_any_of3_spec.rb b/spec/models/body_with_content_type_any_of3_spec.rb new file mode 100644 index 0000000..8fb8be9 --- /dev/null +++ b/spec/models/body_with_content_type_any_of3_spec.rb @@ -0,0 +1,56 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for MockServer::BodyWithContentTypeAnyOf3 +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe MockServer::BodyWithContentTypeAnyOf3 do + let(:instance) { MockServer::BodyWithContentTypeAnyOf3.new } + + describe 'test an instance of BodyWithContentTypeAnyOf3' do + it 'should create an instance of BodyWithContentTypeAnyOf3' do + expect(instance).to be_instance_of(MockServer::BodyWithContentTypeAnyOf3) + end + end + describe 'test attribute "_not"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["XML"]) + # validator.allowable_values.each do |value| + # expect { instance.type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "xml"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "content_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/body_with_content_type_any_of_spec.rb b/spec/models/body_with_content_type_any_of_spec.rb new file mode 100644 index 0000000..f06ad4e --- /dev/null +++ b/spec/models/body_with_content_type_any_of_spec.rb @@ -0,0 +1,56 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for MockServer::BodyWithContentTypeAnyOf +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe MockServer::BodyWithContentTypeAnyOf do + let(:instance) { MockServer::BodyWithContentTypeAnyOf.new } + + describe 'test an instance of BodyWithContentTypeAnyOf' do + it 'should create an instance of BodyWithContentTypeAnyOf' do + expect(instance).to be_instance_of(MockServer::BodyWithContentTypeAnyOf) + end + end + describe 'test attribute "_not"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["BINARY"]) + # validator.allowable_values.each do |value| + # expect { instance.type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "base64_bytes"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "content_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/body_with_content_type_spec.rb b/spec/models/body_with_content_type_spec.rb index 7c60b3f..61c5f9a 100644 --- a/spec/models/body_with_content_type_spec.rb +++ b/spec/models/body_with_content_type_spec.rb @@ -1,12 +1,12 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -17,19 +17,58 @@ # Unit tests for MockServer::BodyWithContentType # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'BodyWithContentType' do - before do - # run before each test - @instance = MockServer::BodyWithContentType.new +describe MockServer::BodyWithContentType do + let(:instance) { MockServer::BodyWithContentType.new } + + describe 'test an instance of BodyWithContentType' do + it 'should create an instance of BodyWithContentType' do + expect(instance).to be_instance_of(MockServer::BodyWithContentType) + end + end + describe 'test attribute "_not"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end end - after do - # run after each test + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["XML"]) + # validator.allowable_values.each do |value| + # expect { instance.type = value }.not_to raise_error + # end + end end - describe 'test an instance of BodyWithContentType' do - it 'should create an instance of BodyWithContentType' do - expect(@instance).to be_instance_of(MockServer::BodyWithContentType) + describe 'test attribute "base64_bytes"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "content_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "json"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end + + describe 'test attribute "string"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "xml"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + end diff --git a/spec/models/connection_options_spec.rb b/spec/models/connection_options_spec.rb index 8f88c06..c7911fd 100644 --- a/spec/models/connection_options_spec.rb +++ b/spec/models/connection_options_spec.rb @@ -1,12 +1,12 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -17,22 +17,15 @@ # Unit tests for MockServer::ConnectionOptions # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'ConnectionOptions' do - before do - # run before each test - @instance = MockServer::ConnectionOptions.new - end - - after do - # run after each test - end +describe MockServer::ConnectionOptions do + let(:instance) { MockServer::ConnectionOptions.new } describe 'test an instance of ConnectionOptions' do it 'should create an instance of ConnectionOptions' do - expect(@instance).to be_instance_of(MockServer::ConnectionOptions) + expect(instance).to be_instance_of(MockServer::ConnectionOptions) end end - describe 'test attribute "close_socket"' do + describe 'test attribute "suppress_content_length_header"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end @@ -44,13 +37,13 @@ end end - describe 'test attribute "suppress_content_length_header"' do + describe 'test attribute "suppress_connection_header"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end - describe 'test attribute "suppress_connection_header"' do + describe 'test attribute "chunk_size"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end @@ -62,4 +55,16 @@ end end + describe 'test attribute "close_socket"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "close_socket_delay"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + end diff --git a/spec/models/delay_spec.rb b/spec/models/delay_spec.rb index a3c7ed6..26867d9 100644 --- a/spec/models/delay_spec.rb +++ b/spec/models/delay_spec.rb @@ -1,12 +1,12 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -17,19 +17,12 @@ # Unit tests for MockServer::Delay # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'Delay' do - before do - # run before each test - @instance = MockServer::Delay.new - end - - after do - # run after each test - end +describe MockServer::Delay do + let(:instance) { MockServer::Delay.new } describe 'test an instance of Delay' do it 'should create an instance of Delay' do - expect(@instance).to be_instance_of(MockServer::Delay) + expect(instance).to be_instance_of(MockServer::Delay) end end describe 'test attribute "time_unit"' do diff --git a/spec/models/expectation_id_spec.rb b/spec/models/expectation_id_spec.rb new file mode 100644 index 0000000..5d4445e --- /dev/null +++ b/spec/models/expectation_id_spec.rb @@ -0,0 +1,34 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for MockServer::ExpectationId +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe MockServer::ExpectationId do + let(:instance) { MockServer::ExpectationId.new } + + describe 'test an instance of ExpectationId' do + it 'should create an instance of ExpectationId' do + expect(instance).to be_instance_of(MockServer::ExpectationId) + end + end + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/expectation_spec.rb b/spec/models/expectation_spec.rb index b3f732c..a7a72bf 100644 --- a/spec/models/expectation_spec.rb +++ b/spec/models/expectation_spec.rb @@ -1,12 +1,12 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -17,19 +17,15 @@ # Unit tests for MockServer::Expectation # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'Expectation' do - before do - # run before each test - @instance = MockServer::Expectation.new - end - - after do - # run after each test +describe MockServer::Expectation do + describe '.openapi_one_of' do + it 'lists the items referenced in the oneOf array' do + expect(described_class.openapi_one_of).to_not be_empty + end end - describe 'test an instance of Expectation' do - it 'should create an instance of Expectation' do - expect(@instance).to be_instance_of(MockServer::Expectation) + describe '.build' do + it 'returns the correct model' do end end end diff --git a/spec/models/expectations_spec.rb b/spec/models/expectations_spec.rb index 2677a59..fde967b 100644 --- a/spec/models/expectations_spec.rb +++ b/spec/models/expectations_spec.rb @@ -1,12 +1,12 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -17,19 +17,15 @@ # Unit tests for MockServer::Expectations # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'Expectations' do - before do - # run before each test - @instance = MockServer::Expectations.new - end - - after do - # run after each test +describe MockServer::Expectations do + describe '.openapi_one_of' do + it 'lists the items referenced in the oneOf array' do + expect(described_class.openapi_one_of).to_not be_empty + end end - describe 'test an instance of Expectations' do - it 'should create an instance of Expectations' do - expect(@instance).to be_instance_of(MockServer::Expectations) + describe '.build' do + it 'returns the correct model' do end end end diff --git a/spec/models/http_class_callback_spec.rb b/spec/models/http_class_callback_spec.rb index b5e568a..991666b 100644 --- a/spec/models/http_class_callback_spec.rb +++ b/spec/models/http_class_callback_spec.rb @@ -1,12 +1,12 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -17,21 +17,20 @@ # Unit tests for MockServer::HttpClassCallback # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'HttpClassCallback' do - before do - # run before each test - @instance = MockServer::HttpClassCallback.new - end - - after do - # run after each test - end +describe MockServer::HttpClassCallback do + let(:instance) { MockServer::HttpClassCallback.new } describe 'test an instance of HttpClassCallback' do it 'should create an instance of HttpClassCallback' do - expect(@instance).to be_instance_of(MockServer::HttpClassCallback) + expect(instance).to be_instance_of(MockServer::HttpClassCallback) + end + end + describe 'test attribute "delay"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end + describe 'test attribute "callback_class"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers diff --git a/spec/models/http_error_spec.rb b/spec/models/http_error_spec.rb index d9f7e52..f44d8b8 100644 --- a/spec/models/http_error_spec.rb +++ b/spec/models/http_error_spec.rb @@ -1,12 +1,12 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -17,19 +17,12 @@ # Unit tests for MockServer::HttpError # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'HttpError' do - before do - # run before each test - @instance = MockServer::HttpError.new - end - - after do - # run after each test - end +describe MockServer::HttpError do + let(:instance) { MockServer::HttpError.new } describe 'test an instance of HttpError' do it 'should create an instance of HttpError' do - expect(@instance).to be_instance_of(MockServer::HttpError) + expect(instance).to be_instance_of(MockServer::HttpError) end end describe 'test attribute "delay"' do diff --git a/spec/models/http_forward_spec.rb b/spec/models/http_forward_spec.rb index fcc5634..80db685 100644 --- a/spec/models/http_forward_spec.rb +++ b/spec/models/http_forward_spec.rb @@ -1,12 +1,12 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -17,21 +17,20 @@ # Unit tests for MockServer::HttpForward # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'HttpForward' do - before do - # run before each test - @instance = MockServer::HttpForward.new - end - - after do - # run after each test - end +describe MockServer::HttpForward do + let(:instance) { MockServer::HttpForward.new } describe 'test an instance of HttpForward' do it 'should create an instance of HttpForward' do - expect(@instance).to be_instance_of(MockServer::HttpForward) + expect(instance).to be_instance_of(MockServer::HttpForward) + end + end + describe 'test attribute "delay"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end + describe 'test attribute "host"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers @@ -49,15 +48,9 @@ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["HTTP", "HTTPS"]) # validator.allowable_values.each do |value| - # expect { @instance.scheme = value }.not_to raise_error + # expect { instance.scheme = value }.not_to raise_error # end end end - describe 'test attribute "delay"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - end - end - end diff --git a/spec/models/http_object_callback_spec.rb b/spec/models/http_object_callback_spec.rb index cfb8f4d..d11b6da 100644 --- a/spec/models/http_object_callback_spec.rb +++ b/spec/models/http_object_callback_spec.rb @@ -1,12 +1,12 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -17,25 +17,30 @@ # Unit tests for MockServer::HttpObjectCallback # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'HttpObjectCallback' do - before do - # run before each test - @instance = MockServer::HttpObjectCallback.new - end - - after do - # run after each test - end +describe MockServer::HttpObjectCallback do + let(:instance) { MockServer::HttpObjectCallback.new } describe 'test an instance of HttpObjectCallback' do it 'should create an instance of HttpObjectCallback' do - expect(@instance).to be_instance_of(MockServer::HttpObjectCallback) + expect(instance).to be_instance_of(MockServer::HttpObjectCallback) + end + end + describe 'test attribute "delay"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end + describe 'test attribute "client_id"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end + describe 'test attribute "response_callback"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + end diff --git a/spec/models/http_override_forwarded_request_one_of1_spec.rb b/spec/models/http_override_forwarded_request_one_of1_spec.rb new file mode 100644 index 0000000..62289d8 --- /dev/null +++ b/spec/models/http_override_forwarded_request_one_of1_spec.rb @@ -0,0 +1,46 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for MockServer::HttpOverrideForwardedRequestOneOf1 +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe MockServer::HttpOverrideForwardedRequestOneOf1 do + let(:instance) { MockServer::HttpOverrideForwardedRequestOneOf1.new } + + describe 'test an instance of HttpOverrideForwardedRequestOneOf1' do + it 'should create an instance of HttpOverrideForwardedRequestOneOf1' do + expect(instance).to be_instance_of(MockServer::HttpOverrideForwardedRequestOneOf1) + end + end + describe 'test attribute "delay"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "http_request"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "http_response"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/http_override_forwarded_request_one_of_request_modifier_cookies_spec.rb b/spec/models/http_override_forwarded_request_one_of_request_modifier_cookies_spec.rb new file mode 100644 index 0000000..f8de665 --- /dev/null +++ b/spec/models/http_override_forwarded_request_one_of_request_modifier_cookies_spec.rb @@ -0,0 +1,46 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for MockServer::HttpOverrideForwardedRequestOneOfRequestModifierCookies +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe MockServer::HttpOverrideForwardedRequestOneOfRequestModifierCookies do + let(:instance) { MockServer::HttpOverrideForwardedRequestOneOfRequestModifierCookies.new } + + describe 'test an instance of HttpOverrideForwardedRequestOneOfRequestModifierCookies' do + it 'should create an instance of HttpOverrideForwardedRequestOneOfRequestModifierCookies' do + expect(instance).to be_instance_of(MockServer::HttpOverrideForwardedRequestOneOfRequestModifierCookies) + end + end + describe 'test attribute "add"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "replace"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "remove"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/http_override_forwarded_request_one_of_request_modifier_path_spec.rb b/spec/models/http_override_forwarded_request_one_of_request_modifier_path_spec.rb new file mode 100644 index 0000000..3b51f02 --- /dev/null +++ b/spec/models/http_override_forwarded_request_one_of_request_modifier_path_spec.rb @@ -0,0 +1,40 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for MockServer::HttpOverrideForwardedRequestOneOfRequestModifierPath +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe MockServer::HttpOverrideForwardedRequestOneOfRequestModifierPath do + let(:instance) { MockServer::HttpOverrideForwardedRequestOneOfRequestModifierPath.new } + + describe 'test an instance of HttpOverrideForwardedRequestOneOfRequestModifierPath' do + it 'should create an instance of HttpOverrideForwardedRequestOneOfRequestModifierPath' do + expect(instance).to be_instance_of(MockServer::HttpOverrideForwardedRequestOneOfRequestModifierPath) + end + end + describe 'test attribute "regex"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "substitution"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/http_override_forwarded_request_one_of_request_modifier_query_string_parameters_spec.rb b/spec/models/http_override_forwarded_request_one_of_request_modifier_query_string_parameters_spec.rb new file mode 100644 index 0000000..cf4f5b5 --- /dev/null +++ b/spec/models/http_override_forwarded_request_one_of_request_modifier_query_string_parameters_spec.rb @@ -0,0 +1,46 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for MockServer::HttpOverrideForwardedRequestOneOfRequestModifierQueryStringParameters +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe MockServer::HttpOverrideForwardedRequestOneOfRequestModifierQueryStringParameters do + let(:instance) { MockServer::HttpOverrideForwardedRequestOneOfRequestModifierQueryStringParameters.new } + + describe 'test an instance of HttpOverrideForwardedRequestOneOfRequestModifierQueryStringParameters' do + it 'should create an instance of HttpOverrideForwardedRequestOneOfRequestModifierQueryStringParameters' do + expect(instance).to be_instance_of(MockServer::HttpOverrideForwardedRequestOneOfRequestModifierQueryStringParameters) + end + end + describe 'test attribute "add"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "replace"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "remove"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/http_override_forwarded_request_one_of_request_modifier_spec.rb b/spec/models/http_override_forwarded_request_one_of_request_modifier_spec.rb new file mode 100644 index 0000000..ec5e27d --- /dev/null +++ b/spec/models/http_override_forwarded_request_one_of_request_modifier_spec.rb @@ -0,0 +1,52 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for MockServer::HttpOverrideForwardedRequestOneOfRequestModifier +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe MockServer::HttpOverrideForwardedRequestOneOfRequestModifier do + let(:instance) { MockServer::HttpOverrideForwardedRequestOneOfRequestModifier.new } + + describe 'test an instance of HttpOverrideForwardedRequestOneOfRequestModifier' do + it 'should create an instance of HttpOverrideForwardedRequestOneOfRequestModifier' do + expect(instance).to be_instance_of(MockServer::HttpOverrideForwardedRequestOneOfRequestModifier) + end + end + describe 'test attribute "path"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "query_string_parameters"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "headers"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "cookies"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/http_override_forwarded_request_one_of_response_modifier_spec.rb b/spec/models/http_override_forwarded_request_one_of_response_modifier_spec.rb new file mode 100644 index 0000000..42eae42 --- /dev/null +++ b/spec/models/http_override_forwarded_request_one_of_response_modifier_spec.rb @@ -0,0 +1,40 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for MockServer::HttpOverrideForwardedRequestOneOfResponseModifier +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe MockServer::HttpOverrideForwardedRequestOneOfResponseModifier do + let(:instance) { MockServer::HttpOverrideForwardedRequestOneOfResponseModifier.new } + + describe 'test an instance of HttpOverrideForwardedRequestOneOfResponseModifier' do + it 'should create an instance of HttpOverrideForwardedRequestOneOfResponseModifier' do + expect(instance).to be_instance_of(MockServer::HttpOverrideForwardedRequestOneOfResponseModifier) + end + end + describe 'test attribute "headers"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "cookies"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/http_override_forwarded_request_one_of_spec.rb b/spec/models/http_override_forwarded_request_one_of_spec.rb new file mode 100644 index 0000000..28b7ffa --- /dev/null +++ b/spec/models/http_override_forwarded_request_one_of_spec.rb @@ -0,0 +1,58 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for MockServer::HttpOverrideForwardedRequestOneOf +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe MockServer::HttpOverrideForwardedRequestOneOf do + let(:instance) { MockServer::HttpOverrideForwardedRequestOneOf.new } + + describe 'test an instance of HttpOverrideForwardedRequestOneOf' do + it 'should create an instance of HttpOverrideForwardedRequestOneOf' do + expect(instance).to be_instance_of(MockServer::HttpOverrideForwardedRequestOneOf) + end + end + describe 'test attribute "delay"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "request_override"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "request_modifier"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "response_override"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "response_modifier"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/http_override_forwarded_request_spec.rb b/spec/models/http_override_forwarded_request_spec.rb index 0eecca4..13c8efa 100644 --- a/spec/models/http_override_forwarded_request_spec.rb +++ b/spec/models/http_override_forwarded_request_spec.rb @@ -1,12 +1,12 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -17,31 +17,15 @@ # Unit tests for MockServer::HttpOverrideForwardedRequest # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'HttpOverrideForwardedRequest' do - before do - # run before each test - @instance = MockServer::HttpOverrideForwardedRequest.new - end - - after do - # run after each test - end - - describe 'test an instance of HttpOverrideForwardedRequest' do - it 'should create an instance of HttpOverrideForwardedRequest' do - expect(@instance).to be_instance_of(MockServer::HttpOverrideForwardedRequest) - end - end - describe 'test attribute "http_request"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers +describe MockServer::HttpOverrideForwardedRequest do + describe '.openapi_one_of' do + it 'lists the items referenced in the oneOf array' do + expect(described_class.openapi_one_of).to_not be_empty end end - describe 'test attribute "delay"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + describe '.build' do + it 'returns the correct model' do end end - end diff --git a/spec/models/http_request_spec.rb b/spec/models/http_request_spec.rb index 590e50f..75644f2 100644 --- a/spec/models/http_request_spec.rb +++ b/spec/models/http_request_spec.rb @@ -1,12 +1,12 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -17,34 +17,39 @@ # Unit tests for MockServer::HttpRequest # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'HttpRequest' do - before do - # run before each test - @instance = MockServer::HttpRequest.new - end - - after do - # run after each test - end +describe MockServer::HttpRequest do + let(:instance) { MockServer::HttpRequest.new } describe 'test an instance of HttpRequest' do it 'should create an instance of HttpRequest' do - expect(@instance).to be_instance_of(MockServer::HttpRequest) + expect(instance).to be_instance_of(MockServer::HttpRequest) end end - describe 'test attribute "body"' do + describe 'test attribute "secure"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end - describe 'test attribute "headers"' do + describe 'test attribute "keep_alive"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end - describe 'test attribute "cookies"' do + describe 'test attribute "method"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "path"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "path_parameters"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end @@ -56,25 +61,25 @@ end end - describe 'test attribute "path"' do + describe 'test attribute "body"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end - describe 'test attribute "method"' do + describe 'test attribute "headers"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end - describe 'test attribute "secure"' do + describe 'test attribute "cookies"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end - describe 'test attribute "keep_alive"' do + describe 'test attribute "socket_address"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end diff --git a/spec/models/http_response_spec.rb b/spec/models/http_response_spec.rb index 1f9b54e..682d3fb 100644 --- a/spec/models/http_response_spec.rb +++ b/spec/models/http_response_spec.rb @@ -1,12 +1,12 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -17,28 +17,21 @@ # Unit tests for MockServer::HttpResponse # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'HttpResponse' do - before do - # run before each test - @instance = MockServer::HttpResponse.new - end - - after do - # run after each test - end +describe MockServer::HttpResponse do + let(:instance) { MockServer::HttpResponse.new } describe 'test an instance of HttpResponse' do it 'should create an instance of HttpResponse' do - expect(@instance).to be_instance_of(MockServer::HttpResponse) + expect(instance).to be_instance_of(MockServer::HttpResponse) end end - describe 'test attribute "body"' do + describe 'test attribute "delay"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end - describe 'test attribute "delay"' do + describe 'test attribute "body"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end diff --git a/spec/models/http_template_spec.rb b/spec/models/http_template_spec.rb index 2eed885..29c5f60 100644 --- a/spec/models/http_template_spec.rb +++ b/spec/models/http_template_spec.rb @@ -1,12 +1,12 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -17,38 +17,31 @@ # Unit tests for MockServer::HttpTemplate # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'HttpTemplate' do - before do - # run before each test - @instance = MockServer::HttpTemplate.new - end - - after do - # run after each test - end +describe MockServer::HttpTemplate do + let(:instance) { MockServer::HttpTemplate.new } describe 'test an instance of HttpTemplate' do it 'should create an instance of HttpTemplate' do - expect(@instance).to be_instance_of(MockServer::HttpTemplate) + expect(instance).to be_instance_of(MockServer::HttpTemplate) end end - describe 'test attribute "template_type"' do + describe 'test attribute "delay"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["JAVASCRIPT", "VELOCITY"]) - # validator.allowable_values.each do |value| - # expect { @instance.template_type = value }.not_to raise_error - # end end end - describe 'test attribute "template"' do + describe 'test attribute "template_type"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["VELOCITY", "JAVASCRIPT", "MUSTACHE"]) + # validator.allowable_values.each do |value| + # expect { instance.template_type = value }.not_to raise_error + # end end end - describe 'test attribute "delay"' do + describe 'test attribute "template"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end diff --git a/spec/models/key_to_multi_value_one_of_spec.rb b/spec/models/key_to_multi_value_one_of_spec.rb new file mode 100644 index 0000000..145460a --- /dev/null +++ b/spec/models/key_to_multi_value_one_of_spec.rb @@ -0,0 +1,38 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for MockServer::KeyToMultiValueOneOf +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe MockServer::KeyToMultiValueOneOf do + let(:instance) { MockServer::KeyToMultiValueOneOf.new } + + describe 'test an instance of KeyToMultiValueOneOf' do + it 'should create an instance of KeyToMultiValueOneOf' do + expect(instance).to be_instance_of(MockServer::KeyToMultiValueOneOf) + end + end + describe 'test attribute "key_match_style"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["MATCHING_KEY", "SUB_SET"]) + # validator.allowable_values.each do |value| + # expect { instance.key_match_style = value }.not_to raise_error + # end + end + end + +end diff --git a/spec/models/key_to_multi_value_spec.rb b/spec/models/key_to_multi_value_spec.rb index 9a0893a..867e16f 100644 --- a/spec/models/key_to_multi_value_spec.rb +++ b/spec/models/key_to_multi_value_spec.rb @@ -1,12 +1,12 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -17,19 +17,15 @@ # Unit tests for MockServer::KeyToMultiValue # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'KeyToMultiValue' do - before do - # run before each test - @instance = MockServer::KeyToMultiValue.new - end - - after do - # run after each test +describe MockServer::KeyToMultiValue do + describe '.openapi_one_of' do + it 'lists the items referenced in the oneOf array' do + expect(described_class.openapi_one_of).to_not be_empty + end end - describe 'test an instance of KeyToMultiValue' do - it 'should create an instance of KeyToMultiValue' do - expect(@instance).to be_instance_of(MockServer::KeyToMultiValue) + describe '.build' do + it 'returns the correct model' do end end end diff --git a/spec/models/key_to_value_spec.rb b/spec/models/key_to_value_spec.rb index 53b11cc..35590a4 100644 --- a/spec/models/key_to_value_spec.rb +++ b/spec/models/key_to_value_spec.rb @@ -1,12 +1,12 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -17,19 +17,15 @@ # Unit tests for MockServer::KeyToValue # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'KeyToValue' do - before do - # run before each test - @instance = MockServer::KeyToValue.new - end - - after do - # run after each test +describe MockServer::KeyToValue do + describe '.openapi_one_of' do + it 'lists the items referenced in the oneOf array' do + expect(described_class.openapi_one_of).to_not be_empty + end end - describe 'test an instance of KeyToValue' do - it 'should create an instance of KeyToValue' do - expect(@instance).to be_instance_of(MockServer::KeyToValue) + describe '.build' do + it 'returns the correct model' do end end end diff --git a/spec/models/open_api_definition_spec.rb b/spec/models/open_api_definition_spec.rb new file mode 100644 index 0000000..56726bf --- /dev/null +++ b/spec/models/open_api_definition_spec.rb @@ -0,0 +1,40 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for MockServer::OpenAPIDefinition +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe MockServer::OpenAPIDefinition do + let(:instance) { MockServer::OpenAPIDefinition.new } + + describe 'test an instance of OpenAPIDefinition' do + it 'should create an instance of OpenAPIDefinition' do + expect(instance).to be_instance_of(MockServer::OpenAPIDefinition) + end + end + describe 'test attribute "spec_url_or_payload"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "operation_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/open_api_expectation_spec.rb b/spec/models/open_api_expectation_spec.rb new file mode 100644 index 0000000..49f3664 --- /dev/null +++ b/spec/models/open_api_expectation_spec.rb @@ -0,0 +1,40 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for MockServer::OpenAPIExpectation +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe MockServer::OpenAPIExpectation do + let(:instance) { MockServer::OpenAPIExpectation.new } + + describe 'test an instance of OpenAPIExpectation' do + it 'should create an instance of OpenAPIExpectation' do + expect(instance).to be_instance_of(MockServer::OpenAPIExpectation) + end + end + describe 'test attribute "spec_url_or_payload"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "operations_and_responses"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/open_api_expectations_spec.rb b/spec/models/open_api_expectations_spec.rb new file mode 100644 index 0000000..6d14b5f --- /dev/null +++ b/spec/models/open_api_expectations_spec.rb @@ -0,0 +1,31 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for MockServer::OpenAPIExpectations +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe MockServer::OpenAPIExpectations do + describe '.openapi_one_of' do + it 'lists the items referenced in the oneOf array' do + expect(described_class.openapi_one_of).to_not be_empty + end + end + + describe '.build' do + it 'returns the correct model' do + end + end +end diff --git a/spec/models/ports_spec.rb b/spec/models/ports_spec.rb index 741b823..bd82a65 100644 --- a/spec/models/ports_spec.rb +++ b/spec/models/ports_spec.rb @@ -1,12 +1,12 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -17,19 +17,12 @@ # Unit tests for MockServer::Ports # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'Ports' do - before do - # run before each test - @instance = MockServer::Ports.new - end - - after do - # run after each test - end +describe MockServer::Ports do + let(:instance) { MockServer::Ports.new } describe 'test an instance of Ports' do it 'should create an instance of Ports' do - expect(@instance).to be_instance_of(MockServer::Ports) + expect(instance).to be_instance_of(MockServer::Ports) end end describe 'test attribute "ports"' do diff --git a/spec/models/positive_integer_default0_spec.rb b/spec/models/positive_integer_default0_spec.rb new file mode 100644 index 0000000..b70dc63 --- /dev/null +++ b/spec/models/positive_integer_default0_spec.rb @@ -0,0 +1,28 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for MockServer::PositiveIntegerDefault0 +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe MockServer::PositiveIntegerDefault0 do + let(:instance) { MockServer::PositiveIntegerDefault0.new } + + describe 'test an instance of PositiveIntegerDefault0' do + it 'should create an instance of PositiveIntegerDefault0' do + expect(instance).to be_instance_of(MockServer::PositiveIntegerDefault0) + end + end +end diff --git a/spec/models/request_definition_spec.rb b/spec/models/request_definition_spec.rb new file mode 100644 index 0000000..a6e3c17 --- /dev/null +++ b/spec/models/request_definition_spec.rb @@ -0,0 +1,31 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for MockServer::RequestDefinition +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe MockServer::RequestDefinition do + describe '.openapi_one_of' do + it 'lists the items referenced in the oneOf array' do + expect(described_class.openapi_one_of).to_not be_empty + end + end + + describe '.build' do + it 'returns the correct model' do + end + end +end diff --git a/spec/models/schema_spec.rb b/spec/models/schema_spec.rb new file mode 100644 index 0000000..af32729 --- /dev/null +++ b/spec/models/schema_spec.rb @@ -0,0 +1,226 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for MockServer::Schema +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe MockServer::Schema do + let(:instance) { MockServer::Schema.new } + + describe 'test an instance of Schema' do + it 'should create an instance of Schema' do + expect(instance).to be_instance_of(MockServer::Schema) + end + end + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "schema"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "title"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "description"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "default"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "multiple_of"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "maximum"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "exclusive_maximum"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "minimum"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "exclusive_minimum"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "max_length"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "min_length"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pattern"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "additional_items"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "items"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "max_items"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "min_items"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "unique_items"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "max_properties"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "min_properties"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "required"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "additional_properties"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "definitions"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "properties"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "pattern_properties"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "dependencies"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "enum"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "format"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "all_of"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "any_of"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "one_of"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "_not"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/socket_address_spec.rb b/spec/models/socket_address_spec.rb new file mode 100644 index 0000000..0c9c495 --- /dev/null +++ b/spec/models/socket_address_spec.rb @@ -0,0 +1,50 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for MockServer::SocketAddress +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe MockServer::SocketAddress do + let(:instance) { MockServer::SocketAddress.new } + + describe 'test an instance of SocketAddress' do + it 'should create an instance of SocketAddress' do + expect(instance).to be_instance_of(MockServer::SocketAddress) + end + end + describe 'test attribute "host"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "port"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "scheme"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["HTTP", "HTTPS"]) + # validator.allowable_values.each do |value| + # expect { instance.scheme = value }.not_to raise_error + # end + end + end + +end diff --git a/spec/models/string_or_json_schema_one_of_spec.rb b/spec/models/string_or_json_schema_one_of_spec.rb new file mode 100644 index 0000000..c098127 --- /dev/null +++ b/spec/models/string_or_json_schema_one_of_spec.rb @@ -0,0 +1,62 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for MockServer::StringOrJsonSchemaOneOf +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe MockServer::StringOrJsonSchemaOneOf do + let(:instance) { MockServer::StringOrJsonSchemaOneOf.new } + + describe 'test an instance of StringOrJsonSchemaOneOf' do + it 'should create an instance of StringOrJsonSchemaOneOf' do + expect(instance).to be_instance_of(MockServer::StringOrJsonSchemaOneOf) + end + end + describe 'test attribute "_not"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "optional"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "value"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "schema"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "parameter_style"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["SIMPLE", "SIMPLE_EXPLODED", "LABEL", "LABEL_EXPLODED", "MATRIX", "MATRIX_EXPLODED", "FORM_EXPLODED", "FORM", "SPACE_DELIMITED_EXPLODED", "SPACE_DELIMITED", "PIPE_DELIMITED_EXPLODED", "PIPE_DELIMITED", "DEEP_OBJECT"]) + # validator.allowable_values.each do |value| + # expect { instance.parameter_style = value }.not_to raise_error + # end + end + end + +end diff --git a/spec/models/string_or_json_schema_spec.rb b/spec/models/string_or_json_schema_spec.rb new file mode 100644 index 0000000..b08a52f --- /dev/null +++ b/spec/models/string_or_json_schema_spec.rb @@ -0,0 +1,31 @@ +=begin +#MockServer API + +#MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. + +The version of the OpenAPI document: 5.13.2 + +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 5.4.0 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for MockServer::StringOrJsonSchema +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe MockServer::StringOrJsonSchema do + describe '.openapi_one_of' do + it 'lists the items referenced in the oneOf array' do + expect(described_class.openapi_one_of).to_not be_empty + end + end + + describe '.build' do + it 'returns the correct model' do + end + end +end diff --git a/spec/models/time_to_live_spec.rb b/spec/models/time_to_live_spec.rb index 3e33003..070adf3 100644 --- a/spec/models/time_to_live_spec.rb +++ b/spec/models/time_to_live_spec.rb @@ -1,12 +1,12 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -17,27 +17,20 @@ # Unit tests for MockServer::TimeToLive # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'TimeToLive' do - before do - # run before each test - @instance = MockServer::TimeToLive.new - end - - after do - # run after each test - end +describe MockServer::TimeToLive do + let(:instance) { MockServer::TimeToLive.new } describe 'test an instance of TimeToLive' do it 'should create an instance of TimeToLive' do - expect(@instance).to be_instance_of(MockServer::TimeToLive) + expect(instance).to be_instance_of(MockServer::TimeToLive) end end describe 'test attribute "time_unit"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers - # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["HOURS", "MINUTES", "SECONDS", "MILLISECONDS", "MICROSECONDS", "NANOSECONDS"]) + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["DAYS", "HOURS", "MINUTES", "SECONDS", "MILLISECONDS", "MICROSECONDS", "NANOSECONDS"]) # validator.allowable_values.each do |value| - # expect { @instance.time_unit = value }.not_to raise_error + # expect { instance.time_unit = value }.not_to raise_error # end end end diff --git a/spec/models/times_spec.rb b/spec/models/times_spec.rb index 33f3ad2..82de18f 100644 --- a/spec/models/times_spec.rb +++ b/spec/models/times_spec.rb @@ -1,12 +1,12 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -17,19 +17,12 @@ # Unit tests for MockServer::Times # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'Times' do - before do - # run before each test - @instance = MockServer::Times.new - end - - after do - # run after each test - end +describe MockServer::Times do + let(:instance) { MockServer::Times.new } describe 'test an instance of Times' do it 'should create an instance of Times' do - expect(@instance).to be_instance_of(MockServer::Times) + expect(instance).to be_instance_of(MockServer::Times) end end describe 'test attribute "remaining_times"' do diff --git a/spec/models/verification_sequence_spec.rb b/spec/models/verification_sequence_spec.rb index c6c7c8a..4cc8267 100644 --- a/spec/models/verification_sequence_spec.rb +++ b/spec/models/verification_sequence_spec.rb @@ -1,12 +1,12 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -17,25 +17,15 @@ # Unit tests for MockServer::VerificationSequence # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'VerificationSequence' do - before do - # run before each test - @instance = MockServer::VerificationSequence.new - end - - after do - # run after each test - end - - describe 'test an instance of VerificationSequence' do - it 'should create an instance of VerificationSequence' do - expect(@instance).to be_instance_of(MockServer::VerificationSequence) +describe MockServer::VerificationSequence do + describe '.openapi_one_of' do + it 'lists the items referenced in the oneOf array' do + expect(described_class.openapi_one_of).to_not be_empty end end - describe 'test attribute "http_requests"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + + describe '.build' do + it 'returns the correct model' do end end - end diff --git a/spec/models/verification_spec.rb b/spec/models/verification_spec.rb index 0d1ca11..86ab4bd 100644 --- a/spec/models/verification_spec.rb +++ b/spec/models/verification_spec.rb @@ -1,12 +1,12 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -17,31 +17,15 @@ # Unit tests for MockServer::Verification # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'Verification' do - before do - # run before each test - @instance = MockServer::Verification.new - end - - after do - # run after each test - end - - describe 'test an instance of Verification' do - it 'should create an instance of Verification' do - expect(@instance).to be_instance_of(MockServer::Verification) - end - end - describe 'test attribute "http_request"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers +describe MockServer::Verification do + describe '.openapi_one_of' do + it 'lists the items referenced in the oneOf array' do + expect(described_class.openapi_one_of).to_not be_empty end end - describe 'test attribute "times"' do - it 'should work' do - # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + describe '.build' do + it 'returns the correct model' do end end - end diff --git a/spec/models/verification_times_spec.rb b/spec/models/verification_times_spec.rb index 3046256..f2d6b6a 100644 --- a/spec/models/verification_times_spec.rb +++ b/spec/models/verification_times_spec.rb @@ -1,12 +1,12 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end @@ -17,28 +17,21 @@ # Unit tests for MockServer::VerificationTimes # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate -describe 'VerificationTimes' do - before do - # run before each test - @instance = MockServer::VerificationTimes.new - end - - after do - # run after each test - end +describe MockServer::VerificationTimes do + let(:instance) { MockServer::VerificationTimes.new } describe 'test an instance of VerificationTimes' do it 'should create an instance of VerificationTimes' do - expect(@instance).to be_instance_of(MockServer::VerificationTimes) + expect(instance).to be_instance_of(MockServer::VerificationTimes) end end - describe 'test attribute "count"' do + describe 'test attribute "at_least"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end - describe 'test attribute "exact"' do + describe 'test attribute "at_most"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index c1ca9e3..a37c959 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,12 +1,12 @@ =begin -#Mock Server API +#MockServer API #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test. -OpenAPI spec version: 5.3.0 +The version of the OpenAPI document: 5.13.2 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.1 +OpenAPI Generator version: 5.4.0 =end From 38d228d0d35eaf3b44a3b684a7d63088ebb9179e Mon Sep 17 00:00:00 2001 From: lagarwal-uic Date: Wed, 11 May 2022 15:40:56 +0100 Subject: [PATCH 5/5] URL bug fix --- lib/mockserver-client/configuration.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mockserver-client/configuration.rb b/lib/mockserver-client/configuration.rb index 6e124ff..b932edf 100644 --- a/lib/mockserver-client/configuration.rb +++ b/lib/mockserver-client/configuration.rb @@ -189,7 +189,7 @@ def base_path=(base_path) # Returns base URL for specified operation based on server settings def base_url(operation = nil) - index = server_operation_index.fetch(operation, server_index) + index = server_operation_index.fetch(operation, nil) #lagarwal: replaced server_index with nil to fix bug in generated url. return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if index == nil server_url(index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])