late-sdk 0.0.753 → 0.0.755
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +6 -0
- data/docs/Ad.md +1 -1
- data/docs/ConnectApi.md +210 -3
- data/docs/ConnectDiscordChannelRequest.md +22 -0
- data/docs/ConnectSlackChannelRequest.md +24 -0
- data/docs/ConnectWhatsAppEmbeddedSignupRequest.md +28 -0
- data/docs/CreateStandaloneAdRequest.md +1 -1
- data/lib/zernio-sdk/api/connect_api.rb +213 -4
- data/lib/zernio-sdk/models/ad.rb +3 -3
- data/lib/zernio-sdk/models/connect_discord_channel_request.rb +219 -0
- data/lib/zernio-sdk/models/connect_slack_channel_request.rb +211 -0
- data/lib/zernio-sdk/models/connect_whats_app_embedded_signup_request.rb +230 -0
- data/lib/zernio-sdk/models/create_ad_campaign_request.rb +2 -2
- data/lib/zernio-sdk/models/create_standalone_ad_request.rb +3 -3
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +3 -0
- data/openapi.yaml +99 -7
- data/spec/api/connect_api_spec.rb +38 -2
- data/spec/models/ad_spec.rb +1 -1
- data/spec/models/connect_discord_channel_request_spec.rb +48 -0
- data/spec/models/connect_slack_channel_request_spec.rb +54 -0
- data/spec/models/connect_whats_app_embedded_signup_request_spec.rb +66 -0
- data/spec/models/create_ad_campaign_request_spec.rb +1 -1
- data/spec/models/create_standalone_ad_request_spec.rb +1 -1
- data/zernio-sdk-0.0.755.gem +0 -0
- metadata +14 -2
- data/zernio-sdk-0.0.753.gem +0 -0
|
@@ -457,6 +457,74 @@ module Zernio
|
|
|
457
457
|
return data, status_code, headers
|
|
458
458
|
end
|
|
459
459
|
|
|
460
|
+
# Connect a Discord channel
|
|
461
|
+
# Finalize a Discord connect by binding one channel to a profile. Served by a dedicated route, so it is not reachable through POST /v1/connect/{platform}. One connected account per channel: repeat the call with a different channelId to add another.
|
|
462
|
+
# @param connect_discord_channel_request [ConnectDiscordChannelRequest]
|
|
463
|
+
# @param [Hash] opts the optional parameters
|
|
464
|
+
# @return [nil]
|
|
465
|
+
def connect_discord_channel(connect_discord_channel_request, opts = {})
|
|
466
|
+
connect_discord_channel_with_http_info(connect_discord_channel_request, opts)
|
|
467
|
+
nil
|
|
468
|
+
end
|
|
469
|
+
|
|
470
|
+
# Connect a Discord channel
|
|
471
|
+
# Finalize a Discord connect by binding one channel to a profile. Served by a dedicated route, so it is not reachable through POST /v1/connect/{platform}. One connected account per channel: repeat the call with a different channelId to add another.
|
|
472
|
+
# @param connect_discord_channel_request [ConnectDiscordChannelRequest]
|
|
473
|
+
# @param [Hash] opts the optional parameters
|
|
474
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
475
|
+
def connect_discord_channel_with_http_info(connect_discord_channel_request, opts = {})
|
|
476
|
+
if @api_client.config.debugging
|
|
477
|
+
@api_client.config.logger.debug 'Calling API: ConnectApi.connect_discord_channel ...'
|
|
478
|
+
end
|
|
479
|
+
# verify the required parameter 'connect_discord_channel_request' is set
|
|
480
|
+
if @api_client.config.client_side_validation && connect_discord_channel_request.nil?
|
|
481
|
+
fail ArgumentError, "Missing the required parameter 'connect_discord_channel_request' when calling ConnectApi.connect_discord_channel"
|
|
482
|
+
end
|
|
483
|
+
# resource path
|
|
484
|
+
local_var_path = '/v1/connect/discord'
|
|
485
|
+
|
|
486
|
+
# query parameters
|
|
487
|
+
query_params = opts[:query_params] || {}
|
|
488
|
+
|
|
489
|
+
# header parameters
|
|
490
|
+
header_params = opts[:header_params] || {}
|
|
491
|
+
# HTTP header 'Accept' (if needed)
|
|
492
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
493
|
+
# HTTP header 'Content-Type'
|
|
494
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
495
|
+
if !content_type.nil?
|
|
496
|
+
header_params['Content-Type'] = content_type
|
|
497
|
+
end
|
|
498
|
+
|
|
499
|
+
# form parameters
|
|
500
|
+
form_params = opts[:form_params] || {}
|
|
501
|
+
|
|
502
|
+
# http body (model)
|
|
503
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(connect_discord_channel_request)
|
|
504
|
+
|
|
505
|
+
# return_type
|
|
506
|
+
return_type = opts[:debug_return_type]
|
|
507
|
+
|
|
508
|
+
# auth_names
|
|
509
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
510
|
+
|
|
511
|
+
new_options = opts.merge(
|
|
512
|
+
:operation => :"ConnectApi.connect_discord_channel",
|
|
513
|
+
:header_params => header_params,
|
|
514
|
+
:query_params => query_params,
|
|
515
|
+
:form_params => form_params,
|
|
516
|
+
:body => post_body,
|
|
517
|
+
:auth_names => auth_names,
|
|
518
|
+
:return_type => return_type
|
|
519
|
+
)
|
|
520
|
+
|
|
521
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
522
|
+
if @api_client.config.debugging
|
|
523
|
+
@api_client.config.logger.debug "API called: ConnectApi#connect_discord_channel\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
524
|
+
end
|
|
525
|
+
return data, status_code, headers
|
|
526
|
+
end
|
|
527
|
+
|
|
460
528
|
# Connect an OpenAI Ads account
|
|
461
529
|
# Connect an OpenAI Ads account using an API key from ChatGPT Ads Manager. The key grants full campaign write access on OpenAI's side (OpenAI does not offer a read-only key scope). Zernio uses it to read ads and performance, and to create and manage campaigns you set up through Zernio (create, status, budget, and cancel). Campaigns created directly in ChatGPT Ads Manager can still be managed there.
|
|
462
530
|
# @param connect_open_ai_ads_credentials_request [ConnectOpenAIAdsCredentialsRequest]
|
|
@@ -593,6 +661,74 @@ module Zernio
|
|
|
593
661
|
return data, status_code, headers
|
|
594
662
|
end
|
|
595
663
|
|
|
664
|
+
# Connect a Slack channel
|
|
665
|
+
# Finalize a Slack connect by creating the per-channel account. Served by a dedicated route, so it is not reachable through POST /v1/connect/{platform}. Send pendingDataToken for a first connect (the nonce from the OAuth redirect) or accountId to add another channel to a workspace already connected.
|
|
666
|
+
# @param connect_slack_channel_request [ConnectSlackChannelRequest]
|
|
667
|
+
# @param [Hash] opts the optional parameters
|
|
668
|
+
# @return [nil]
|
|
669
|
+
def connect_slack_channel(connect_slack_channel_request, opts = {})
|
|
670
|
+
connect_slack_channel_with_http_info(connect_slack_channel_request, opts)
|
|
671
|
+
nil
|
|
672
|
+
end
|
|
673
|
+
|
|
674
|
+
# Connect a Slack channel
|
|
675
|
+
# Finalize a Slack connect by creating the per-channel account. Served by a dedicated route, so it is not reachable through POST /v1/connect/{platform}. Send pendingDataToken for a first connect (the nonce from the OAuth redirect) or accountId to add another channel to a workspace already connected.
|
|
676
|
+
# @param connect_slack_channel_request [ConnectSlackChannelRequest]
|
|
677
|
+
# @param [Hash] opts the optional parameters
|
|
678
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
679
|
+
def connect_slack_channel_with_http_info(connect_slack_channel_request, opts = {})
|
|
680
|
+
if @api_client.config.debugging
|
|
681
|
+
@api_client.config.logger.debug 'Calling API: ConnectApi.connect_slack_channel ...'
|
|
682
|
+
end
|
|
683
|
+
# verify the required parameter 'connect_slack_channel_request' is set
|
|
684
|
+
if @api_client.config.client_side_validation && connect_slack_channel_request.nil?
|
|
685
|
+
fail ArgumentError, "Missing the required parameter 'connect_slack_channel_request' when calling ConnectApi.connect_slack_channel"
|
|
686
|
+
end
|
|
687
|
+
# resource path
|
|
688
|
+
local_var_path = '/v1/connect/slack'
|
|
689
|
+
|
|
690
|
+
# query parameters
|
|
691
|
+
query_params = opts[:query_params] || {}
|
|
692
|
+
|
|
693
|
+
# header parameters
|
|
694
|
+
header_params = opts[:header_params] || {}
|
|
695
|
+
# HTTP header 'Accept' (if needed)
|
|
696
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
697
|
+
# HTTP header 'Content-Type'
|
|
698
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
699
|
+
if !content_type.nil?
|
|
700
|
+
header_params['Content-Type'] = content_type
|
|
701
|
+
end
|
|
702
|
+
|
|
703
|
+
# form parameters
|
|
704
|
+
form_params = opts[:form_params] || {}
|
|
705
|
+
|
|
706
|
+
# http body (model)
|
|
707
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(connect_slack_channel_request)
|
|
708
|
+
|
|
709
|
+
# return_type
|
|
710
|
+
return_type = opts[:debug_return_type]
|
|
711
|
+
|
|
712
|
+
# auth_names
|
|
713
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
714
|
+
|
|
715
|
+
new_options = opts.merge(
|
|
716
|
+
:operation => :"ConnectApi.connect_slack_channel",
|
|
717
|
+
:header_params => header_params,
|
|
718
|
+
:query_params => query_params,
|
|
719
|
+
:form_params => form_params,
|
|
720
|
+
:body => post_body,
|
|
721
|
+
:auth_names => auth_names,
|
|
722
|
+
:return_type => return_type
|
|
723
|
+
)
|
|
724
|
+
|
|
725
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
726
|
+
if @api_client.config.debugging
|
|
727
|
+
@api_client.config.logger.debug "API called: ConnectApi#connect_slack_channel\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
728
|
+
end
|
|
729
|
+
return data, status_code, headers
|
|
730
|
+
end
|
|
731
|
+
|
|
596
732
|
# Connect WhatsApp via credentials
|
|
597
733
|
# Connect a WhatsApp Business Account by providing Meta credentials directly. This is the headless alternative to the Embedded Signup browser flow. To get the required credentials: 1. Go to Meta Business Suite (business.facebook.com) 2. Create or select a WhatsApp Business Account 3. In Business Settings > System Users, create a System User 4. Assign it the whatsapp_business_management and whatsapp_business_messaging permissions 5. Generate a permanent access token 6. Get the WABA ID from WhatsApp Manager > Account Tools > Phone Numbers 7. Get the Phone Number ID from the same page (click on the number) Warning: connecting subscribes your own Meta app to this WABA with an override callback that redirects its webhook delivery to Zernio. This WABA's events stop reaching any callback URL you had configured before, immediately and with no overlap window. Do not unsubscribe your app from the WABA afterward: that also cuts off Zernio's delivery, and recovery requires calling this endpoint again.
|
|
598
734
|
# @param connect_whats_app_credentials_request [ConnectWhatsAppCredentialsRequest]
|
|
@@ -661,6 +797,74 @@ module Zernio
|
|
|
661
797
|
return data, status_code, headers
|
|
662
798
|
end
|
|
663
799
|
|
|
800
|
+
# Connect WhatsApp from Embedded Signup
|
|
801
|
+
# Exchange the authorization code Meta Embedded Signup returns to your browser SDK. This is the headless completion path for WhatsApp: the code never passes through a redirect_uri, so POST /v1/connect/{platform} cannot accept it.
|
|
802
|
+
# @param connect_whats_app_embedded_signup_request [ConnectWhatsAppEmbeddedSignupRequest]
|
|
803
|
+
# @param [Hash] opts the optional parameters
|
|
804
|
+
# @return [nil]
|
|
805
|
+
def connect_whats_app_embedded_signup(connect_whats_app_embedded_signup_request, opts = {})
|
|
806
|
+
connect_whats_app_embedded_signup_with_http_info(connect_whats_app_embedded_signup_request, opts)
|
|
807
|
+
nil
|
|
808
|
+
end
|
|
809
|
+
|
|
810
|
+
# Connect WhatsApp from Embedded Signup
|
|
811
|
+
# Exchange the authorization code Meta Embedded Signup returns to your browser SDK. This is the headless completion path for WhatsApp: the code never passes through a redirect_uri, so POST /v1/connect/{platform} cannot accept it.
|
|
812
|
+
# @param connect_whats_app_embedded_signup_request [ConnectWhatsAppEmbeddedSignupRequest]
|
|
813
|
+
# @param [Hash] opts the optional parameters
|
|
814
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
815
|
+
def connect_whats_app_embedded_signup_with_http_info(connect_whats_app_embedded_signup_request, opts = {})
|
|
816
|
+
if @api_client.config.debugging
|
|
817
|
+
@api_client.config.logger.debug 'Calling API: ConnectApi.connect_whats_app_embedded_signup ...'
|
|
818
|
+
end
|
|
819
|
+
# verify the required parameter 'connect_whats_app_embedded_signup_request' is set
|
|
820
|
+
if @api_client.config.client_side_validation && connect_whats_app_embedded_signup_request.nil?
|
|
821
|
+
fail ArgumentError, "Missing the required parameter 'connect_whats_app_embedded_signup_request' when calling ConnectApi.connect_whats_app_embedded_signup"
|
|
822
|
+
end
|
|
823
|
+
# resource path
|
|
824
|
+
local_var_path = '/v1/connect/whatsapp/embedded-signup'
|
|
825
|
+
|
|
826
|
+
# query parameters
|
|
827
|
+
query_params = opts[:query_params] || {}
|
|
828
|
+
|
|
829
|
+
# header parameters
|
|
830
|
+
header_params = opts[:header_params] || {}
|
|
831
|
+
# HTTP header 'Accept' (if needed)
|
|
832
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
833
|
+
# HTTP header 'Content-Type'
|
|
834
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
835
|
+
if !content_type.nil?
|
|
836
|
+
header_params['Content-Type'] = content_type
|
|
837
|
+
end
|
|
838
|
+
|
|
839
|
+
# form parameters
|
|
840
|
+
form_params = opts[:form_params] || {}
|
|
841
|
+
|
|
842
|
+
# http body (model)
|
|
843
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(connect_whats_app_embedded_signup_request)
|
|
844
|
+
|
|
845
|
+
# return_type
|
|
846
|
+
return_type = opts[:debug_return_type]
|
|
847
|
+
|
|
848
|
+
# auth_names
|
|
849
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
850
|
+
|
|
851
|
+
new_options = opts.merge(
|
|
852
|
+
:operation => :"ConnectApi.connect_whats_app_embedded_signup",
|
|
853
|
+
:header_params => header_params,
|
|
854
|
+
:query_params => query_params,
|
|
855
|
+
:form_params => form_params,
|
|
856
|
+
:body => post_body,
|
|
857
|
+
:auth_names => auth_names,
|
|
858
|
+
:return_type => return_type
|
|
859
|
+
)
|
|
860
|
+
|
|
861
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
862
|
+
if @api_client.config.debugging
|
|
863
|
+
@api_client.config.logger.debug "API called: ConnectApi#connect_whats_app_embedded_signup\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
864
|
+
end
|
|
865
|
+
return data, status_code, headers
|
|
866
|
+
end
|
|
867
|
+
|
|
664
868
|
# Create Pinterest board
|
|
665
869
|
# Creates a new board on the connected Pinterest account. The returned board ID can be used immediately as `platformSpecificData.boardId` when creating a Pinterest post.
|
|
666
870
|
# @param account_id [String]
|
|
@@ -1574,8 +1778,8 @@ module Zernio
|
|
|
1574
1778
|
end
|
|
1575
1779
|
|
|
1576
1780
|
# Complete OAuth callback
|
|
1577
|
-
# Exchange the OAuth authorization code for tokens and connect the account to the specified profile.
|
|
1578
|
-
# @param platform [String]
|
|
1781
|
+
# Exchange the OAuth authorization code for tokens and connect the account to the specified profile. Facebook, Google Business, Snapchat and WhatsApp are not accepted here: their account identity is a destination chosen after OAuth, which this single-shot exchange cannot do. Connect them through the redirect flow from `GET /v1/connect/{platform}`, or, for WhatsApp Embedded Signup, through `POST /v1/connect/whatsapp/embedded-signup`.
|
|
1782
|
+
# @param platform [String] Social platform to complete the connect for. Discord, Slack and Telegram are absent because they are served by their own dedicated routes, documented separately.
|
|
1579
1783
|
# @param handle_o_auth_callback_request [HandleOAuthCallbackRequest]
|
|
1580
1784
|
# @param [Hash] opts the optional parameters
|
|
1581
1785
|
# @return [nil]
|
|
@@ -1585,8 +1789,8 @@ module Zernio
|
|
|
1585
1789
|
end
|
|
1586
1790
|
|
|
1587
1791
|
# Complete OAuth callback
|
|
1588
|
-
# Exchange the OAuth authorization code for tokens and connect the account to the specified profile.
|
|
1589
|
-
# @param platform [String]
|
|
1792
|
+
# Exchange the OAuth authorization code for tokens and connect the account to the specified profile. Facebook, Google Business, Snapchat and WhatsApp are not accepted here: their account identity is a destination chosen after OAuth, which this single-shot exchange cannot do. Connect them through the redirect flow from `GET /v1/connect/{platform}`, or, for WhatsApp Embedded Signup, through `POST /v1/connect/whatsapp/embedded-signup`.
|
|
1793
|
+
# @param platform [String] Social platform to complete the connect for. Discord, Slack and Telegram are absent because they are served by their own dedicated routes, documented separately.
|
|
1590
1794
|
# @param handle_o_auth_callback_request [HandleOAuthCallbackRequest]
|
|
1591
1795
|
# @param [Hash] opts the optional parameters
|
|
1592
1796
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
@@ -1598,6 +1802,11 @@ module Zernio
|
|
|
1598
1802
|
if @api_client.config.client_side_validation && platform.nil?
|
|
1599
1803
|
fail ArgumentError, "Missing the required parameter 'platform' when calling ConnectApi.handle_o_auth_callback"
|
|
1600
1804
|
end
|
|
1805
|
+
# verify enum value
|
|
1806
|
+
allowable_values = ["instagram", "twitter", "threads", "linkedin", "youtube", "tiktok", "reddit", "pinterest"]
|
|
1807
|
+
if @api_client.config.client_side_validation && !allowable_values.include?(platform)
|
|
1808
|
+
fail ArgumentError, "invalid value for \"platform\", must be one of #{allowable_values}"
|
|
1809
|
+
end
|
|
1601
1810
|
# verify the required parameter 'handle_o_auth_callback_request' is set
|
|
1602
1811
|
if @api_client.config.client_side_validation && handle_o_auth_callback_request.nil?
|
|
1603
1812
|
fail ArgumentError, "Missing the required parameter 'handle_o_auth_callback_request' when calling ConnectApi.handle_o_auth_callback"
|
data/lib/zernio-sdk/models/ad.rb
CHANGED
|
@@ -35,7 +35,7 @@ module Zernio
|
|
|
35
35
|
# Creative format, classified from the media the creative carries. `null` when the creative carries no media to classify — an unsynced creative and a genuine text-only ad are indistinguishable, so neither is guessed at. Returned by `GET /v1/ads`, `GET /v1/ads/{adId}` and the ad nodes of `GET /v1/ads/tree`.
|
|
36
36
|
attr_accessor :creative_type
|
|
37
37
|
|
|
38
|
-
# Available goals vary by platform. Meta (Facebook/Instagram) supports all
|
|
38
|
+
# Available goals vary by platform. Meta (Facebook/Instagram) supports all 10 (incl. `lead_conversion` = website pixel lead optimization, `catalog_sales` = Advantage+ catalog ads and `page_likes` = Page Likes conversion location under Engagement). TikTok supports engagement, traffic, awareness, video_views, lead_generation, conversions, app_promotion. LinkedIn supports all Meta goals except app_promotion / lead_conversion / catalog_sales / page_likes. Twitter/X supports engagement, traffic, awareness, video_views, app_promotion. Pinterest and Google Ads support only engagement, traffic, awareness, video_views.
|
|
39
39
|
attr_accessor :goal
|
|
40
40
|
|
|
41
41
|
# True for ads synced from platform ad managers
|
|
@@ -400,7 +400,7 @@ module Zernio
|
|
|
400
400
|
return false unless ad_type_validator.valid?(@ad_type)
|
|
401
401
|
creative_type_validator = EnumAttributeValidator.new('String', ["carousel", "video", "document", "image"])
|
|
402
402
|
return false unless creative_type_validator.valid?(@creative_type)
|
|
403
|
-
goal_validator = EnumAttributeValidator.new('String', ["engagement", "traffic", "awareness", "video_views", "lead_generation", "lead_conversion", "conversions", "app_promotion", "catalog_sales", "job_applicants"])
|
|
403
|
+
goal_validator = EnumAttributeValidator.new('String', ["engagement", "traffic", "awareness", "video_views", "lead_generation", "lead_conversion", "conversions", "app_promotion", "catalog_sales", "page_likes", "job_applicants"])
|
|
404
404
|
return false unless goal_validator.valid?(@goal)
|
|
405
405
|
true
|
|
406
406
|
end
|
|
@@ -438,7 +438,7 @@ module Zernio
|
|
|
438
438
|
# Custom attribute writer method checking allowed values (enum).
|
|
439
439
|
# @param [Object] goal Object to be assigned
|
|
440
440
|
def goal=(goal)
|
|
441
|
-
validator = EnumAttributeValidator.new('String', ["engagement", "traffic", "awareness", "video_views", "lead_generation", "lead_conversion", "conversions", "app_promotion", "catalog_sales", "job_applicants"])
|
|
441
|
+
validator = EnumAttributeValidator.new('String', ["engagement", "traffic", "awareness", "video_views", "lead_generation", "lead_conversion", "conversions", "app_promotion", "catalog_sales", "page_likes", "job_applicants"])
|
|
442
442
|
unless validator.valid?(goal)
|
|
443
443
|
fail ArgumentError, "invalid value for \"goal\", must be one of #{validator.allowable_values}."
|
|
444
444
|
end
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.4
|
|
7
|
+
Contact: support@zernio.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Zernio
|
|
17
|
+
class ConnectDiscordChannelRequest < ApiModelBase
|
|
18
|
+
# Discord server (guild) the channel belongs to
|
|
19
|
+
attr_accessor :guild_id
|
|
20
|
+
|
|
21
|
+
# Text, announcement or forum channel to publish to
|
|
22
|
+
attr_accessor :channel_id
|
|
23
|
+
|
|
24
|
+
# Profile to connect the channel to
|
|
25
|
+
attr_accessor :profile_id
|
|
26
|
+
|
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
28
|
+
def self.attribute_map
|
|
29
|
+
{
|
|
30
|
+
:'guild_id' => :'guildId',
|
|
31
|
+
:'channel_id' => :'channelId',
|
|
32
|
+
:'profile_id' => :'profileId'
|
|
33
|
+
}
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Returns attribute mapping this model knows about
|
|
37
|
+
def self.acceptable_attribute_map
|
|
38
|
+
attribute_map
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Returns all the JSON keys this model knows about
|
|
42
|
+
def self.acceptable_attributes
|
|
43
|
+
acceptable_attribute_map.values
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Attribute type mapping.
|
|
47
|
+
def self.openapi_types
|
|
48
|
+
{
|
|
49
|
+
:'guild_id' => :'String',
|
|
50
|
+
:'channel_id' => :'String',
|
|
51
|
+
:'profile_id' => :'String'
|
|
52
|
+
}
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# List of attributes with nullable: true
|
|
56
|
+
def self.openapi_nullable
|
|
57
|
+
Set.new([
|
|
58
|
+
])
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Initializes the object
|
|
62
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
63
|
+
def initialize(attributes = {})
|
|
64
|
+
if (!attributes.is_a?(Hash))
|
|
65
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::ConnectDiscordChannelRequest` initialize method"
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
69
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
70
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
71
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
72
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::ConnectDiscordChannelRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
73
|
+
end
|
|
74
|
+
h[k.to_sym] = v
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if attributes.key?(:'guild_id')
|
|
78
|
+
self.guild_id = attributes[:'guild_id']
|
|
79
|
+
else
|
|
80
|
+
self.guild_id = nil
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
if attributes.key?(:'channel_id')
|
|
84
|
+
self.channel_id = attributes[:'channel_id']
|
|
85
|
+
else
|
|
86
|
+
self.channel_id = nil
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
if attributes.key?(:'profile_id')
|
|
90
|
+
self.profile_id = attributes[:'profile_id']
|
|
91
|
+
else
|
|
92
|
+
self.profile_id = nil
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
97
|
+
# @return Array for valid properties with the reasons
|
|
98
|
+
def list_invalid_properties
|
|
99
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
100
|
+
invalid_properties = Array.new
|
|
101
|
+
if @guild_id.nil?
|
|
102
|
+
invalid_properties.push('invalid value for "guild_id", guild_id cannot be nil.')
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
if @channel_id.nil?
|
|
106
|
+
invalid_properties.push('invalid value for "channel_id", channel_id cannot be nil.')
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
if @profile_id.nil?
|
|
110
|
+
invalid_properties.push('invalid value for "profile_id", profile_id cannot be nil.')
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
invalid_properties
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# Check to see if the all the properties in the model are valid
|
|
117
|
+
# @return true if the model is valid
|
|
118
|
+
def valid?
|
|
119
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
120
|
+
return false if @guild_id.nil?
|
|
121
|
+
return false if @channel_id.nil?
|
|
122
|
+
return false if @profile_id.nil?
|
|
123
|
+
true
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Custom attribute writer method with validation
|
|
127
|
+
# @param [Object] guild_id Value to be assigned
|
|
128
|
+
def guild_id=(guild_id)
|
|
129
|
+
if guild_id.nil?
|
|
130
|
+
fail ArgumentError, 'guild_id cannot be nil'
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
@guild_id = guild_id
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# Custom attribute writer method with validation
|
|
137
|
+
# @param [Object] channel_id Value to be assigned
|
|
138
|
+
def channel_id=(channel_id)
|
|
139
|
+
if channel_id.nil?
|
|
140
|
+
fail ArgumentError, 'channel_id cannot be nil'
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
@channel_id = channel_id
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Custom attribute writer method with validation
|
|
147
|
+
# @param [Object] profile_id Value to be assigned
|
|
148
|
+
def profile_id=(profile_id)
|
|
149
|
+
if profile_id.nil?
|
|
150
|
+
fail ArgumentError, 'profile_id cannot be nil'
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
@profile_id = profile_id
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
# Checks equality by comparing each attribute.
|
|
157
|
+
# @param [Object] Object to be compared
|
|
158
|
+
def ==(o)
|
|
159
|
+
return true if self.equal?(o)
|
|
160
|
+
self.class == o.class &&
|
|
161
|
+
guild_id == o.guild_id &&
|
|
162
|
+
channel_id == o.channel_id &&
|
|
163
|
+
profile_id == o.profile_id
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# @see the `==` method
|
|
167
|
+
# @param [Object] Object to be compared
|
|
168
|
+
def eql?(o)
|
|
169
|
+
self == o
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Calculates hash code according to all attributes.
|
|
173
|
+
# @return [Integer] Hash code
|
|
174
|
+
def hash
|
|
175
|
+
[guild_id, channel_id, profile_id].hash
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# Builds the object from hash
|
|
179
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
180
|
+
# @return [Object] Returns the model itself
|
|
181
|
+
def self.build_from_hash(attributes)
|
|
182
|
+
return nil unless attributes.is_a?(Hash)
|
|
183
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
184
|
+
transformed_hash = {}
|
|
185
|
+
openapi_types.each_pair do |key, type|
|
|
186
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
187
|
+
transformed_hash["#{key}"] = nil
|
|
188
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
189
|
+
# check to ensure the input is an array given that the attribute
|
|
190
|
+
# is documented as an array but the input is not
|
|
191
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
192
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
193
|
+
end
|
|
194
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
195
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
196
|
+
end
|
|
197
|
+
end
|
|
198
|
+
new(transformed_hash)
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
# Returns the object in the form of hash
|
|
202
|
+
# @return [Hash] Returns the object in the form of hash
|
|
203
|
+
def to_hash
|
|
204
|
+
hash = {}
|
|
205
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
206
|
+
value = self.send(attr)
|
|
207
|
+
if value.nil?
|
|
208
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
209
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
hash[param] = _to_hash(value)
|
|
213
|
+
end
|
|
214
|
+
hash
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
end
|