Skip to content

Commit 4c76ef3

Browse files
authored
refactor: regenerate protobuf modules (#408)
1 parent 27b1f7f commit 4c76ef3

12 files changed

+1263
-164
lines changed

public-api/v1alpha/lib/internal_api/artifacthub.pb.ex

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,14 @@ defmodule InternalApi.Artifacthub.ListPathRequest do
175175

176176
@type t :: %__MODULE__{
177177
artifact_id: String.t(),
178-
path: String.t()
178+
path: String.t(),
179+
unwrap_directories: boolean
179180
}
180-
defstruct [:artifact_id, :path]
181+
defstruct [:artifact_id, :path, :unwrap_directories]
181182

182183
field(:artifact_id, 1, type: :string)
183184
field(:path, 2, type: :string)
185+
field(:unwrap_directories, 3, type: :bool)
184186
end
185187

186188
defmodule InternalApi.Artifacthub.ListPathResponse do
@@ -410,6 +412,38 @@ defmodule InternalApi.Artifacthub.Artifact do
410412
field(:artifact_token, 4, type: :string)
411413
end
412414

415+
defmodule InternalApi.Artifacthub.GenerateTokenRequest do
416+
@moduledoc false
417+
use Protobuf, syntax: :proto3
418+
419+
@type t :: %__MODULE__{
420+
artifact_id: String.t(),
421+
job_id: String.t(),
422+
workflow_id: String.t(),
423+
project_id: String.t(),
424+
duration: non_neg_integer
425+
}
426+
defstruct [:artifact_id, :job_id, :workflow_id, :project_id, :duration]
427+
428+
field(:artifact_id, 1, type: :string)
429+
field(:job_id, 2, type: :string)
430+
field(:workflow_id, 3, type: :string)
431+
field(:project_id, 4, type: :string)
432+
field(:duration, 5, type: :uint32)
433+
end
434+
435+
defmodule InternalApi.Artifacthub.GenerateTokenResponse do
436+
@moduledoc false
437+
use Protobuf, syntax: :proto3
438+
439+
@type t :: %__MODULE__{
440+
token: String.t()
441+
}
442+
defstruct [:token]
443+
444+
field(:token, 1, type: :string)
445+
end
446+
413447
defmodule InternalApi.Artifacthub.ArtifactService.Service do
414448
@moduledoc false
415449
use GRPC.Service, name: "InternalApi.Artifacthub.ArtifactService"
@@ -448,6 +482,12 @@ defmodule InternalApi.Artifacthub.ArtifactService.Service do
448482
InternalApi.Artifacthub.UpdateRetentionPolicyResponse
449483
)
450484

485+
rpc(
486+
:GenerateToken,
487+
InternalApi.Artifacthub.GenerateTokenRequest,
488+
InternalApi.Artifacthub.GenerateTokenResponse
489+
)
490+
451491
rpc(:Cleanup, InternalApi.Artifacthub.CleanupRequest, InternalApi.Artifacthub.CleanupResponse)
452492

