pulumi/sdk/proto/nodejs/resource_pb.js
joeduffy 5dc4b0b75c Switch to parent pointers; display components nicely
This change switches from child lists to parent pointers, in the
way resource ancestries are represented.  This cleans up a fair bit
of the old parenting logic, including all notion of ambient parent
scopes (and will notably address pulumi/pulumi#435).

This lets us show a more parent/child display in the output when
doing planning and updating.  For instance, here is an update of
a lambda's text, which is logically part of a cloud timer:

    * cloud:timer:Timer: (same)
          [urn=urn:pulumi:malta::lm-cloud:☁️timer:Timer::lm-cts-malta-job-CleanSnapshots]
        * cloud:function:Function: (same)
              [urn=urn:pulumi:malta::lm-cloud:☁️function:Function::lm-cts-malta-job-CleanSnapshots]
            * aws:serverless:Function: (same)
                  [urn=urn:pulumi:malta::lm-cloud::aws:serverless:Function::lm-cts-malta-job-CleanSnapshots]
                ~ aws:lambda/function:Function: (modify)
                      [id=lm-cts-malta-job-CleanSnapshots-fee4f3bf41280741]
                      [urn=urn:pulumi:malta::lm-cloud::aws:lambda/function:Function::lm-cts-malta-job-CleanSnapshots]
                    - code            : archive(assets:2092f44) {
                        // etc etc etc

Note that we still get walls of text, but this will be actually
quite nice when combined with pulumi/pulumi#454.

I've also suppressed printing properties that didn't change during
updates when --detailed was not passed, and also suppressed empty
strings and zero-length arrays (since TF uses these as defaults in
many places and it just makes creation and deletion quite verbose).

Note that this is a far cry from everything we can possibly do
here as part of pulumi/pulumi#340 (and even pulumi/pulumi#417).
But it's a good start towards taming some of our output spew.
2017-11-20 09:07:53 -08:00

578 lines
16 KiB
JavaScript

/**
* @fileoverview
* @enhanceable
* @suppress {messageConventions} JS Compiler reports an error if a variable or
* field starts with 'MSG_' and isn't a translatable message.
* @public
*/
// GENERATED CODE -- DO NOT EDIT!
var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js');
var provider_pb = require('./provider_pb.js');
goog.exportSymbol('proto.pulumirpc.NewResourceRequest', null, global);
goog.exportSymbol('proto.pulumirpc.NewResourceResponse', null, global);
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.pulumirpc.NewResourceRequest = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.pulumirpc.NewResourceRequest, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.pulumirpc.NewResourceRequest.displayName = 'proto.pulumirpc.NewResourceRequest';
}
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto suitable for use in Soy templates.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance
* for transitional soy proto support: http://goto/soy-param-migration
* @return {!Object}
*/
proto.pulumirpc.NewResourceRequest.prototype.toObject = function(opt_includeInstance) {
return proto.pulumirpc.NewResourceRequest.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Whether to include the JSPB
* instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.pulumirpc.NewResourceRequest} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.NewResourceRequest.toObject = function(includeInstance, msg) {
var f, obj = {
type: jspb.Message.getFieldWithDefault(msg, 1, ""),
name: jspb.Message.getFieldWithDefault(msg, 2, ""),
parent: jspb.Message.getFieldWithDefault(msg, 3, ""),
custom: jspb.Message.getFieldWithDefault(msg, 4, false),
object: (f = msg.getObject()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.pulumirpc.NewResourceRequest}
*/
proto.pulumirpc.NewResourceRequest.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.pulumirpc.NewResourceRequest;
return proto.pulumirpc.NewResourceRequest.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.pulumirpc.NewResourceRequest} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.pulumirpc.NewResourceRequest}
*/
proto.pulumirpc.NewResourceRequest.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {string} */ (reader.readString());
msg.setType(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setName(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setParent(value);
break;
case 4:
var value = /** @type {boolean} */ (reader.readBool());
msg.setCustom(value);
break;
case 5:
var value = new google_protobuf_struct_pb.Struct;
reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader);
msg.setObject(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.pulumirpc.NewResourceRequest.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.pulumirpc.NewResourceRequest.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.pulumirpc.NewResourceRequest} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.NewResourceRequest.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getType();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getName();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getParent();
if (f.length > 0) {
writer.writeString(
3,
f
);
}
f = message.getCustom();
if (f) {
writer.writeBool(
4,
f
);
}
f = message.getObject();
if (f != null) {
writer.writeMessage(
5,
f,
google_protobuf_struct_pb.Struct.serializeBinaryToWriter
);
}
};
/**
* optional string type = 1;
* @return {string}
*/
proto.pulumirpc.NewResourceRequest.prototype.getType = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/** @param {string} value */
proto.pulumirpc.NewResourceRequest.prototype.setType = function(value) {
jspb.Message.setField(this, 1, value);
};
/**
* optional string name = 2;
* @return {string}
*/
proto.pulumirpc.NewResourceRequest.prototype.getName = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/** @param {string} value */
proto.pulumirpc.NewResourceRequest.prototype.setName = function(value) {
jspb.Message.setField(this, 2, value);
};
/**
* optional string parent = 3;
* @return {string}
*/
proto.pulumirpc.NewResourceRequest.prototype.getParent = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/** @param {string} value */
proto.pulumirpc.NewResourceRequest.prototype.setParent = function(value) {
jspb.Message.setField(this, 3, value);
};
/**
* optional bool custom = 4;
* Note that Boolean fields may be set to 0/1 when serialized from a Java server.
* You should avoid comparisons like {@code val === true/false} in those cases.
* @return {boolean}
*/
proto.pulumirpc.NewResourceRequest.prototype.getCustom = function() {
return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 4, false));
};
/** @param {boolean} value */
proto.pulumirpc.NewResourceRequest.prototype.setCustom = function(value) {
jspb.Message.setField(this, 4, value);
};
/**
* optional google.protobuf.Struct object = 5;
* @return {?proto.google.protobuf.Struct}
*/
proto.pulumirpc.NewResourceRequest.prototype.getObject = function() {
return /** @type{?proto.google.protobuf.Struct} */ (
jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 5));
};
/** @param {?proto.google.protobuf.Struct|undefined} value */
proto.pulumirpc.NewResourceRequest.prototype.setObject = function(value) {
jspb.Message.setWrapperField(this, 5, value);
};
proto.pulumirpc.NewResourceRequest.prototype.clearObject = function() {
this.setObject(undefined);
};
/**
* Returns whether this field is set.
* @return {!boolean}
*/
proto.pulumirpc.NewResourceRequest.prototype.hasObject = function() {
return jspb.Message.getField(this, 5) != null;
};
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.pulumirpc.NewResourceResponse = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.NewResourceResponse.repeatedFields_, null);
};
goog.inherits(proto.pulumirpc.NewResourceResponse, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.pulumirpc.NewResourceResponse.displayName = 'proto.pulumirpc.NewResourceResponse';
}
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.pulumirpc.NewResourceResponse.repeatedFields_ = [5];
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto suitable for use in Soy templates.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance
* for transitional soy proto support: http://goto/soy-param-migration
* @return {!Object}
*/
proto.pulumirpc.NewResourceResponse.prototype.toObject = function(opt_includeInstance) {
return proto.pulumirpc.NewResourceResponse.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Whether to include the JSPB
* instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.pulumirpc.NewResourceResponse} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.NewResourceResponse.toObject = function(includeInstance, msg) {
var f, obj = {
id: jspb.Message.getFieldWithDefault(msg, 1, ""),
urn: jspb.Message.getFieldWithDefault(msg, 2, ""),
object: (f = msg.getObject()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f),
stable: jspb.Message.getFieldWithDefault(msg, 4, false),
stablesList: jspb.Message.getRepeatedField(msg, 5)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.pulumirpc.NewResourceResponse}
*/
proto.pulumirpc.NewResourceResponse.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.pulumirpc.NewResourceResponse;
return proto.pulumirpc.NewResourceResponse.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.pulumirpc.NewResourceResponse} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.pulumirpc.NewResourceResponse}
*/
proto.pulumirpc.NewResourceResponse.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {string} */ (reader.readString());
msg.setId(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setUrn(value);
break;
case 3:
var value = new google_protobuf_struct_pb.Struct;
reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader);
msg.setObject(value);
break;
case 4:
var value = /** @type {boolean} */ (reader.readBool());
msg.setStable(value);
break;
case 5:
var value = /** @type {string} */ (reader.readString());
msg.addStables(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.pulumirpc.NewResourceResponse.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.pulumirpc.NewResourceResponse.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.pulumirpc.NewResourceResponse} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.NewResourceResponse.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getId();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getUrn();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getObject();
if (f != null) {
writer.writeMessage(
3,
f,
google_protobuf_struct_pb.Struct.serializeBinaryToWriter
);
}
f = message.getStable();
if (f) {
writer.writeBool(
4,
f
);
}
f = message.getStablesList();
if (f.length > 0) {
writer.writeRepeatedString(
5,
f
);
}
};
/**
* optional string id = 1;
* @return {string}
*/
proto.pulumirpc.NewResourceResponse.prototype.getId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/** @param {string} value */
proto.pulumirpc.NewResourceResponse.prototype.setId = function(value) {
jspb.Message.setField(this, 1, value);
};
/**
* optional string urn = 2;
* @return {string}
*/
proto.pulumirpc.NewResourceResponse.prototype.getUrn = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/** @param {string} value */
proto.pulumirpc.NewResourceResponse.prototype.setUrn = function(value) {
jspb.Message.setField(this, 2, value);
};
/**
* optional google.protobuf.Struct object = 3;
* @return {?proto.google.protobuf.Struct}
*/
proto.pulumirpc.NewResourceResponse.prototype.getObject = function() {
return /** @type{?proto.google.protobuf.Struct} */ (
jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 3));
};
/** @param {?proto.google.protobuf.Struct|undefined} value */
proto.pulumirpc.NewResourceResponse.prototype.setObject = function(value) {
jspb.Message.setWrapperField(this, 3, value);
};
proto.pulumirpc.NewResourceResponse.prototype.clearObject = function() {
this.setObject(undefined);
};
/**
* Returns whether this field is set.
* @return {!boolean}
*/
proto.pulumirpc.NewResourceResponse.prototype.hasObject = function() {
return jspb.Message.getField(this, 3) != null;
};
/**
* optional bool stable = 4;
* Note that Boolean fields may be set to 0/1 when serialized from a Java server.
* You should avoid comparisons like {@code val === true/false} in those cases.
* @return {boolean}
*/
proto.pulumirpc.NewResourceResponse.prototype.getStable = function() {
return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 4, false));
};
/** @param {boolean} value */
proto.pulumirpc.NewResourceResponse.prototype.setStable = function(value) {
jspb.Message.setField(this, 4, value);
};
/**
* repeated string stables = 5;
* @return {!Array.<string>}
*/
proto.pulumirpc.NewResourceResponse.prototype.getStablesList = function() {
return /** @type {!Array.<string>} */ (jspb.Message.getRepeatedField(this, 5));
};
/** @param {!Array.<string>} value */
proto.pulumirpc.NewResourceResponse.prototype.setStablesList = function(value) {
jspb.Message.setField(this, 5, value || []);
};
/**
* @param {!string} value
* @param {number=} opt_index
*/
proto.pulumirpc.NewResourceResponse.prototype.addStables = function(value, opt_index) {
jspb.Message.addToRepeatedField(this, 5, value, opt_index);
};
proto.pulumirpc.NewResourceResponse.prototype.clearStablesList = function() {
this.setStablesList([]);
};
goog.object.extend(exports, proto.pulumirpc);