crossplane-function-sdk-python 0.2.0__py3-none-any.whl → 0.4.0__py3-none-any.whl

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.
@@ -0,0 +1,101 @@
1
+ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2
+ """Client and server classes corresponding to protobuf-defined services."""
3
+ import grpc
4
+ import warnings
5
+
6
+ from crossplane.function.proto.v1 import run_function_pb2 as crossplane_dot_function_dot_proto_dot_v1_dot_run__function__pb2
7
+
8
+ GRPC_GENERATED_VERSION = '1.66.0'
9
+ GRPC_VERSION = grpc.__version__
10
+ _version_not_supported = False
11
+
12
+ try:
13
+ from grpc._utilities import first_version_is_lower
14
+ _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
15
+ except ImportError:
16
+ _version_not_supported = True
17
+
18
+ if _version_not_supported:
19
+ raise RuntimeError(
20
+ f'The grpc package installed is at version {GRPC_VERSION},'
21
+ + f' but the generated code in crossplane/function/proto/v1/run_function_pb2_grpc.py depends on'
22
+ + f' grpcio>={GRPC_GENERATED_VERSION}.'
23
+ + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
24
+ + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
25
+ )
26
+
27
+
28
+ class FunctionRunnerServiceStub(object):
29
+ """A FunctionRunnerService is a Composition Function.
30
+ """
31
+
32
+ def __init__(self, channel):
33
+ """Constructor.
34
+
35
+ Args:
36
+ channel: A grpc.Channel.
37
+ """
38
+ self.RunFunction = channel.unary_unary(
39
+ '/apiextensions.fn.proto.v1.FunctionRunnerService/RunFunction',
40
+ request_serializer=crossplane_dot_function_dot_proto_dot_v1_dot_run__function__pb2.RunFunctionRequest.SerializeToString,
41
+ response_deserializer=crossplane_dot_function_dot_proto_dot_v1_dot_run__function__pb2.RunFunctionResponse.FromString,
42
+ _registered_method=True)
43
+
44
+
45
+ class FunctionRunnerServiceServicer(object):
46
+ """A FunctionRunnerService is a Composition Function.
47
+ """
48
+
49
+ def RunFunction(self, request, context):
50
+ """RunFunction runs the Composition Function.
51
+ """
52
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
53
+ context.set_details('Method not implemented!')
54
+ raise NotImplementedError('Method not implemented!')
55
+
56
+
57
+ def add_FunctionRunnerServiceServicer_to_server(servicer, server):
58
+ rpc_method_handlers = {
59
+ 'RunFunction': grpc.unary_unary_rpc_method_handler(
60
+ servicer.RunFunction,
61
+ request_deserializer=crossplane_dot_function_dot_proto_dot_v1_dot_run__function__pb2.RunFunctionRequest.FromString,
62
+ response_serializer=crossplane_dot_function_dot_proto_dot_v1_dot_run__function__pb2.RunFunctionResponse.SerializeToString,
63
+ ),
64
+ }
65
+ generic_handler = grpc.method_handlers_generic_handler(
66
+ 'apiextensions.fn.proto.v1.FunctionRunnerService', rpc_method_handlers)
67
+ server.add_generic_rpc_handlers((generic_handler,))
68
+ server.add_registered_method_handlers('apiextensions.fn.proto.v1.FunctionRunnerService', rpc_method_handlers)
69
+
70
+
71
+ # This class is part of an EXPERIMENTAL API.
72
+ class FunctionRunnerService(object):
73
+ """A FunctionRunnerService is a Composition Function.
74
+ """
75
+
76
+ @staticmethod
77
+ def RunFunction(request,
78
+ target,
79
+ options=(),
80
+ channel_credentials=None,
81
+ call_credentials=None,
82
+ insecure=False,
83
+ compression=None,
84
+ wait_for_ready=None,
85
+ timeout=None,
86
+ metadata=None):
87
+ return grpc.experimental.unary_unary(
88
+ request,
89
+ target,
90
+ '/apiextensions.fn.proto.v1.FunctionRunnerService/RunFunction',
91
+ crossplane_dot_function_dot_proto_dot_v1_dot_run__function__pb2.RunFunctionRequest.SerializeToString,
92
+ crossplane_dot_function_dot_proto_dot_v1_dot_run__function__pb2.RunFunctionResponse.FromString,
93
+ options,
94
+ channel_credentials,
95
+ insecure,
96
+ call_credentials,
97
+ compression,
98
+ wait_for_ready,
99
+ timeout,
100
+ metadata,
101
+ _registered_method=True)
@@ -19,11 +19,12 @@ syntax = "proto3";
19
19
  import "google/protobuf/struct.proto";
20
20
  import "google/protobuf/duration.proto";
21
21
 
22
- // Note that the authoritative Composition Functions protobuf definition lives
23
- // at the below URL. Each SDK maintains and manually syncs its own copy.
24
- // https://github.com/crossplane/crossplane/tree/master/apis/apiextensions/fn/proto
22
+ // Generated from apiextensions/fn/proto/v1/run_function.proto by ../hack/duplicate_proto_type.sh. DO NOT EDIT.
23
+
25
24
  package apiextensions.fn.proto.v1beta1;
26
25
 
26
+ option go_package = "github.com/crossplane/crossplane/apis/apiextensions/fn/proto/v1beta1";
27
+
27
28
  // A FunctionRunnerService is a Composition Function.