453493
rpc(

public-api/v1alpha/lib/internal_api/gofer.dt.pb.ex

Lines changed: 76 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ defmodule InternalApi.Gofer.DeploymentTargets.ListRequest do
33
use Protobuf, syntax: :proto3
44

55
@type t :: %__MODULE__{
6-
project_id: String.t()
6+
project_id: String.t(),
7+
requester_id: String.t()
78
}
8-
defstruct [:project_id]
9+
defstruct [:project_id, :requester_id]
910

1011
field(:project_id, 1, type: :string)
12+
field(:requester_id, 2, type: :string)
1113
end
1214

1315
defmodule InternalApi.Gofer.DeploymentTargets.ListResponse do
@@ -50,6 +52,62 @@ defmodule InternalApi.Gofer.DeploymentTargets.DescribeResponse do
5052
field(:target, 1, type: InternalApi.Gofer.DeploymentTargets.DeploymentTarget)
5153
end
5254

55+
defmodule InternalApi.Gofer.DeploymentTargets.VerifyRequest do
56+
@moduledoc false
57+
use Protobuf, syntax: :proto3
58+
59+
@type t :: %__MODULE__{
60+
target_id: String.t(),
61+
triggerer: String.t(),
62+
git_ref_type: integer,
63+
git_ref_label: String.t()
64+
}
65+
defstruct [:target_id, :triggerer, :git_ref_type, :git_ref_label]
66+
67+
field(:target_id, 1, type: :string)
68+
field(:triggerer, 2, type: :string)
69+
70+
field(:git_ref_type, 3,
71+
type: InternalApi.Gofer.DeploymentTargets.VerifyRequest.GitRefType,
72+
enum: true
73+
)
74+
75+
field(:git_ref_label, 4, type: :string)
76+
end
77+
78+
defmodule InternalApi.Gofer.DeploymentTargets.VerifyRequest.GitRefType do
79+
@moduledoc false
80+
use Protobuf, enum: true, syntax: :proto3
81+
82+
field(:BRANCH, 0)
83+
field(:TAG, 1)
84+
field(:PR, 2)
85+
end
86+
87+
defmodule InternalApi.Gofer.DeploymentTargets.VerifyResponse do
88+
@moduledoc false
89+
use Protobuf, syntax: :proto3
90+
91+
@type t :: %__MODULE__{
92+
status: integer
93+
}
94+
defstruct [:status]
95+
96+
field(:status, 1, type: InternalApi.Gofer.DeploymentTargets.VerifyResponse.Status, enum: true)
97+
end
98+
99+
defmodule InternalApi.Gofer.DeploymentTargets.VerifyResponse.Status do
100+
@moduledoc false
101+
use Protobuf, enum: true, syntax: :proto3
102+
103+
field(:SYNCING_TARGET, 0)
104+
field(:ACCESS_GRANTED, 1)
105+
field(:BANNED_SUBJECT, 2)
106+
field(:BANNED_OBJECT, 3)
107+
field(:CORDONED_TARGET, 4)
108+
field(:CORRUPTED_TARGET, 5)
109+
end
110+
53111
defmodule InternalApi.Gofer.DeploymentTargets.HistoryRequest do
54112
@moduledoc false
55113
use Protobuf, syntax: :proto3
@@ -58,9 +116,10 @@ defmodule InternalApi.Gofer.DeploymentTargets.HistoryRequest do
58116
target_id: String.t(),
59117
cursor_type: integer,
60118
cursor_value: non_neg_integer,
61-
filters: InternalApi.Gofer.DeploymentTargets.HistoryRequest.Filters.t()
119+
filters: InternalApi.Gofer.DeploymentTargets.HistoryRequest.Filters.t(),
120+
requester_id: String.t()
62121
}
63-
defstruct [:target_id, :cursor_type, :cursor_value, :filters]
122+
defstruct [:target_id, :cursor_type, :cursor_value, :filters, :requester_id]
64123

65124
field(:target_id, 1, type: :string)
66125

@@ -71,6 +130,7 @@ defmodule InternalApi.Gofer.DeploymentTargets.HistoryRequest do
71130

72131
field(:cursor_value, 3, type: :uint64)
73132
field(:filters, 4, type: InternalApi.Gofer.DeploymentTargets.HistoryRequest.Filters)
133+
field(:requester_id, 5, type: :string)
74134
end
75135

