@pulumi/pulumi 3.142.0-alpha.x1837a70 → 3.142.1-alpha.x121eb89

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.
@@ -308,6 +308,28 @@ function deserialize_pulumirpc_PluginInfo(buffer_arg) {
308
308
  return pulumi_plugin_pb.PluginInfo.deserializeBinary(new Uint8Array(buffer_arg));
309
309
  }
310
310
 
311
+ function serialize_pulumirpc_ProviderHandshakeRequest(arg) {
312
+ if (!(arg instanceof pulumi_provider_pb.ProviderHandshakeRequest)) {
313
+ throw new Error('Expected argument of type pulumirpc.ProviderHandshakeRequest');
314
+ }
315
+ return Buffer.from(arg.serializeBinary());
316
+ }
317
+
318
+ function deserialize_pulumirpc_ProviderHandshakeRequest(buffer_arg) {
319
+ return pulumi_provider_pb.ProviderHandshakeRequest.deserializeBinary(new Uint8Array(buffer_arg));
320
+ }
321
+
322
+ function serialize_pulumirpc_ProviderHandshakeResponse(arg) {
323
+ if (!(arg instanceof pulumi_provider_pb.ProviderHandshakeResponse)) {
324
+ throw new Error('Expected argument of type pulumirpc.ProviderHandshakeResponse');
325
+ }
326
+ return Buffer.from(arg.serializeBinary());
327
+ }
328
+
329
+ function deserialize_pulumirpc_ProviderHandshakeResponse(buffer_arg) {
330
+ return pulumi_provider_pb.ProviderHandshakeResponse.deserializeBinary(new Uint8Array(buffer_arg));
331
+ }
332
+
311
333
  function serialize_pulumirpc_ReadRequest(arg) {
312
334
  if (!(arg instanceof pulumi_provider_pb.ReadRequest)) {
313
335
  throw new Error('Expected argument of type pulumirpc.ReadRequest');
@@ -358,6 +380,22 @@ function deserialize_pulumirpc_UpdateResponse(buffer_arg) {
358
380
  // operations on resources and invocations of functions. Resource providers are primarily managed by the Pulumi engine
359
381
  // as part of a deployment in order to interact with the cloud providers underpinning a Pulumi application.
360
382
  var ResourceProviderService = exports.ResourceProviderService = {
383
+ // `Handshake` is the first call made by the engine to a provider. It is used to pass the engine's address to the
384
+ // provider so that it may establish its own connections back, and to establish protocol configuration that will be
385
+ // used to communicate between the two parties. Providers that support `Handshake` implicitly support the set of
386
+ // feature flags previously handled by `Configure` prior to `Handshake`'s introduction, such as secrets and resource
387
+ // references.
388
+ handshake: {
389
+ path: '/pulumirpc.ResourceProvider/Handshake',
390
+ requestStream: false,
391
+ responseStream: false,
392
+ requestType: pulumi_provider_pb.ProviderHandshakeRequest,
393
+ responseType: pulumi_provider_pb.ProviderHandshakeResponse,
394
+ requestSerialize: serialize_pulumirpc_ProviderHandshakeRequest,
395
+ requestDeserialize: deserialize_pulumirpc_ProviderHandshakeRequest,
396
+ responseSerialize: serialize_pulumirpc_ProviderHandshakeResponse,
397
+ responseDeserialize: deserialize_pulumirpc_ProviderHandshakeResponse,
398
+ },
361
399
  // `Parameterize` is the primary means of supporting [parameterized providers](parameterized-providers), which allow
362
400
  // a caller to change a provider's behavior ahead of its [configuration](pulumirpc.ResourceProvider.Configure) and
363
401
  // subsequent use. Where a [](pulumirpc.ResourceProvider.Configure) call allows a caller to influence provider
@@ -458,7 +496,7 @@ diffConfig: {
458
496
  responseSerialize: serialize_pulumirpc_DiffResponse,
459
497
  responseDeserialize: deserialize_pulumirpc_DiffResponse,
460
498
  },
461
- // `Configure` is the final stage in configuring a provider instance. Callers supply two sets of data:
499
+ // `Configure` is the final stage in configuring a provider instance. Callers may supply two sets of data:
462
500
  //
463
501
  // * Provider-specific configuration, which is the set of inputs that have been validated by a previous
464
502
  // [](pulumirpc.ResourceProvider.CheckConfig) call.
@@ -470,6 +508,19 @@ diffConfig: {
470
508
  // Providers may expect a *single* call to `Configure`. If a call to `Configure` is missing required configuration,
471
509
  // the provider may return a set of error details containing [](pulumirpc.ConfigureErrorMissingKeys) values to
472
510
  // indicate which keys are missing.
511
+ //
512
+ // :::{important}
513
+ // The use of `Configure` to configure protocol features is deprecated in favour of the
514
+ // [](pulumirpc.ResourceProvider.Handshake) method, which should be implemented by newer providers. To enable
515
+ // compatibility between older engines and providers:
516
+ //
517
+ // * Callers which call `Handshake` *must* call `Configure` with flags such as `acceptSecrets` and `acceptResources`
518
+ // set to `true`, since these features predate the introduction of `Handshake` and thus `Handshake`-aware callers
519
+ // must support them. See [](pulumirpc.ConfigureRequest) for more information.
520
+ // * Providers which implement `Handshake` *must* support flags such as `acceptSecrets` and `acceptResources`, and
521
+ // indicate as such by always returning `true` for these fields in [](pulumirpc.ConfigureResponse). See
522
+ // [](pulumirpc.ConfigureResponse) for more information.
523
+ // :::
473
524
  configure: {
474
525
  path: '/pulumirpc.ResourceProvider/Configure',
475
526
  requestStream: false,
@@ -9,6 +9,55 @@ import * as pulumi_plugin_pb from "./plugin_pb";
9
9
  import * as google_protobuf_empty_pb from "google-protobuf/google/protobuf/empty_pb";
10
10
  import * as google_protobuf_struct_pb from "google-protobuf/google/protobuf/struct_pb";
11
11
 
12
+ export class ProviderHandshakeRequest extends jspb.Message {
13
+ getEngineAddress(): string;
14
+ setEngineAddress(value: string): ProviderHandshakeRequest;
15
+
16
+ hasRootDirectory(): boolean;
17
+ clearRootDirectory(): void;
18
+ getRootDirectory(): string | undefined;
19
+ setRootDirectory(value: string): ProviderHandshakeRequest;
20
+
21
+ hasProgramDirectory(): boolean;
22
+ clearProgramDirectory(): void;
23
+ getProgramDirectory(): string | undefined;
24
+ setProgramDirectory(value: string): ProviderHandshakeRequest;
25
+
26
+ serializeBinary(): Uint8Array;
27
+ toObject(includeInstance?: boolean): ProviderHandshakeRequest.AsObject;
28
+ static toObject(includeInstance: boolean, msg: ProviderHandshakeRequest): ProviderHandshakeRequest.AsObject;
29
+ static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
30
+ static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
31
+ static serializeBinaryToWriter(message: ProviderHandshakeRequest, writer: jspb.BinaryWriter): void;
32
+ static deserializeBinary(bytes: Uint8Array): ProviderHandshakeRequest;
33
+ static deserializeBinaryFromReader(message: ProviderHandshakeRequest, reader: jspb.BinaryReader): ProviderHandshakeRequest;
34
+ }
35
+
36
+ export namespace ProviderHandshakeRequest {
37
+ export type AsObject = {
38
+ engineAddress: string,
39
+ rootDirectory?: string,
40
+ programDirectory?: string,
41
+ }
42
+ }
43
+
44
+ export class ProviderHandshakeResponse extends jspb.Message {
45
+
46
+ serializeBinary(): Uint8Array;
47
+ toObject(includeInstance?: boolean): ProviderHandshakeResponse.AsObject;
48
+ static toObject(includeInstance: boolean, msg: ProviderHandshakeResponse): ProviderHandshakeResponse.AsObject;
49
+ static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
50
+ static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
51
+ static serializeBinaryToWriter(message: ProviderHandshakeResponse, writer: jspb.BinaryWriter): void;
52
+ static deserializeBinary(bytes: Uint8Array): ProviderHandshakeResponse;
53
+ static deserializeBinaryFromReader(message: ProviderHandshakeResponse, reader: jspb.BinaryReader): ProviderHandshakeResponse;
54
+ }
55
+
56
+ export namespace ProviderHandshakeResponse {
57
+ export type AsObject = {
58
+ }
59
+ }
60
+
12
61
  export class ParameterizeRequest extends jspb.Message {
13
62
 
14
63
  hasArgs(): boolean;
@@ -61,10 +61,54 @@ goog.exportSymbol('proto.pulumirpc.ParameterizeRequest.ParametersValue', null, g
61
61
  goog.exportSymbol('proto.pulumirpc.ParameterizeResponse', null, global);
62
62
  goog.exportSymbol('proto.pulumirpc.PropertyDiff', null, global);
63
63
  goog.exportSymbol('proto.pulumirpc.PropertyDiff.Kind', null, global);
64
+ goog.exportSymbol('proto.pulumirpc.ProviderHandshakeRequest', null, global);
65
+ goog.exportSymbol('proto.pulumirpc.ProviderHandshakeResponse', null, global);
64
66
  goog.exportSymbol('proto.pulumirpc.ReadRequest', null, global);
65
67
  goog.exportSymbol('proto.pulumirpc.ReadResponse', null, global);
66
68
  goog.exportSymbol('proto.pulumirpc.UpdateRequest', null, global);
67
69
  goog.exportSymbol('proto.pulumirpc.UpdateResponse', null, global);
70
+ /**
71
+ * Generated by JsPbCodeGenerator.
72
+ * @param {Array=} opt_data Optional initial data array, typically from a
73
+ * server response, or constructed directly in Javascript. The array is used
74
+ * in place and becomes part of the constructed object. It is not cloned.
75
+ * If no data is provided, the constructed object will be empty, but still
76
+ * valid.
77
+ * @extends {jspb.Message}
78
+ * @constructor
79
+ */
80
+ proto.pulumirpc.ProviderHandshakeRequest = function(opt_data) {
81
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
82
+ };
83
+ goog.inherits(proto.pulumirpc.ProviderHandshakeRequest, jspb.Message);
84
+ if (goog.DEBUG && !COMPILED) {
85
+ /**
86
+ * @public
87
+ * @override
88
+ */
89
+ proto.pulumirpc.ProviderHandshakeRequest.displayName = 'proto.pulumirpc.ProviderHandshakeRequest';
90
+ }
91
+ /**
92
+ * Generated by JsPbCodeGenerator.
93
+ * @param {Array=} opt_data Optional initial data array, typically from a
94
+ * server response, or constructed directly in Javascript. The array is used
95
+ * in place and becomes part of the constructed object. It is not cloned.
96
+ * If no data is provided, the constructed object will be empty, but still
97
+ * valid.
98
+ * @extends {jspb.Message}
99
+ * @constructor
100
+ */
101
+ proto.pulumirpc.ProviderHandshakeResponse = function(opt_data) {
102
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
103
+ };
104
+ goog.inherits(proto.pulumirpc.ProviderHandshakeResponse, jspb.Message);
105
+ if (goog.DEBUG && !COMPILED) {
106
+ /**
107
+ * @public
108
+ * @override
109
+ */
110
+ proto.pulumirpc.ProviderHandshakeResponse.displayName = 'proto.pulumirpc.ProviderHandshakeResponse';
111
+ }
68
112
  /**
69
113
  * Generated by JsPbCodeGenerator.
70
114
  * @param {Array=} opt_data Optional initial data array, typically from a
@@ -906,6 +950,333 @@ if (goog.DEBUG && !COMPILED) {
906
950
  proto.pulumirpc.GetMappingsResponse.displayName = 'proto.pulumirpc.GetMappingsResponse';
907
951
  }
908
952
 
953
+
954
+
955
+ if (jspb.Message.GENERATE_TO_OBJECT) {
956
+ /**
957
+ * Creates an object representation of this proto.
958
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
959
+ * Optional fields that are not set will be set to undefined.
960
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
961
+ * For the list of reserved names please see:
962
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
963
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
964
+ * JSPB instance for transitional soy proto support:
965
+ * http://goto/soy-param-migration
966
+ * @return {!Object}
967
+ */
968
+ proto.pulumirpc.ProviderHandshakeRequest.prototype.toObject = function(opt_includeInstance) {
969
+ return proto.pulumirpc.ProviderHandshakeRequest.toObject(opt_includeInstance, this);
970
+ };
971
+
972
+
973
+ /**
974
+ * Static version of the {@see toObject} method.
975
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
976
+ * the JSPB instance for transitional soy proto support:
977
+ * http://goto/soy-param-migration
978
+ * @param {!proto.pulumirpc.ProviderHandshakeRequest} msg The msg instance to transform.
979
+ * @return {!Object}
980
+ * @suppress {unusedLocalVariables} f is only used for nested messages
981
+ */
982
+ proto.pulumirpc.ProviderHandshakeRequest.toObject = function(includeInstance, msg) {
983
+ var f, obj = {
984
+ engineAddress: jspb.Message.getFieldWithDefault(msg, 1, ""),
985
+ rootDirectory: jspb.Message.getFieldWithDefault(msg, 2, ""),
986
+ programDirectory: jspb.Message.getFieldWithDefault(msg, 3, "")
987
+ };
988
+
989
+ if (includeInstance) {
990
+ obj.$jspbMessageInstance = msg;
991
+ }
992
+ return obj;
993
+ };
994
+ }
995
+
996
+
997
+ /**
998
+ * Deserializes binary data (in protobuf wire format).
999
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
1000
+ * @return {!proto.pulumirpc.ProviderHandshakeRequest}
1001
+ */
1002
+ proto.pulumirpc.ProviderHandshakeRequest.deserializeBinary = function(bytes) {
1003
+ var reader = new jspb.BinaryReader(bytes);
1004
+ var msg = new proto.pulumirpc.ProviderHandshakeRequest;
1005
+ return proto.pulumirpc.ProviderHandshakeRequest.deserializeBinaryFromReader(msg, reader);
1006
+ };
1007
+
1008
+
1009
+ /**
1010
+ * Deserializes binary data (in protobuf wire format) from the
1011
+ * given reader into the given message object.
1012
+ * @param {!proto.pulumirpc.ProviderHandshakeRequest} msg The message object to deserialize into.
1013
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
1014
+ * @return {!proto.pulumirpc.ProviderHandshakeRequest}
1015
+ */
1016
+ proto.pulumirpc.ProviderHandshakeRequest.deserializeBinaryFromReader = function(msg, reader) {
1017
+ while (reader.nextField()) {
1018
+ if (reader.isEndGroup()) {
1019
+ break;
1020
+ }
1021
+ var field = reader.getFieldNumber();
1022
+ switch (field) {
1023
+ case 1:
1024
+ var value = /** @type {string} */ (reader.readString());
1025
+ msg.setEngineAddress(value);
1026
+ break;
1027
+ case 2:
1028
+ var value = /** @type {string} */ (reader.readString());
1029
+ msg.setRootDirectory(value);
1030
+ break;
1031
+ case 3:
1032
+ var value = /** @type {string} */ (reader.readString());
1033
+ msg.setProgramDirectory(value);
1034
+ break;
1035
+ default:
1036
+ reader.skipField();
1037
+ break;
1038
+ }
1039
+ }
1040
+ return msg;
1041
+ };
1042
+
1043
+
1044
+ /**
1045
+ * Serializes the message to binary data (in protobuf wire format).
1046
+ * @return {!Uint8Array}
1047
+ */
1048
+ proto.pulumirpc.ProviderHandshakeRequest.prototype.serializeBinary = function() {
1049
+ var writer = new jspb.BinaryWriter();
1050
+ proto.pulumirpc.ProviderHandshakeRequest.serializeBinaryToWriter(this, writer);
1051
+ return writer.getResultBuffer();
1052
+ };
1053
+
1054
+
1055
+ /**
1056
+ * Serializes the given message to binary data (in protobuf wire
1057
+ * format), writing to the given BinaryWriter.
1058
+ * @param {!proto.pulumirpc.ProviderHandshakeRequest} message
1059
+ * @param {!jspb.BinaryWriter} writer
1060
+ * @suppress {unusedLocalVariables} f is only used for nested messages
1061
+ */
1062
+ proto.pulumirpc.ProviderHandshakeRequest.serializeBinaryToWriter = function(message, writer) {
1063
+ var f = undefined;
1064
+ f = message.getEngineAddress();
1065
+ if (f.length > 0) {
1066
+ writer.writeString(
1067
+ 1,
1068
+ f
1069
+ );
1070
+ }
1071
+ f = /** @type {string} */ (jspb.Message.getField(message, 2));
1072
+ if (f != null) {
1073
+ writer.writeString(
1074
+ 2,
1075
+ f
1076
+ );
1077
+ }
1078
+ f = /** @type {string} */ (jspb.Message.getField(message, 3));
1079
+ if (f != null) {
1080
+ writer.writeString(
1081
+ 3,
1082
+ f
1083
+ );
1084
+ }
1085
+ };
1086
+
1087
+
1088
+ /**
1089
+ * optional string engine_address = 1;
1090
+ * @return {string}
1091
+ */
1092
+ proto.pulumirpc.ProviderHandshakeRequest.prototype.getEngineAddress = function() {
1093
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
1094
+ };
1095
+
1096
+
1097
+ /**
1098
+ * @param {string} value
1099
+ * @return {!proto.pulumirpc.ProviderHandshakeRequest} returns this
1100
+ */
1101
+ proto.pulumirpc.ProviderHandshakeRequest.prototype.setEngineAddress = function(value) {
1102
+ return jspb.Message.setProto3StringField(this, 1, value);
1103
+ };
1104
+
1105
+
1106
+ /**
1107
+ * optional string root_directory = 2;
1108
+ * @return {string}
1109
+ */
1110
+ proto.pulumirpc.ProviderHandshakeRequest.prototype.getRootDirectory = function() {
1111
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
1112
+ };
1113
+
1114
+
1115
+ /**
1116
+ * @param {string} value
1117
+ * @return {!proto.pulumirpc.ProviderHandshakeRequest} returns this
1118
+ */
1119
+ proto.pulumirpc.ProviderHandshakeRequest.prototype.setRootDirectory = function(value) {
1120
+ return jspb.Message.setField(this, 2, value);
1121
+ };
1122
+
1123
+
1124
+ /**
1125
+ * Clears the field making it undefined.
1126
+ * @return {!proto.pulumirpc.ProviderHandshakeRequest} returns this
1127
+ */
1128
+ proto.pulumirpc.ProviderHandshakeRequest.prototype.clearRootDirectory = function() {
1129
+ return jspb.Message.setField(this, 2, undefined);
1130
+ };
1131
+
1132
+
1133
+ /**
1134
+ * Returns whether this field is set.
1135
+ * @return {boolean}
1136
+ */
1137
+ proto.pulumirpc.ProviderHandshakeRequest.prototype.hasRootDirectory = function() {
1138
+ return jspb.Message.getField(this, 2) != null;
1139
+ };
1140
+
1141
+
1142
+ /**
1143
+ * optional string program_directory = 3;
1144
+ * @return {string}
1145
+ */
1146
+ proto.pulumirpc.ProviderHandshakeRequest.prototype.getProgramDirectory = function() {
1147
+ return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
1148
+ };
1149
+
1150
+
1151
+ /**
1152
+ * @param {string} value
1153
+ * @return {!proto.pulumirpc.ProviderHandshakeRequest} returns this
1154
+ */
1155
+ proto.pulumirpc.ProviderHandshakeRequest.prototype.setProgramDirectory = function(value) {
1156
+ return jspb.Message.setField(this, 3, value);
1157
+ };
1158
+
1159
+
1160
+ /**
1161
+ * Clears the field making it undefined.
1162
+ * @return {!proto.pulumirpc.ProviderHandshakeRequest} returns this
1163
+ */
1164
+ proto.pulumirpc.ProviderHandshakeRequest.prototype.clearProgramDirectory = function() {
1165
+ return jspb.Message.setField(this, 3, undefined);
1166
+ };
1167
+
1168
+
1169
+ /**
1170
+ * Returns whether this field is set.
1171
+ * @return {boolean}
1172
+ */
1173
+ proto.pulumirpc.ProviderHandshakeRequest.prototype.hasProgramDirectory = function() {
1174
+ return jspb.Message.getField(this, 3) != null;
1175
+ };
1176
+
1177
+
1178
+
1179
+
1180
+
1181
+ if (jspb.Message.GENERATE_TO_OBJECT) {
1182
+ /**
1183
+ * Creates an object representation of this proto.
1184
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
1185
+ * Optional fields that are not set will be set to undefined.
1186
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
1187
+ * For the list of reserved names please see:
1188
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
1189
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
1190
+ * JSPB instance for transitional soy proto support:
1191
+ * http://goto/soy-param-migration
1192
+ * @return {!Object}
1193
+ */
1194
+ proto.pulumirpc.ProviderHandshakeResponse.prototype.toObject = function(opt_includeInstance) {
1195
+ return proto.pulumirpc.ProviderHandshakeResponse.toObject(opt_includeInstance, this);
1196
+ };
1197
+
1198
+
1199
+ /**
1200
+ * Static version of the {@see toObject} method.
1201
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
1202
+ * the JSPB instance for transitional soy proto support:
1203
+ * http://goto/soy-param-migration
1204
+ * @param {!proto.pulumirpc.ProviderHandshakeResponse} msg The msg instance to transform.
1205
+ * @return {!Object}
1206
+ * @suppress {unusedLocalVariables} f is only used for nested messages
1207
+ */
1208
+ proto.pulumirpc.ProviderHandshakeResponse.toObject = function(includeInstance, msg) {
1209
+ var f, obj = {
1210
+
1211
+ };
1212
+
1213
+ if (includeInstance) {
1214
+ obj.$jspbMessageInstance = msg;
1215
+ }
1216
+ return obj;
1217
+ };
1218
+ }
1219
+
1220
+
1221
+ /**
1222
+ * Deserializes binary data (in protobuf wire format).
1223
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
1224
+ * @return {!proto.pulumirpc.ProviderHandshakeResponse}
1225
+ */
1226
+ proto.pulumirpc.ProviderHandshakeResponse.deserializeBinary = function(bytes) {
1227
+ var reader = new jspb.BinaryReader(bytes);
1228
+ var msg = new proto.pulumirpc.ProviderHandshakeResponse;
1229
+ return proto.pulumirpc.ProviderHandshakeResponse.deserializeBinaryFromReader(msg, reader);
1230
+ };
1231
+
1232
+
1233
+ /**
1234
+ * Deserializes binary data (in protobuf wire format) from the
1235
+ * given reader into the given message object.
1236
+ * @param {!proto.pulumirpc.ProviderHandshakeResponse} msg The message object to deserialize into.
1237
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
1238
+ * @return {!proto.pulumirpc.ProviderHandshakeResponse}
1239
+ */
1240
+ proto.pulumirpc.ProviderHandshakeResponse.deserializeBinaryFromReader = function(msg, reader) {
1241
+ while (reader.nextField()) {
1242
+ if (reader.isEndGroup()) {
1243
+ break;
1244
+ }
1245
+ var field = reader.getFieldNumber();
1246
+ switch (field) {
1247
+ default:
1248
+ reader.skipField();
1249
+ break;
1250
+ }
1251
+ }
1252
+ return msg;
1253
+ };
1254
+
1255
+
1256
+ /**
1257
+ * Serializes the message to binary data (in protobuf wire format).
1258
+ * @return {!Uint8Array}
1259
+ */
1260
+ proto.pulumirpc.ProviderHandshakeResponse.prototype.serializeBinary = function() {
1261
+ var writer = new jspb.BinaryWriter();
1262
+ proto.pulumirpc.ProviderHandshakeResponse.serializeBinaryToWriter(this, writer);
1263
+ return writer.getResultBuffer();
1264
+ };
1265
+
1266
+
1267
+ /**
1268
+ * Serializes the given message to binary data (in protobuf wire
1269
+ * format), writing to the given BinaryWriter.
1270
+ * @param {!proto.pulumirpc.ProviderHandshakeResponse} message
1271
+ * @param {!jspb.BinaryWriter} writer
1272
+ * @suppress {unusedLocalVariables} f is only used for nested messages
1273
+ */
1274
+ proto.pulumirpc.ProviderHandshakeResponse.serializeBinaryToWriter = function(message, writer) {
1275
+ var f = undefined;
1276
+ };
1277
+
1278
+
1279
+
909
1280
  /**
910
1281
  * Oneof group definitions for this message. Each group defines the field
911
1282
  * numbers belonging to that group. When of these fields' value is set, all
@@ -151,6 +151,13 @@ export interface Provider {
151
151
  * The JSON-encoded schema for this provider's package.
152
152
  */
153
153
  schema?: string;
154
+ /**
155
+ * Gets the JSON-encoded schema for this provider's package.
156
+ * Implementations can lazily load or generate the schema when needed.
157
+ *
158
+ * @returns A promise that resolves to the JSON-encoded schema string.
159
+ */
160
+ getSchema?: () => Promise<string>;
154
161
  /**
155
162
  * Validates that the given property bag is valid for a resource of the
156
163
  * given type.
@@ -86,10 +86,26 @@ class Server {
86
86
  const req = call.request;
87
87
  if (req.getVersion() !== 0) {
88
88
  callback(new Error(`unsupported schema version ${req.getVersion()}`), undefined);
89
+ return;
89
90
  }
90
91
  const resp = new provproto.GetSchemaResponse();
91
- resp.setSchema(this.provider.schema || "{}");
92
- callback(undefined, resp);
92
+ if (this.provider.schema) {
93
+ resp.setSchema(this.provider.schema);
94
+ callback(undefined, resp);
95
+ }
96
+ else if (this.provider.getSchema) {
97
+ this.provider
98
+ .getSchema()
99
+ .then((schema) => {
100
+ resp.setSchema(schema);
101
+ callback(undefined, resp);
102
+ })
103
+ .catch((err) => callback(err, undefined));
104
+ }
105
+ else {
106
+ resp.setSchema("{}");
107
+ callback(undefined, resp);
108
+ }
93
109
  }
94
110
  // Config methods
95
111
  checkConfig(call, callback) {