28
29
  service FunctionRunnerService {
29
30
  // RunFunction runs the Composition Function.
@@ -69,6 +70,24 @@ message RunFunctionRequest {
69
70
  // did not exist, Crossplane sets the map key to an empty Resources message to
70
71
  // indicate that it attempted to satisfy the request.
71
72
  map<string, Resources> extra_resources = 6;
73
+
74
+ // Optional credentials that this Function may use to communicate with an
75
+ // external system.
76
+ map <string, Credentials> credentials = 7;
77
+ }
78
+
79
+ // Credentials that a Function may use to communicate with an external system.
80
+ message Credentials {
81
+ // Source of the credentials.
82
+ oneof source {
83
+ // Credential data loaded by Crossplane, for example from a Secret.
84
+ CredentialData credential_data = 1;
85
+ }
86
+ }
87
+
88
+ // CredentialData loaded by Crossplane, for example from a Secret.
89
+ message CredentialData {
90
+ map<string, bytes> data = 1;
72
91
  }
73
92
 
74
93
  // Resources represents the state of several Crossplane resources.
@@ -104,6 +123,10 @@ message RunFunctionResponse {
104
123
 
105
124
  // Requirements that must be satisfied for this Function to run successfully.
106
125
  Requirements requirements = 5;
126
+
127
+ // Status conditions to be applied to the composite resource. Conditions may also
128
+ // optionally be applied to the composite resource's associated claim.
129
+ repeated Condition conditions = 6;
107
130
  }
108
131
 
109
132
  // RequestMeta contains metadata pertaining to a RunFunctionRequest.
@@ -122,11 +145,18 @@ message Requirements {
122
145
 
123
146
  // ResourceSelector selects a group of resources, either by name or by label.
124
147
  message ResourceSelector {
148
+ // API version of resources to select.
125
149
  string api_version = 1;
150
+
151
+ // Kind of resources to select.
126
152
  string kind = 2;
127
153
 
154
+ // Resources to match.
128
155
  oneof match {
156
+ // Match the resource with this name.
129
157
  string match_name = 3;
158
+
159
+ // Match all resources with these labels.
130
160
  MatchLabels match_labels = 4;
131
161
  }
132
162
  }
@@ -219,6 +249,13 @@ message Result {
219
249
 
220
250
  // Human-readable details about the result.
221
251
  string message = 2;
252
+
253
+ // Optional PascalCase, machine-readable reason for this result. If omitted,
254
+ // the value will be ComposeResources.
255
+ optional string reason = 3;
256
+
257
+ // The resources this result targets.
258
+ optional Target target = 4;
222
259
  }
223
260
 
224
261
  // Severity of Function results.
@@ -238,4 +275,54 @@ enum Severity {
238
275
  // Normal results are emitted as normal events and debug logs associated
239
276
  // with the composite resource.
240
277
  SEVERITY_NORMAL = 3;
241
- }
278
+ }
279
+
280
+ // Target of Function results and conditions.
281
+ enum Target {
282
+ // If the target is unspecified, the result targets the composite resource.
283
+ TARGET_UNSPECIFIED = 0;
284
+
285
+ // Target the composite resource. Results that target the composite resource
286
+ // should include detailed, advanced information.
287
+ TARGET_COMPOSITE = 1;
288
+
289
+ // Target the composite and the claim. Results that target the composite and
290
+ // the claim should include only end-user friendly information.
291
+ TARGET_COMPOSITE_AND_CLAIM = 2;
292
+ }
293
+
294
+ // Status condition to be applied to the composite resource. Condition may also
295
+ // optionally be applied to the composite resource's associated claim. For
296
+ // detailed information on proper usage of status conditions, please see
297
+ // https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties.
298
+ message Condition {
299
+ // Type of condition in PascalCase.
300
+ string type = 1;
301
+
302
+ // Status of the condition.
303
+ Status status = 2;
304
+
305
+ // Reason contains a programmatic identifier indicating the reason for the
306
+ // condition's last transition. Producers of specific condition types may
307
+ // define expected values and meanings for this field, and whether the values
308
+ // are considered a guaranteed API. The value should be a PascalCase string.
309
+ // This field may not be empty.
310
+ string reason = 3;
311
+
312
+ // Message is a human readable message indicating details about the
313
+ // transition. This may be an empty string.
314
+ optional string message = 4;
315
+
316
+ // The resources this condition targets.
317
+ optional Target target = 5;
318
+ }
319
+
320
+ enum Status {
321
+ STATUS_CONDITION_UNSPECIFIED = 0;
322
+
323
+ STATUS_CONDITION_UNKNOWN = 1;
324
+
325
+ STATUS_CONDITION_TRUE = 2;
326
+
327
+ STATUS_CONDITION_FALSE = 3;
328
+ }
@@ -1,12 +1,22 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # NO CHECKED-IN PROTOBUF GENCODE
3
4
  # source: crossplane/function/proto/v1beta1/run_function.proto
4
- # Protobuf Python Version: 4.25.0
5
+ # Protobuf Python Version: 5.27.2
5
6
  """Generated protocol buffer code."""
6
7
  from google.protobuf import descriptor as _descriptor
7
8
  from google.protobuf import descriptor_pool as _descriptor_pool
9
+ from google.protobuf import runtime_version as _runtime_version
8
10
  from google.protobuf import symbol_database as _symbol_database
9
11
  from google.protobuf.internal import builder as _builder
12
+ _runtime_version.ValidateProtobufRuntimeVersion(
13
+ _runtime_version.Domain.PUBLIC,
14
+ 5,
15
+ 27,
16
+ 2,
17
+ '',
18
+ 'crossplane/function/proto/v1beta1/run_function.proto'
19
+ )
10
20
  # @@protoc_insertion_point(imports)
11
21
 
12
22
  _sym_db = _symbol_database.Default()
@@ -16,59 +26,78 @@ from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2
16
26
  from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2
17
27
 
18
28
 
19
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n4crossplane/function/proto/v1beta1/run_function.proto\x12\x1e\x61piextensions.fn.proto.v1beta1\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1egoogle/protobuf/duration.proto\"\xf5\x03\n\x12RunFunctionRequest\x12\x39\n\x04meta\x18\x01 \x01(\x0b\x32+.apiextensions.fn.proto.v1beta1.RequestMeta\x12\x37\n\x08observed\x18\x02 \x01(\x0b\x32%.apiextensions.fn.proto.v1beta1.State\x12\x36\n\x07\x64\x65sired\x18\x03 \x01(\x0b\x32%.apiextensions.fn.proto.v1beta1.State\x12+\n\x05input\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructH\x00\x88\x01\x01\x12-\n\x07\x63ontext\x18\x05 \x01(\x0b\x32\x17.google.protobuf.StructH\x01\x88\x01\x01\x12_\n\x0f\x65xtra_resources\x18\x06 \x03(\x0b\x32\x46.apiextensions.fn.proto.v1beta1.RunFunctionRequest.ExtraResourcesEntry\x1a`\n\x13\x45xtraResourcesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x38\n\x05value\x18\x02 \x01(\x0b\x32).apiextensions.fn.proto.v1beta1.Resources:\x02\x38\x01\x42\x08\n\x06_inputB\n\n\x08_context\"D\n\tResources\x12\x37\n\x05items\x18\x01 \x03(\x0b\x32(.apiextensions.fn.proto.v1beta1.Resource\"\xc1\x02\n\x13RunFunctionResponse\x12:\n\x04meta\x18\x01 \x01(\x0b\x32,.apiextensions.fn.proto.v1beta1.ResponseMeta\x12\x36\n\x07\x64\x65sired\x18\x02 \x01(\x0b\x32%.apiextensions.fn.proto.v1beta1.State\x12\x37\n\x07results\x18\x03 \x03(\x0b\x32&.apiextensions.fn.proto.v1beta1.Result\x12-\n\x07\x63ontext\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructH\x00\x88\x01\x01\x12\x42\n\x0crequirements\x18\x05 \x01(\x0b\x32,.apiextensions.fn.proto.v1beta1.RequirementsB\n\n\x08_context\"\x1a\n\x0bRequestMeta\x12\x0b\n\x03tag\x18\x01 \x01(\t\"\xd2\x01\n\x0cRequirements\x12Y\n\x0f\x65xtra_resources\x18\x01 \x03(\x0b\x32@.apiextensions.fn.proto.v1beta1.Requirements.ExtraResourcesEntry\x1ag\n\x13\x45xtraResourcesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12?\n\x05value\x18\x02 \x01(\x0b\x32\x30.apiextensions.fn.proto.v1beta1.ResourceSelector:\x02\x38\x01\"\x99\x01\n\x10ResourceSelector\x12\x13\n\x0b\x61pi_version\x18\x01 \x01(\t\x12\x0c\n\x04kind\x18\x02 \x01(\t\x12\x14\n\nmatch_name\x18\x03 \x01(\tH\x00\x12\x43\n\x0cmatch_labels\x18\x04 \x01(\x0b\x32+.apiextensions.fn.proto.v1beta1.MatchLabelsH\x00\x42\x07\n\x05match\"\x85\x01\n\x0bMatchLabels\x12G\n\x06labels\x18\x01 \x03(\x0b\x32\x37.apiextensions.fn.proto.v1beta1.MatchLabels.LabelsEntry\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"P\n\x0cResponseMeta\x12\x0b\n\x03tag\x18\x01 \x01(\t\x12+\n\x03ttl\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationH\x00\x88\x01\x01\x42\x06\n\x04_ttl\"\xe9\x01\n\x05State\x12;\n\tcomposite\x18\x01 \x01(\x0b\x32(.apiextensions.fn.proto.v1beta1.Resource\x12G\n\tresources\x18\x02 \x03(\x0b\x32\x34.apiextensions.fn.proto.v1beta1.State.ResourcesEntry\x1aZ\n\x0eResourcesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x37\n\x05value\x18\x02 \x01(\x0b\x32(.apiextensions.fn.proto.v1beta1.Resource:\x02\x38\x01\"\x82\x02\n\x08Resource\x12)\n\x08resource\x18\x01 \x01(\x0b\x32\x17.google.protobuf.Struct\x12[\n\x12\x63onnection_details\x18\x02 \x03(\x0b\x32?.apiextensions.fn.proto.v1beta1.Resource.ConnectionDetailsEntry\x12\x34\n\x05ready\x18\x03 \x01(\x0e\x32%.apiextensions.fn.proto.v1beta1.Ready\x1a\x38\n\x16\x43onnectionDetailsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x0c:\x02\x38\x01\"U\n\x06Result\x12:\n\x08severity\x18\x01 \x01(\x0e\x32(.apiextensions.fn.proto.v1beta1.Severity\x12\x0f\n\x07message\x18\x02 \x01(\t*?\n\x05Ready\x12\x15\n\x11READY_UNSPECIFIED\x10\x00\x12\x0e\n\nREADY_TRUE\x10\x01\x12\x0f\n\x0bREADY_FALSE\x10\x02*c\n\x08Severity\x12\x18\n\x14SEVERITY_UNSPECIFIED\x10\x00\x12\x12\n\x0eSEVERITY_FATAL\x10\x01\x12\x14\n\x10SEVERITY_WARNING\x10\x02\x12\x13\n\x0fSEVERITY_NORMAL\x10\x03\x32\x91\x01\n\x15\x46unctionRunnerService\x12x\n\x0bRunFunction\x12\x32.apiextensions.fn.proto.v1beta1.RunFunctionRequest\x1a\x33.apiextensions.fn.proto.v1beta1.RunFunctionResponse\"\x00\x62\x06proto3')
29
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n4crossplane/function/proto/v1beta1/run_function.proto\x12\x1e\x61piextensions.fn.proto.v1beta1\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1egoogle/protobuf/duration.proto\"\xb0\x05\n\x12RunFunctionRequest\x12\x39\n\x04meta\x18\x01 \x01(\x0b\x32+.apiextensions.fn.proto.v1beta1.RequestMeta\x12\x37\n\x08observed\x18\x02 \x01(\x0b\x32%.apiextensions.fn.proto.v1beta1.State\x12\x36\n\x07\x64\x65sired\x18\x03 \x01(\x0b\x32%.apiextensions.fn.proto.v1beta1.State\x12+\n\x05input\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructH\x00\x88\x01\x01\x12-\n\x07\x63ontext\x18\x05 \x01(\x0b\x32\x17.google.protobuf.StructH\x01\x88\x01\x01\x12_\n\x0f\x65xtra_resources\x18\x06 \x03(\x0b\x32\x46.apiextensions.fn.proto.v1beta1.RunFunctionRequest.ExtraResourcesEntry\x12X\n\x0b\x63redentials\x18\x07 \x03(\x0b\x32\x43.apiextensions.fn.proto.v1beta1.RunFunctionRequest.CredentialsEntry\x1a`\n\x13\x45xtraResourcesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x38\n\x05value\x18\x02 \x01(\x0b\x32).apiextensions.fn.proto.v1beta1.Resources:\x02\x38\x01\x1a_\n\x10\x43redentialsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12:\n\x05value\x18\x02 \x01(\x0b\x32+.apiextensions.fn.proto.v1beta1.Credentials:\x02\x38\x01\x42\x08\n\x06_inputB\n\n\x08_context\"b\n\x0b\x43redentials\x12I\n\x0f\x63redential_data\x18\x01 \x01(\x0b\x32..apiextensions.fn.proto.v1beta1.CredentialDataH\x00\x42\x08\n\x06source\"\x85\x01\n\x0e\x43redentialData\x12\x46\n\x04\x64\x61ta\x18\x01 \x03(\x0b\x32\x38.apiextensions.fn.proto.v1beta1.CredentialData.DataEntry\x1a+\n\tDataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x0c:\x02\x38\x01\"D\n\tResources\x12\x37\n\x05items\x18\x01 \x03(\x0b\x32(.apiextensions.fn.proto.v1beta1.Resource\"\x80\x03\n\x13RunFunctionResponse\x12:\n\x04meta\x18\x01 \x01(\x0b\x32,.apiextensions.fn.proto.v1beta1.ResponseMeta\x12\x36\n\x07\x64\x65sired\x18\x02 \x01(\x0b\x32%.apiextensions.fn.proto.v1beta1.State\x12\x37\n\x07results\x18\x03 \x03(\x0b\x32&.apiextensions.fn.proto.v1beta1.Result\x12-\n\x07\x63ontext\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructH\x00\x88\x01\x01\x12\x42\n\x0crequirements\x18\x05 \x01(\x0b\x32,.apiextensions.fn.proto.v1beta1.Requirements\x12=\n\nconditions\x18\x06 \x03(\x0b\x32).apiextensions.fn.proto.v1beta1.ConditionB\n\n\x08_context\"\x1a\n\x0bRequestMeta\x12\x0b\n\x03tag\x18\x01 \x01(\t\"\xd2\x01\n\x0cRequirements\x12Y\n\x0f\x65xtra_resources\x18\x01 \x03(\x0b\x32@.apiextensions.fn.proto.v1beta1.Requirements.ExtraResourcesEntry\x1ag\n\x13\x45xtraResourcesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12?\n\x05value\x18\x02 \x01(\x0b\x32\x30.apiextensions.fn.proto.v1beta1.ResourceSelector:\x02\x38\x01\"\x99\x01\n\x10ResourceSelector\x12\x13\n\x0b\x61pi_version\x18\x01 \x01(\t\x12\x0c\n\x04kind\x18\x02 \x01(\t\x12\x14\n\nmatch_name\x18\x03 \x01(\tH\x00\x12\x43\n\x0cmatch_labels\x18\x04 \x01(\x0b\x32+.apiextensions.fn.proto.v1beta1.MatchLabelsH\x00\x42\x07\n\x05match\"\x85\x01\n\x0bMatchLabels\x12G\n\x06labels\x18\x01 \x03(\x0b\x32\x37.apiextensions.fn.proto.v1beta1.MatchLabels.LabelsEntry\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"P\n\x0cResponseMeta\x12\x0b\n\x03tag\x18\x01 \x01(\t\x12+\n\x03ttl\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationH\x00\x88\x01\x01\x42\x06\n\x04_ttl\"\xe9\x01\n\x05State\x12;\n\tcomposite\x18\x01 \x01(\x0b\x32(.apiextensions.fn.proto.v1beta1.Resource\x12G\n\tresources\x18\x02 \x03(\x0b\x32\x34.apiextensions.fn.proto.v1beta1.State.ResourcesEntry\x1aZ\n\x0eResourcesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x37\n\x05value\x18\x02 \x01(\x0b\x32(.apiextensions.fn.proto.v1beta1.Resource:\x02\x38\x01\"\x82\x02\n\x08Resource\x12)\n\x08resource\x18\x01 \x01(\x0b\x32\x17.google.protobuf.Struct\x12[\n\x12\x63onnection_details\x18\x02 \x03(\x0b\x32?.apiextensions.fn.proto.v1beta1.Resource.ConnectionDetailsEntry\x12\x34\n\x05ready\x18\x03 \x01(\x0e\x32%.apiextensions.fn.proto.v1beta1.Ready\x1a\x38\n\x16\x43onnectionDetailsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x0c:\x02\x38\x01\"\xbd\x01\n\x06Result\x12:\n\x08severity\x18\x01 \x01(\x0e\x32(.apiextensions.fn.proto.v1beta1.Severity\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x13\n\x06reason\x18\x03 \x01(\tH\x00\x88\x01\x01\x12;\n\x06target\x18\x04 \x01(\x0e\x32&.apiextensions.fn.proto.v1beta1.TargetH\x01\x88\x01\x01\x42\t\n\x07_reasonB\t\n\x07_target\"\xcb\x01\n\tCondition\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x36\n\x06status\x18\x02 \x01(\x0e\x32&.apiextensions.fn.proto.v1beta1.Status\x12\x0e\n\x06reason\x18\x03 \x01(\t\x12\x14\n\x07message\x18\x04 \x01(\tH\x00\x88\x01\x01\x12;\n\x06target\x18\x05 \x01(\x0e\x32&.apiextensions.fn.proto.v1beta1.TargetH\x01\x88\x01\x01\x42\n\n\x08_messageB\t\n\x07_target*?\n\x05Ready\x12\x15\n\x11READY_UNSPECIFIED\x10\x00\x12\x0e\n\nREADY_TRUE\x10\x01\x12\x0f\n\x0bREADY_FALSE\x10\x02*c\n\x08Severity\x12\x18\n\x14SEVERITY_UNSPECIFIED\x10\x00\x12\x12\n\x0eSEVERITY_FATAL\x10\x01\x12\x14\n\x10SEVERITY_WARNING\x10\x02\x12\x13\n\x0fSEVERITY_NORMAL\x10\x03*V\n\x06Target\x12\x16\n\x12TARGET_UNSPECIFIED\x10\x00\x12\x14\n\x10TARGET_COMPOSITE\x10\x01\x12\x1e\n\x1aTARGET_COMPOSITE_AND_CLAIM\x10\x02*\x7f\n\x06Status\x12 \n\x1cSTATUS_CONDITION_UNSPECIFIED\x10\x00\x12\x1c\n\x18STATUS_CONDITION_UNKNOWN\x10\x01\x12\x19\n\x15STATUS_CONDITION_TRUE\x10\x02\x12\x1a\n\x16STATUS_CONDITION_FALSE\x10\x03\x32\x91\x01\n\x15\x46unctionRunnerService\x12x\n\x0bRunFunction\x12\x32.apiextensions.fn.proto.v1beta1.RunFunctionRequest\x1a\x33.apiextensions.fn.proto.v1beta1.RunFunctionResponse\"\x00\x42\x46ZDgithub.com/crossplane/crossplane/apis/apiextensions/fn/proto/v1beta1b\x06proto3')
20
30
 
21
31
  _globals = globals()
22
32
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
23
33
  _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'crossplane.function.proto.v1beta1.run_function_pb2', _globals)
24
- if _descriptor._USE_C_DESCRIPTORS == False:
25
- DESCRIPTOR._options = None
26
- _globals['_RUNFUNCTIONREQUEST_EXTRARESOURCESENTRY']._options = None
34
+ if not _descriptor._USE_C_DESCRIPTORS:
35
+ _globals['DESCRIPTOR']._loaded_options = None
36
+ _globals['DESCRIPTOR']._serialized_options = b'ZDgithub.com/crossplane/crossplane/apis/apiextensions/fn/proto/v1beta1'
37
+ _globals['_RUNFUNCTIONREQUEST_EXTRARESOURCESENTRY']._loaded_options = None
27
38
  _globals['_RUNFUNCTIONREQUEST_EXTRARESOURCESENTRY']._serialized_options = b'8\001'
28
- _globals['_REQUIREMENTS_EXTRARESOURCESENTRY']._options = None
39
+ _globals['_RUNFUNCTIONREQUEST_CREDENTIALSENTRY']._loaded_options = None
40
+ _globals['_RUNFUNCTIONREQUEST_CREDENTIALSENTRY']._serialized_options = b'8\001'
41
+ _globals['_CREDENTIALDATA_DATAENTRY']._loaded_options = None
42
+ _globals['_CREDENTIALDATA_DATAENTRY']._serialized_options = b'8\001'
43
+ _globals['_REQUIREMENTS_EXTRARESOURCESENTRY']._loaded_options = None
29
44
  _globals['_REQUIREMENTS_EXTRARESOURCESENTRY']._serialized_options = b'8\001'
30
- _globals['_MATCHLABELS_LABELSENTRY']._options = None
45
+ _globals['_MATCHLABELS_LABELSENTRY']._loaded_options = None
31
46
  _globals['_MATCHLABELS_LABELSENTRY']._serialized_options = b'8\001'
32
- _globals['_STATE_RESOURCESENTRY']._options = None
47
+ _globals['_STATE_RESOURCESENTRY']._loaded_options = None
33
48
  _globals['_STATE_RESOURCESENTRY']._serialized_options = b'8\001'
34
- _globals['_RESOURCE_CONNECTIONDETAILSENTRY']._options = None
49
+ _globals['_RESOURCE_CONNECTIONDETAILSENTRY']._loaded_options = None
35
50
  _globals['_RESOURCE_CONNECTIONDETAILSENTRY']._serialized_options = b'8\001'
36
- _globals['_READY']._serialized_start=2247
37
- _globals['_READY']._serialized_end=2310
38
- _globals['_SEVERITY']._serialized_start=2312
39
- _globals['_SEVERITY']._serialized_end=2411
51
+ _globals['_READY']._serialized_start=3044
52
+ _globals['_READY']._serialized_end=3107
53
+ _globals['_SEVERITY']._serialized_start=3109
54
+ _globals['_SEVERITY']._serialized_end=3208
55
+ _globals['_TARGET']._serialized_start=3210
56
+ _globals['_TARGET']._serialized_end=3296
57
+ _globals['_STATUS']._serialized_start=3298
58
+ _globals['_STATUS']._serialized_end=3425
40
59
  _globals['_RUNFUNCTIONREQUEST']._serialized_start=151
41
- _globals['_RUNFUNCTIONREQUEST']._serialized_end=652
42
- _globals['_RUNFUNCTIONREQUEST_EXTRARESOURCESENTRY']._serialized_start=534
43
- _globals['_RUNFUNCTIONREQUEST_EXTRARESOURCESENTRY']._serialized_end=630
44
- _globals['_RESOURCES']._serialized_start=654
45
- _globals['_RESOURCES']._serialized_end=722
46
- _globals['_RUNFUNCTIONRESPONSE']._serialized_start=725
47
- _globals['_RUNFUNCTIONRESPONSE']._serialized_end=1046
48
- _globals['_REQUESTMETA']._serialized_start=1048
49
- _globals['_REQUESTMETA']._serialized_end=1074
50
- _globals['_REQUIREMENTS']._serialized_start=1077
51
- _globals['_REQUIREMENTS']._serialized_end=1287
52
- _globals['_REQUIREMENTS_EXTRARESOURCESENTRY']._serialized_start=1184
53
- _globals['_REQUIREMENTS_EXTRARESOURCESENTRY']._serialized_end=1287
54
- _globals['_RESOURCESELECTOR']._serialized_start=1290
55
- _globals['_RESOURCESELECTOR']._serialized_end=1443
56
- _globals['_MATCHLABELS']._serialized_start=1446
57
- _globals['_MATCHLABELS']._serialized_end=1579
58
- _globals['_MATCHLABELS_LABELSENTRY']._serialized_start=1534
59
- _globals['_MATCHLABELS_LABELSENTRY']._serialized_end=1579
60
- _globals['_RESPONSEMETA']._serialized_start=1581
61
- _globals['_RESPONSEMETA']._serialized_end=1661
62
- _globals['_STATE']._serialized_start=1664
63
- _globals['_STATE']._serialized_end=1897
64
- _globals['_STATE_RESOURCESENTRY']._serialized_start=1807
65
- _globals['_STATE_RESOURCESENTRY']._serialized_end=1897
66
- _globals['_RESOURCE']._serialized_start=1900
67
- _globals['_RESOURCE']._serialized_end=2158
68
- _globals['_RESOURCE_CONNECTIONDETAILSENTRY']._serialized_start=2102
69
- _globals['_RESOURCE_CONNECTIONDETAILSENTRY']._serialized_end=2158
70
- _globals['_RESULT']._serialized_start=2160
71
- _globals['_RESULT']._serialized_end=2245
72
- _globals['_FUNCTIONRUNNERSERVICE']._serialized_start=2414
73
- _globals['_FUNCTIONRUNNERSERVICE']._serialized_end=2559
60
+ _globals['_RUNFUNCTIONREQUEST']._serialized_end=839
61
+ _globals['_RUNFUNCTIONREQUEST_EXTRARESOURCESENTRY']._serialized_start=624
62
+ _globals['_RUNFUNCTIONREQUEST_EXTRARESOURCESENTRY']._serialized_end=720
63
+ _globals['_RUNFUNCTIONREQUEST_CREDENTIALSENTRY']._serialized_start=722
64
+ _globals['_RUNFUNCTIONREQUEST_CREDENTIALSENTRY']._serialized_end=817
65
+ _globals['_CREDENTIALS']._serialized_start=841
66
+ _globals['_CREDENTIALS']._serialized_end=939
67
+ _globals['_CREDENTIALDATA']._serialized_start=942
68
+ _globals['_CREDENTIALDATA']._serialized_end=1075
69
+ _globals['_CREDENTIALDATA_DATAENTRY']._serialized_start=1032
70
+ _globals['_CREDENTIALDATA_DATAENTRY']._serialized_end=1075
71
+ _globals['_RESOURCES']._serialized_start=1077
72
+ _globals['_RESOURCES']._serialized_end=1145
73
+ _globals['_RUNFUNCTIONRESPONSE']._serialized_start=1148
74
+ _globals['_RUNFUNCTIONRESPONSE']._serialized_end=1532
75
+ _globals['_REQUESTMETA']._serialized_start=1534
76
+ _globals['_REQUESTMETA']._serialized_end=1560
77
+ _globals['_REQUIREMENTS']._serialized_start=1563
78
+ _globals['_REQUIREMENTS']._serialized_end=1773
79
+ _globals['_REQUIREMENTS_EXTRARESOURCESENTRY']._serialized_start=1670
80
+ _globals['_REQUIREMENTS_EXTRARESOURCESENTRY']._serialized_end=1773
81
+ _globals['_RESOURCESELECTOR']._serialized_start=1776
82
+ _globals['_RESOURCESELECTOR']._serialized_end=1929
83
+ _globals['_MATCHLABELS']._serialized_start=1932
84
+ _globals['_MATCHLABELS']._serialized_end=2065
85
+ _globals['_MATCHLABELS_LABELSENTRY']._serialized_start=2020
86
+ _globals['_MATCHLABELS_LABELSENTRY']._serialized_end=2065
87
+ _globals['_RESPONSEMETA']._serialized_start=2067
88
+ _globals['_RESPONSEMETA']._serialized_end=2147
89
+ _globals['_STATE']._serialized_start=2150
90
+ _globals['_STATE']._serialized_end=2383
91
+ _globals['_STATE_RESOURCESENTRY']._serialized_start=2293
92
+ _globals['_STATE_RESOURCESENTRY']._serialized_end=2383
93
+ _globals['_RESOURCE']._serialized_start=2386
94
+ _globals['_RESOURCE']._serialized_end=2644
95
+ _globals['_RESOURCE_CONNECTIONDETAILSENTRY']._serialized_start=2588
96
+ _globals['_RESOURCE_CONNECTIONDETAILSENTRY']._serialized_end=2644
97
+ _globals['_RESULT']._serialized_start=2647
98
+ _globals['_RESULT']._serialized_end=2836
99
+ _globals['_CONDITION']._serialized_start=2839
100
+ _globals['_CONDITION']._serialized_end=3042
101
+ _globals['_FUNCTIONRUNNERSERVICE']._serialized_start=3428
102
+ _globals['_FUNCTIONRUNNERSERVICE']._serialized_end=3573
74
103
  # @@protoc_insertion_point(module_scope)
@@ -20,6 +20,19 @@ class Severity(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
20
20
  SEVERITY_FATAL: _ClassVar[Severity]
21
21
  SEVERITY_WARNING: _ClassVar[Severity]
22
22
  SEVERITY_NORMAL: _ClassVar[Severity]
23
+
24
+ class Target(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
25
+ __slots__ = ()
26
+ TARGET_UNSPECIFIED: _ClassVar[Target]
27
+ TARGET_COMPOSITE: _ClassVar[Target]
28
+ TARGET_COMPOSITE_AND_CLAIM: _ClassVar[Target]
29
+
30
+ class Status(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
31
+ __slots__ = ()
32
+ STATUS_CONDITION_UNSPECIFIED: _ClassVar[Status]
33
+ STATUS_CONDITION_UNKNOWN: _ClassVar[Status]
34
+ STATUS_CONDITION_TRUE: _ClassVar[Status]
35
+ STATUS_CONDITION_FALSE: _ClassVar[Status]
23
36
  READY_UNSPECIFIED: Ready
24
37
  READY_TRUE: Ready
25
38
  READY_FALSE: Ready
@@ -27,9 +40,16 @@ SEVERITY_UNSPECIFIED: Severity
27
40
  SEVERITY_FATAL: Severity
28
41
  SEVERITY_WARNING: Severity
29
42
  SEVERITY_NORMAL: Severity
43
+ TARGET_UNSPECIFIED: Target
44
+ TARGET_COMPOSITE: Target
45
+ TARGET_COMPOSITE_AND_CLAIM: Target
46
+ STATUS_CONDITION_UNSPECIFIED: Status
47
+ STATUS_CONDITION_UNKNOWN: Status
48
+ STATUS_CONDITION_TRUE: Status
49
+ STATUS_CONDITION_FALSE: Status
30
50
 
31
51
  class RunFunctionRequest(_message.Message):
32
- __slots__ = ("meta", "observed", "desired", "input", "context", "extra_resources")
52
+ __slots__ = ("meta", "observed", "desired", "input", "context", "extra_resources", "credentials")
33
53
  class ExtraResourcesEntry(_message.Message):
34
54
  __slots__ = ("key", "value")
35
55
  KEY_FIELD_NUMBER: _ClassVar[int]
@@ -37,19 +57,47 @@ class RunFunctionRequest(_message.Message):
37
57
  key: str
38
58
  value: Resources
39
59
  def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[Resources, _Mapping]] = ...) -> None: ...
60
+ class CredentialsEntry(_message.Message):
61
+ __slots__ = ("key", "value")
62
+ KEY_FIELD_NUMBER: _ClassVar[int]
63
+ VALUE_FIELD_NUMBER: _ClassVar[int]
64
+ key: str
65
+ value: Credentials
66
+ def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[Credentials, _Mapping]] = ...) -> None: ...
40
67
  META_FIELD_NUMBER: _ClassVar[int]
41
68
  OBSERVED_FIELD_NUMBER: _ClassVar[int]
42
69
  DESIRED_FIELD_NUMBER: _ClassVar[int]
43
70
  INPUT_FIELD_NUMBER: _ClassVar[int]
44
71
  CONTEXT_FIELD_NUMBER: _ClassVar[int]
45
72
  EXTRA_RESOURCES_FIELD_NUMBER: _ClassVar[int]
73
+ CREDENTIALS_FIELD_NUMBER: _ClassVar[int]
46
74
  meta: RequestMeta
47
75
  observed: State
48
76
  desired: State
49
77
  input: _struct_pb2.Struct
50
78
  context: _struct_pb2.Struct
51
79
  extra_resources: _containers.MessageMap[str, Resources]
52
- def __init__(self, meta: _Optional[_Union[RequestMeta, _Mapping]] = ..., observed: _Optional[_Union[State, _Mapping]] = ..., desired: _Optional[_Union[State, _Mapping]] = ..., input: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ..., context: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ..., extra_resources: _Optional[_Mapping[str, Resources]] = ...) -> None: ...
80
+ credentials: _containers.MessageMap[str, Credentials]
81
+ def __init__(self, meta: _Optional[_Union[RequestMeta, _Mapping]] = ..., observed: _Optional[_Union[State, _Mapping]] = ..., desired: _Optional[_Union[State, _Mapping]] = ..., input: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ..., context: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ..., extra_resources: _Optional[_Mapping[str, Resources]] = ..., credentials: _Optional[_Mapping[str, Credentials]] = ...) -> None: ...
82
+
83
+ class Credentials(_message.Message):
84
+ __slots__ = ("credential_data",)
85
+ CREDENTIAL_DATA_FIELD_NUMBER: _ClassVar[int]
86
+ credential_data: CredentialData
87
+ def __init__(self, credential_data: _Optional[_Union[CredentialData, _Mapping]] = ...) -> None: ...
88
+
89
+ class CredentialData(_message.Message):
90
+ __slots__ = ("data",)
91
+ class DataEntry(_message.Message):
92
+ __slots__ = ("key", "value")
93
+ KEY_FIELD_NUMBER: _ClassVar[int]
94
+ VALUE_FIELD_NUMBER: _ClassVar[int]
95
+ key: str
96
+ value: bytes
97
+ def __init__(self, key: _Optional[str] = ..., value: _Optional[bytes] = ...) -> None: ...
98
+ DATA_FIELD_NUMBER: _ClassVar[int]
99
+ data: _containers.ScalarMap[str, bytes]
100
+ def __init__(self, data: _Optional[_Mapping[str, bytes]] = ...) -> None: ...
53
101
 
54
102
  class Resources(_message.Message):
55
103
  __slots__ = ("items",)
@@ -58,18 +106,20 @@ class Resources(_message.Message):
58
106
  def __init__(self, items: _Optional[_Iterable[_Union[Resource, _Mapping]]] = ...) -> None: ...
59
107
 
60
108
  class RunFunctionResponse(_message.Message):
61
- __slots__ = ("meta", "desired", "results", "context", "requirements")
109
+ __slots__ = ("meta", "desired", "results", "context", "requirements", "conditions")
62
110
  META_FIELD_NUMBER: _ClassVar[int]
63
111
  DESIRED_FIELD_NUMBER: _ClassVar[int]
64
112
  RESULTS_FIELD_NUMBER: _ClassVar[int]
65
113
  CONTEXT_FIELD_NUMBER: _ClassVar[int]
66
114
  REQUIREMENTS_FIELD_NUMBER: _ClassVar[int]
115
+ CONDITIONS_FIELD_NUMBER: _ClassVar[int]
67
116
  meta: ResponseMeta
68
117
  desired: State
69
118
  results: _containers.RepeatedCompositeFieldContainer[Result]
70
119
  context: _struct_pb2.Struct
71
120
  requirements: Requirements
72
- def __init__(self, meta: _Optional[_Union[ResponseMeta, _Mapping]] = ..., desired: _Optional[_Union[State, _Mapping]] = ..., results: _Optional[_Iterable[_Union[Result, _Mapping]]] = ..., context: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ..., requirements: _Optional[_Union[Requirements, _Mapping]] = ...) -> None: ...
121
+ conditions: _containers.RepeatedCompositeFieldContainer[Condition]
122
+ def __init__(self, meta: _Optional[_Union[ResponseMeta, _Mapping]] = ..., desired: _Optional[_Union[State, _Mapping]] = ..., results: _Optional[_Iterable[_Union[Result, _Mapping]]] = ..., context: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ..., requirements: _Optional[_Union[Requirements, _Mapping]] = ..., conditions: _Optional[_Iterable[_Union[Condition, _Mapping]]] = ...) -> None: ...
73
123
 
74
124
  class RequestMeta(_message.Message):
75
125
  __slots__ = ("tag",)
@@ -156,9 +206,27 @@ class Resource(_message.Message):
156
206
  def __init__(self, resource: _Optional[_Union[_struct_pb2.Struct, _Mapping]] = ..., connection_details: _Optional[_Mapping[str, bytes]] = ..., ready: _Optional[_Union[Ready, str]] = ...) -> None: ...
157
207
 
158
208
  class Result(_message.Message):
159
- __slots__ = ("severity", "message")
209
+ __slots__ = ("severity", "message", "reason", "target")
160
210
  SEVERITY_FIELD_NUMBER: _ClassVar[int]
161
211
  MESSAGE_FIELD_NUMBER: _ClassVar[int]
212
+ REASON_FIELD_NUMBER: _ClassVar[int]
213
+ TARGET_FIELD_NUMBER: _ClassVar[int]
162
214
  severity: Severity
163
215
  message: str
164
- def __init__(self, severity: _Optional[_Union[Severity, str]] = ..., message: _Optional[str] = ...) -> None: ...
216
+ reason: str
217
+ target: Target
218
+ def __init__(self, severity: _Optional[_Union[Severity, str]] = ..., message: _Optional[str] = ..., reason: _Optional[str] = ..., target: _Optional[_Union[Target, str]] = ...) -> None: ...
219
+
220
+ class Condition(_message.Message):
221
+ __slots__ = ("type", "status", "reason", "message", "target")
222
+ TYPE_FIELD_NUMBER: _ClassVar[int]
223
+ STATUS_FIELD_NUMBER: _ClassVar[int]
224
+ REASON_FIELD_NUMBER: _ClassVar[int]
225
+ MESSAGE_FIELD_NUMBER: _ClassVar[int]
226
+ TARGET_FIELD_NUMBER: _ClassVar[int]
227
+ type: str
228
+ status: Status
229
+ reason: str
230
+ message: str
231
+ target: Target
232
+ def __init__(self, type: _Optional[str] = ..., status: _Optional[_Union[Status, str]] = ..., reason: _Optional[str] = ..., message: _Optional[str] = ..., target: _Optional[_Union[Target, str]] = ...) -> None: ...
@@ -1,9 +1,29 @@
1
1
  # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2
2
  """Client and server classes corresponding to protobuf-defined services."""
3
3
  import grpc
4
+ import warnings
4
5
 
5
6
  from crossplane.function.proto.v1beta1 import run_function_pb2 as crossplane_dot_function_dot_proto_dot_v1beta1_dot_run__function__pb2
6
7
 
8
+ GRPC_GENERATED_VERSION = '1.66.0'
9
+ GRPC_VERSION = grpc.__version__
10
+ _version_not_supported = False
11
+
12
+ try:
13
+ from grpc._utilities import first_version_is_lower
14
+ _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
15
+ except ImportError:
16
+ _version_not_supported = True
17
+
18
+ if _version_not_supported:
19
+ raise RuntimeError(
20
+ f'The grpc package installed is at version {GRPC_VERSION},'
21
+ + f' but the generated code in crossplane/function/proto/v1beta1/run_function_pb2_grpc.py depends on'
22
+ + f' grpcio>={GRPC_GENERATED_VERSION}.'
23
+ + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
24
+ + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
25
+ )
26
+
7
27
 
8
28
  class FunctionRunnerServiceStub(object):
9
29
  """A FunctionRunnerService is a Composition Function.
@@ -19,7 +39,7 @@ class FunctionRunnerServiceStub(object):
19
39
  '/apiextensions.fn.proto.v1beta1.FunctionRunnerService/RunFunction',
20
40
  request_serializer=crossplane_dot_function_dot_proto_dot_v1beta1_dot_run__function__pb2.RunFunctionRequest.SerializeToString,
21
41
  response_deserializer=crossplane_dot_function_dot_proto_dot_v1beta1_dot_run__function__pb2.RunFunctionResponse.FromString,
22
- )
42
+ _registered_method=True)
23
43
 
24
44
 
25
45
  class FunctionRunnerServiceServicer(object):
@@ -45,6 +65,7 @@ def add_FunctionRunnerServiceServicer_to_server(servicer, server):
45
65
  generic_handler = grpc.method_handlers_generic_handler(
46
66
  'apiextensions.fn.proto.v1beta1.FunctionRunnerService', rpc_method_handlers)
47
67
  server.add_generic_rpc_handlers((generic_handler,))
68
+ server.add_registered_method_handlers('apiextensions.fn.proto.v1beta1.FunctionRunnerService', rpc_method_handlers)
48
69
 
49
70
 
50
71
  # This class is part of an EXPERIMENTAL API.
@@ -63,8 +84,18 @@ class FunctionRunnerService(object):
63
84
  wait_for_ready=None,
64
85
  timeout=None,
65
86
  metadata=None):
66
- return grpc.experimental.unary_unary(request, target, '/apiextensions.fn.proto.v1beta1.FunctionRunnerService/RunFunction',
87
+ return grpc.experimental.unary_unary(
88
+ request,
89
+ target,
90
+ '/apiextensions.fn.proto.v1beta1.FunctionRunnerService/RunFunction',
67
91
  crossplane_dot_function_dot_proto_dot_v1beta1_dot_run__function__pb2.RunFunctionRequest.SerializeToString,
68
92
  crossplane_dot_function_dot_proto_dot_v1beta1_dot_run__function__pb2.RunFunctionResponse.FromString,
69
- options, channel_credentials,
70
- insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
93
+ options,
94
+ channel_credentials,
95
+ insecure,
96
+ call_credentials,
97
+ compression,
98
+ wait_for_ready,
99
+ timeout,
100
+ metadata,
101
+ _registered_method=True)
@@ -42,7 +42,10 @@ def struct_to_dict(s: structpb.Struct) -> dict:
42
42
  protobuf struct. This function makes it possible to convert resources to a
43
43
  dictionary.
44
44
  """
45
- return dict(s)
45
+ return {
46
+ k: (struct_to_dict(v) if isinstance(v, structpb.Struct) else v)
47
+ for k, v in s.items()
48
+ }
46
49
 
47
50
 
48
51
  @dataclasses.dataclass
@@ -106,3 +109,24 @@ def get_condition(resource: structpb.Struct, typ: str) -> Condition:
106
109
  return condition
107
110
 
108
111
  return unknown
112
+
113
+
114
+ @dataclasses.dataclass
115
+ class Credentials:
116
+ """Credentials."""
117
+
118
+ type: str
119
+ data: dict
120
+
121
+
122
+ def get_credentials(req: structpb.Struct, name: str) -> Credentials:
123
+ """Get the supplied credentials."""
124
+ empty = Credentials(type="data", data={})
125
+ if "credentials" not in req:
126
+ return empty
127
+ if name not in req["credentials"]:
128
+ return empty
129
+ return Credentials(
130
+ type=req["credentials"][name]["type"],
131
+ data=struct_to_dict(req["credentials"][name]["data"]),
132
+ )