Class: Fastlane::Actions::HuaweiAppgalleryConnectSubmitForReviewAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/huawei_appgallery_connect/actions/huawei_appgallery_connect_submit_for_review.rb

Class Method Summary collapse

Class Method Details

.authorsObject



22
23
24
# File 'lib/fastlane/plugin/huawei_appgallery_connect/actions/huawei_appgallery_connect_submit_for_review.rb', line 22

def self.authors
  ["Shreejan Shrestha"]
end

.available_optionsObject



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/fastlane/plugin/huawei_appgallery_connect/actions/huawei_appgallery_connect_submit_for_review.rb', line 35

def self.available_options
  [
      FastlaneCore::ConfigItem.new(key: :client_id,
                                   env_name: "HUAWEI_APPGALLERY_CONNECT_CLIENT_ID",
                                   description: "Huawei AppGallery Connect Client ID",
                                   optional: false,
                                   type: String),

      FastlaneCore::ConfigItem.new(key: :client_secret,
                                   env_name: "HUAWEI_APPGALLERY_CONNECT_CLIENT_SECRET",
                                   description: "Huawei AppGallery Connect Client Secret",
                                   optional: false,
                                   type: String),

      FastlaneCore::ConfigItem.new(key: :app_id,
                                   env_name: "HUAWEI_APPGALLERY_CONNECT_APP_ID",
                                   description: "Huawei AppGallery Connect App ID",
                                   optional: false,
                                   type: String),

      FastlaneCore::ConfigItem.new(key: :phase_wise_release,
                                   env_name: "HUAWEI_APPGALLERY_CONNECT_PHASE_WISE_RELEASE",
                                   description: "Phase wise release",
                                   optional: true,
                                   conflicting_options: [:release_time],
                                   type: Boolean),

      FastlaneCore::ConfigItem.new(key: :phase_release_start_time,
                                   env_name: "HUAWEI_APPGALLERY_CONNECT_PHASE_WISE_RELEASE_START_TIME",
                                   description: "Start time of the validity period of the release by phase. The value is UTC time in the following format: yyyy-MM-dd 'T' HH:mm:ssZZ",
                                   optional: true,
                                   type: String),

      FastlaneCore::ConfigItem.new(key: :phase_release_end_time,
                                   env_name: "HUAWEI_APPGALLERY_CONNECT_PHASE_WISE_RELEASE_END_TIME",
                                   description: "End time of the validity period of the release by phase. The value is UTC time in the following format: yyyy-MM-dd 'T' HH:mm:ssZZ",
                                   optional: true,
                                   type: String),

      FastlaneCore::ConfigItem.new(key: :phase_release_percent,
                                   env_name: "HUAWEI_APPGALLERY_CONNECT_PHASE_WISE_RELEASE_PERCENT",
                                   description: "Percentage of the release by phase. The value must be accurate to two decimal places and does not contain the percent sign (%)",
                                   optional: true,
                                   type: String),

      FastlaneCore::ConfigItem.new(key: :phase_release_description,
                                   env_name: "HUAWEI_APPGALLERY_CONNECT_PHASE_WISE_RELEASE_DESCRIPTION",
                                   description: "Phase-based release description. (Max 500 characters)",
                                   optional: true,
                                   type: String),

      FastlaneCore::ConfigItem.new(key: :release_time,
                                   env_name: "HUAWEI_APPGALLERY_CONNECT_RELEASE_TIME",
                                   description: "Release time in UTC format for app release on a specific date. The format is yyyy-MM-dd'T'HH:mm:ssZZ)",
                                   optional: true,
                                   conflicting_options: [:phase_wise_release],
                                   type: String),
    
      FastlaneCore::ConfigItem.new(key: :changelog_path,
                                   env_name: "HUAWEI_APPGALLERY_CONNECT_CHANGELOG_PATH",
                                   description: "Path to Changelog file (Default empty)",
                                   optional: true,
                                   type: String)
  ]
end

.descriptionObject



18
19
20
# File 'lib/fastlane/plugin/huawei_appgallery_connect/actions/huawei_appgallery_connect_submit_for_review.rb', line 18

def self.description
  "Huawei AppGallery Connect Plugin"
end

.detailsObject



30
31
32
33
# File 'lib/fastlane/plugin/huawei_appgallery_connect/actions/huawei_appgallery_connect_submit_for_review.rb', line 30

def self.details
  # Optional:
  "Fastlane plugin to upload Android app to Huawei AppGallery Connect"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


101
102
103
104
# File 'lib/fastlane/plugin/huawei_appgallery_connect/actions/huawei_appgallery_connect_submit_for_review.rb', line 101

def self.is_supported?(platform)
  [:android].include?(platform)
  true
end

.return_valueObject



26
27
28
# File 'lib/fastlane/plugin/huawei_appgallery_connect/actions/huawei_appgallery_connect_submit_for_review.rb', line 26

def self.return_value
  # If your method provides a return value, you can describe here what it does
end

.run(params) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/fastlane/plugin/huawei_appgallery_connect/actions/huawei_appgallery_connect_submit_for_review.rb', line 7

def self.run(params)
  token = Helper::HuaweiAppgalleryConnectHelper.get_token(params[:client_id], params[:client_secret])

  if token.nil?
    UI.message("Cannot retrieve token, please check your client ID and client secret")
  else

    Helper::HuaweiAppgalleryConnectHelper.submit_app_for_review(token, params)
  end
end