76136
defmodule InternalApi.Gofer.DeploymentTargets.HistoryRequest.Filters do
@@ -332,7 +392,8 @@ defmodule InternalApi.Gofer.DeploymentTargets.Deployment do
332392
state_message: String.t(),
333393
switch_id: String.t(),
334394
target_name: String.t(),
335-
env_vars: [InternalApi.Gofer.DeploymentTargets.Deployment.EnvVar.t()]
395+
env_vars: [InternalApi.Gofer.DeploymentTargets.Deployment.EnvVar.t()],
396+
can_requester_rerun: boolean
336397
}
337398
defstruct [
338399
:id,
@@ -345,7 +406,8 @@ defmodule InternalApi.Gofer.DeploymentTargets.Deployment do
345406
:state_message,
346407
:switch_id,
347408
:target_name,
348-
:env_vars
409+
:env_vars,
410+
:can_requester_rerun
349411
]
350412

351413
field(:id, 1, type: :string)
@@ -360,6 +422,8 @@ defmodule InternalApi.Gofer.DeploymentTargets.Deployment do
360422
field(:target_name, 10, type: :string)
361423

362424
field(:env_vars, 11, repeated: true, type: InternalApi.Gofer.DeploymentTargets.Deployment.EnvVar)
425+
426+
field(:can_requester_rerun, 12, type: :bool)
363427
end
364428

365429
defmodule InternalApi.Gofer.DeploymentTargets.Deployment.EnvVar do
@@ -478,6 +542,12 @@ defmodule InternalApi.Gofer.DeploymentTargets.DeploymentTargets.Service do
478542
InternalApi.Gofer.DeploymentTargets.DescribeResponse
479543
)
480544

545+
rpc(
546+
:Verify,
547+
InternalApi.Gofer.DeploymentTargets.VerifyRequest,
548+
InternalApi.Gofer.DeploymentTargets.VerifyResponse
549+
)
550+
481551
rpc(
482552
:History,
483553
InternalApi.Gofer.DeploymentTargets.HistoryRequest,

public-api/v1alpha/lib/internal_api/gofer.switch.pb.ex

Lines changed: 75 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,24 @@ defmodule InternalApi.Gofer.Target do
5757
pipeline_path: String.t(),
5858
auto_trigger_on: [InternalApi.Gofer.AutoTriggerCond.t()],
5959
parameter_env_vars: [InternalApi.Gofer.ParamEnvVar.t()],
60-
auto_promote_when: String.t()
60+
auto_promote_when: String.t(),
61+
deployment_target: String.t()
6162
}
62-
defstruct [:name, :pipeline_path, :auto_trigger_on, :parameter_env_vars, :auto_promote_when]
63+
defstruct [
64+
:name,
65+
:pipeline_path,
66+
:auto_trigger_on,
67+
:parameter_env_vars,
68+
:auto_promote_when,
69+
:deployment_target
70+
]
6371

6472
field(:name, 1, type: :string)
6573
field(:pipeline_path, 2, type: :string)
6674
field(:auto_trigger_on, 5, repeated: true, type: InternalApi.Gofer.AutoTriggerCond)
6775
field(:parameter_env_vars, 6, repeated: true, type: InternalApi.Gofer.ParamEnvVar)
6876
field(:auto_promote_when, 7, type: :string)
77+
field(:deployment_target, 8, type: :string)
6978
end
7079

7180
defmodule InternalApi.Gofer.ParamEnvVar do
@@ -128,12 +137,14 @@ defmodule InternalApi.Gofer.DescribeRequest do
128137

129138
@type t :: %__MODULE__{
130139
switch_id: String.t(),
131-
events_per_target: integer
140+
events_per_target: integer,
141+
requester_id: String.t()
132142
}
133-
defstruct [:switch_id, :events_per_target]
143+
defstruct [:switch_id, :events_per_target, :requester_id]
134144

135145
field(:switch_id, 1, type: :string)
136146
field(:events_per_target, 2, type: :int32)
147+
field(:requester_id, 3, type: :string)
137148
end
138149

139150
defmodule InternalApi.Gofer.DescribeResponse do
@@ -177,15 +188,69 @@ defmodule InternalApi.Gofer.TargetDescription do
177188
pipeline_path: String.t(),
178189
trigger_events: [InternalApi.Gofer.TriggerEvent.t()],
179190
auto_trigger_on: [InternalApi.Gofer.AutoTriggerCond.t()],
180-
parameter_env_vars: [InternalApi.Gofer.ParamEnvVar.t()]
191+
parameter_env_vars: [InternalApi.Gofer.ParamEnvVar.t()],
192+
dt_description: InternalApi.Gofer.DeploymentTargetDescription.t()
181193
}
182-
defstruct [:name, :pipeline_path, :trigger_events, :auto_trigger_on, :parameter_env_vars]
194+
defstruct [
195+
:name,
196+
:pipeline_path,
197+
:trigger_events,
198+
:auto_trigger_on,
199+
:parameter_env_vars,
200+
:dt_description
201+
]
183202

184203
field(:name, 1, type: :string)
185204
field(:pipeline_path, 2, type: :string)
186205
field(:trigger_events, 4, repeated: true, type: InternalApi.Gofer.TriggerEvent)
187206
field(:auto_trigger_on, 6, repeated: true, type: InternalApi.Gofer.AutoTriggerCond)
188207
field(:parameter_env_vars, 7, repeated: true, type: InternalApi.Gofer.ParamEnvVar)
208+
field(:dt_description, 8, type: InternalApi.Gofer.DeploymentTargetDescription)
209+
end
210+
211+
defmodule InternalApi.Gofer.DeploymentTargetDescription do
212+
@moduledoc false
213+
use Protobuf, syntax: :proto3
214+
215+
@type t :: %__MODULE__{
216+
target_id: String.t(),
217+
target_name: String.t(),
218+
access: InternalApi.Gofer.DeploymentTargetDescription.Access.t()
219+
}
220+
defstruct [:target_id, :target_name, :access]
221+
222+
field(:target_id, 1, type: :string)
223+
field(:target_name, 2, type: :string)
224+
field(:access, 3, type: InternalApi.Gofer.DeploymentTargetDescription.Access)
225+
end
226+
227+
defmodule InternalApi.Gofer.DeploymentTargetDescription.Access do
228+
@moduledoc false
229+
use Protobuf, syntax: :proto3
230+
231+
@type t :: %__MODULE__{
232+
allowed: boolean,
233+
reason: integer,
234+
message: String.t()
235+
}
236+
defstruct [:allowed, :reason, :message]
237+
238+
field(:allowed, 1, type: :bool)
239+
field(:reason, 2, type: InternalApi.Gofer.DeploymentTargetDescription.Access.Reason, enum: true)
240+
field(:message, 3, type: :string)
241+
end
242+
243+
defmodule InternalApi.Gofer.DeploymentTargetDescription.Access.Reason do
244+
@moduledoc false
245+
use Protobuf, enum: true, syntax: :proto3
246+
247+
field(:INTERNAL_ERROR, 0)
248+
field(:NO_REASON, 1)
249+
field(:SYNCING_TARGET, 2)
250+
field(:CORRUPTED_TARGET, 3)
251+
field(:BANNED_SUBJECT, 4)
252+
field(:BANNED_OBJECT, 5)
253+
field(:CORDONED_TARGET, 6)
189254
end
190255

191256
defmodule InternalApi.Gofer.TriggerEvent do
@@ -246,12 +311,14 @@ defmodule InternalApi.Gofer.DescribeManyRequest do
246311

247312
@type t :: %__MODULE__{
248313
switch_ids: [String.t()],
249-
events_per_target: integer
314+
events_per_target: integer,
315+
requester_id: String.t()
250316
}
251-
defstruct [:switch_ids, :events_per_target]
317+
defstruct [:switch_ids, :events_per_target, :requester_id]
252318

253319
field(:switch_ids, 1, repeated: true, type: :string)
254320
field(:events_per_target, 2, type: :int32)
321+
field(:requester_id, 3, type: :string)
255322
end
256323

257324
defmodule InternalApi.Gofer.DescribeManyResponse do

0 commit comments

Comments
 (0)