/**
 * @fileoverview
 * @enhanceable
 * @public
 */
// GENERATED CODE -- DO NOT EDIT!

var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();

var google_protobuf_descriptor_pb = require('google-protobuf/google/protobuf/descriptor_pb.js');
goog.exportSymbol('google.api.resource', null, global);
goog.exportSymbol('google.api.resource_definition', null, global);
goog.exportSymbol('google.api.resource_reference', null, global);
goog.exportSymbol('proto.google.api.ResourceDescriptor', null, global);
goog.exportSymbol('proto.google.api.ResourceDescriptor.History', null, global);
goog.exportSymbol('proto.google.api.ResourceDescriptor.Style', null, global);
goog.exportSymbol('proto.google.api.ResourceReference', 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.google.api.ResourceDescriptor = function(opt_data) {
  jspb.Message.initialize(this, opt_data, 0, -1, proto.google.api.ResourceDescriptor.repeatedFields_, null);
};
goog.inherits(proto.google.api.ResourceDescriptor, jspb.Message);
if (goog.DEBUG && !COMPILED) {
  proto.google.api.ResourceDescriptor.displayName = 'proto.google.api.ResourceDescriptor';
}
/**
 * List of repeated fields within this message type.
 * @private {!Array<number>}
 * @const
 */
proto.google.api.ResourceDescriptor.repeatedFields_ = [2,10];



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.google.api.ResourceDescriptor.prototype.toObject = function(opt_includeInstance) {
  return proto.google.api.ResourceDescriptor.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.google.api.ResourceDescriptor} msg The msg instance to transform.
 * @return {!Object}
 */
proto.google.api.ResourceDescriptor.toObject = function(includeInstance, msg) {
  var f, obj = {
    type: msg.getType(),
    patternList: jspb.Message.getField(msg, 2),
    nameField: msg.getNameField(),
    history: msg.getHistory(),
    plural: msg.getPlural(),
    singular: msg.getSingular(),
    styleList: jspb.Message.getField(msg, 10)
  };

  if (includeInstance) {
    obj.$jspbMessageInstance = msg;
  }
  return obj;
};
}


/**
 * Deserializes binary data (in protobuf wire format).
 * @param {jspb.ByteSource} bytes The bytes to deserialize.
 * @return {!proto.google.api.ResourceDescriptor}
 */
proto.google.api.ResourceDescriptor.deserializeBinary = function(bytes) {
  var reader = new jspb.BinaryReader(bytes);
  var msg = new proto.google.api.ResourceDescriptor;
  return proto.google.api.ResourceDescriptor.deserializeBinaryFromReader(msg, reader);
};


/**
 * Deserializes binary data (in protobuf wire format) from the
 * given reader into the given message object.
 * @param {!proto.google.api.ResourceDescriptor} msg The message object to deserialize into.
 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
 * @return {!proto.google.api.ResourceDescriptor}
 */
proto.google.api.ResourceDescriptor.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.getPatternList().push(value);
      msg.setPatternList(msg.getPatternList());
      break;
    case 3:
      var value = /** @type {string} */ (reader.readString());
      msg.setNameField(value);
      break;
    case 4:
      var value = /** @type {!proto.google.api.ResourceDescriptor.History} */ (reader.readEnum());
      msg.setHistory(value);
      break;
    case 5:
      var value = /** @type {string} */ (reader.readString());
      msg.setPlural(value);
      break;
    case 6:
      var value = /** @type {string} */ (reader.readString());
      msg.setSingular(value);
      break;
    case 10:
      var value = /** @type {!Array.<!proto.google.api.ResourceDescriptor.Style>} */ (reader.readPackedEnum());
      msg.setStyleList(value);
      break;
    default:
      reader.skipField();
      break;
    }
  }
  return msg;
};


/**
 * Class method variant: serializes the given message to binary data
 * (in protobuf wire format), writing to the given BinaryWriter.
 * @param {!proto.google.api.ResourceDescriptor} message
 * @param {!jspb.BinaryWriter} writer
 */
proto.google.api.ResourceDescriptor.serializeBinaryToWriter = function(message, writer) {
  message.serializeBinaryToWriter(writer);
};


/**
 * Serializes the message to binary data (in protobuf wire format).
 * @return {!Uint8Array}
 */
proto.google.api.ResourceDescriptor.prototype.serializeBinary = function() {
  var writer = new jspb.BinaryWriter();
  this.serializeBinaryToWriter(writer);
  return writer.getResultBuffer();
};


/**
 * Serializes the message to binary data (in protobuf wire format),
 * writing to the given BinaryWriter.
 * @param {!jspb.BinaryWriter} writer
 */
proto.google.api.ResourceDescriptor.prototype.serializeBinaryToWriter = function (writer) {
  var f = undefined;
  f = this.getType();
  if (f.length > 0) {
    writer.writeString(
      1,
      f
    );
  }
  f = this.getPatternList();
  if (f.length > 0) {
    writer.writeRepeatedString(
      2,
      f
    );
  }
  f = this.getNameField();
  if (f.length > 0) {
    writer.writeString(
      3,
      f
    );
  }
  f = this.getHistory();
  if (f !== 0.0) {
    writer.writeEnum(
      4,
      f
    );
  }
  f = this.getPlural();
  if (f.length > 0) {
    writer.writeString(
      5,
      f
    );
  }
  f = this.getSingular();
  if (f.length > 0) {
    writer.writeString(
      6,
      f
    );
  }
  f = this.getStyleList();
  if (f.length > 0) {
    writer.writePackedEnum(
      10,
      f
    );
  }
};


/**
 * Creates a deep clone of this proto. No data is shared with the original.
 * @return {!proto.google.api.ResourceDescriptor} The clone.
 */
proto.google.api.ResourceDescriptor.prototype.cloneMessage = function() {
  return /** @type {!proto.google.api.ResourceDescriptor} */ (jspb.Message.cloneMessage(this));
};


/**
 * optional string type = 1;
 * @return {string}
 */
proto.google.api.ResourceDescriptor.prototype.getType = function() {
  return /** @type {string} */ (jspb.Message.getFieldProto3(this, 1, ""));
};


/** @param {string} value  */
proto.google.api.ResourceDescriptor.prototype.setType = function(value) {
  jspb.Message.setField(this, 1, value);
};


/**
 * repeated string pattern = 2;
 * If you change this array by adding, removing or replacing elements, or if you
 * replace the array itself, then you must call the setter to update it.
 * @return {!Array.<string>}
 */
proto.google.api.ResourceDescriptor.prototype.getPatternList = function() {
  return /** @type {!Array.<string>} */ (jspb.Message.getField(this, 2));
};


/** @param {Array.<string>} value  */
proto.google.api.ResourceDescriptor.prototype.setPatternList = function(value) {
  jspb.Message.setField(this, 2, value || []);
};


proto.google.api.ResourceDescriptor.prototype.clearPatternList = function() {
  jspb.Message.setField(this, 2, []);
};


/**
 * optional string name_field = 3;
 * @return {string}
 */
proto.google.api.ResourceDescriptor.prototype.getNameField = function() {
  return /** @type {string} */ (jspb.Message.getFieldProto3(this, 3, ""));
};


/** @param {string} value  */
proto.google.api.ResourceDescriptor.prototype.setNameField = function(value) {
  jspb.Message.setField(this, 3, value);
};


/**
 * optional History history = 4;
 * @return {!proto.google.api.ResourceDescriptor.History}
 */
proto.google.api.ResourceDescriptor.prototype.getHistory = function() {
  return /** @type {!proto.google.api.ResourceDescriptor.History} */ (jspb.Message.getFieldProto3(this, 4, 0));
};


/** @param {!proto.google.api.ResourceDescriptor.History} value  */
proto.google.api.ResourceDescriptor.prototype.setHistory = function(value) {
  jspb.Message.setField(this, 4, value);
};


/**
 * optional string plural = 5;
 * @return {string}
 */
proto.google.api.ResourceDescriptor.prototype.getPlural = function() {
  return /** @type {string} */ (jspb.Message.getFieldProto3(this, 5, ""));
};


/** @param {string} value  */
proto.google.api.ResourceDescriptor.prototype.setPlural = function(value) {
  jspb.Message.setField(this, 5, value);
};


/**
 * optional string singular = 6;
 * @return {string}
 */
proto.google.api.ResourceDescriptor.prototype.getSingular = function() {
  return /** @type {string} */ (jspb.Message.getFieldProto3(this, 6, ""));
};


/** @param {string} value  */
proto.google.api.ResourceDescriptor.prototype.setSingular = function(value) {
  jspb.Message.setField(this, 6, value);
};


/**
 * repeated Style style = 10;
 * If you change this array by adding, removing or replacing elements, or if you
 * replace the array itself, then you must call the setter to update it.
 * @return {!Array.<!proto.google.api.ResourceDescriptor.Style>}
 */
proto.google.api.ResourceDescriptor.prototype.getStyleList = function() {
  return /** @type {!Array.<!proto.google.api.ResourceDescriptor.Style>} */ (jspb.Message.getField(this, 10));
};


/** @param {!Array.<!proto.google.api.ResourceDescriptor.Style>} value  */
proto.google.api.ResourceDescriptor.prototype.setStyleList = function(value) {
  jspb.Message.setField(this, 10, value || []);
};


proto.google.api.ResourceDescriptor.prototype.clearStyleList = function() {
  jspb.Message.setField(this, 10, []);
};


/**
 * @enum {number}
 */
proto.google.api.ResourceDescriptor.History = {
  HISTORY_UNSPECIFIED: 0,
  ORIGINALLY_SINGLE_PATTERN: 1,
  FUTURE_MULTI_PATTERN: 2
};

/**
 * @enum {number}
 */
proto.google.api.ResourceDescriptor.Style = {
  STYLE_UNSPECIFIED: 0,
  DECLARATIVE_FRIENDLY: 1
};


/**
 * 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.google.api.ResourceReference = function(opt_data) {
  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.google.api.ResourceReference, jspb.Message);
if (goog.DEBUG && !COMPILED) {
  proto.google.api.ResourceReference.displayName = 'proto.google.api.ResourceReference';
}


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.google.api.ResourceReference.prototype.toObject = function(opt_includeInstance) {
  return proto.google.api.ResourceReference.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.google.api.ResourceReference} msg The msg instance to transform.
 * @return {!Object}
 */
proto.google.api.ResourceReference.toObject = function(includeInstance, msg) {
  var f, obj = {
    type: msg.getType(),
    childType: msg.getChildType()
  };

  if (includeInstance) {
    obj.$jspbMessageInstance = msg;
  }
  return obj;
};
}


/**
 * Deserializes binary data (in protobuf wire format).
 * @param {jspb.ByteSource} bytes The bytes to deserialize.
 * @return {!proto.google.api.ResourceReference}
 */
proto.google.api.ResourceReference.deserializeBinary = function(bytes) {
  var reader = new jspb.BinaryReader(bytes);
  var msg = new proto.google.api.ResourceReference;
  return proto.google.api.ResourceReference.deserializeBinaryFromReader(msg, reader);
};


/**
 * Deserializes binary data (in protobuf wire format) from the
 * given reader into the given message object.
 * @param {!proto.google.api.ResourceReference} msg The message object to deserialize into.
 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
 * @return {!proto.google.api.ResourceReference}
 */
proto.google.api.ResourceReference.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.setChildType(value);
      break;
    default:
      reader.skipField();
      break;
    }
  }
  return msg;
};


/**
 * Class method variant: serializes the given message to binary data
 * (in protobuf wire format), writing to the given BinaryWriter.
 * @param {!proto.google.api.ResourceReference} message
 * @param {!jspb.BinaryWriter} writer
 */
proto.google.api.ResourceReference.serializeBinaryToWriter = function(message, writer) {
  message.serializeBinaryToWriter(writer);
};


/**
 * Serializes the message to binary data (in protobuf wire format).
 * @return {!Uint8Array}
 */
proto.google.api.ResourceReference.prototype.serializeBinary = function() {
  var writer = new jspb.BinaryWriter();
  this.serializeBinaryToWriter(writer);
  return writer.getResultBuffer();
};


/**
 * Serializes the message to binary data (in protobuf wire format),
 * writing to the given BinaryWriter.
 * @param {!jspb.BinaryWriter} writer
 */
proto.google.api.ResourceReference.prototype.serializeBinaryToWriter = function (writer) {
  var f = undefined;
  f = this.getType();
  if (f.length > 0) {
    writer.writeString(
      1,
      f
    );
  }
  f = this.getChildType();
  if (f.length > 0) {
    writer.writeString(
      2,
      f
    );
  }
};


/**
 * Creates a deep clone of this proto. No data is shared with the original.
 * @return {!proto.google.api.ResourceReference} The clone.
 */
proto.google.api.ResourceReference.prototype.cloneMessage = function() {
  return /** @type {!proto.google.api.ResourceReference} */ (jspb.Message.cloneMessage(this));
};


/**
 * optional string type = 1;
 * @return {string}
 */
proto.google.api.ResourceReference.prototype.getType = function() {
  return /** @type {string} */ (jspb.Message.getFieldProto3(this, 1, ""));
};


/** @param {string} value  */
proto.google.api.ResourceReference.prototype.setType = function(value) {
  jspb.Message.setField(this, 1, value);
};


/**
 * optional string child_type = 2;
 * @return {string}
 */
proto.google.api.ResourceReference.prototype.getChildType = function() {
  return /** @type {string} */ (jspb.Message.getFieldProto3(this, 2, ""));
};


/** @param {string} value  */
proto.google.api.ResourceReference.prototype.setChildType = function(value) {
  jspb.Message.setField(this, 2, value);
};



/**
 * A tuple of {field number, class constructor} for the extension
 * field named `resourceReference`.
 * @type {!jspb.ExtensionFieldInfo.<!proto.google.api.ResourceReference>}
 */
proto.google.api.resourceReference = new jspb.ExtensionFieldInfo(
    1055,
    {resourceReference: 0},
    proto.google.api.ResourceReference,
     /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ (
         proto.google.api.ResourceReference.toObject),
    0);

google_protobuf_descriptor_pb.FieldOptions.extensionsBinary[1055] = new jspb.ExtensionFieldBinaryInfo(
    proto.google.api.resourceReference,
    jspb.BinaryReader.prototype.readMessage,
    jspb.BinaryWriter.prototype.writeMessage,
    proto.google.api.ResourceReference.serializeBinaryToWriter,
    proto.google.api.ResourceReference.deserializeBinaryFromReader,
    false);
// This registers the extension field with the extended class, so that
// toObject() will function correctly.
google_protobuf_descriptor_pb.FieldOptions.extensions[1055] = proto.google.api.resourceReference;


/**
 * A tuple of {field number, class constructor} for the extension
 * field named `resourceDefinitionList`.
 * @type {!jspb.ExtensionFieldInfo.<!Array.<!proto.google.api.ResourceDescriptor>>}
 */
proto.google.api.resourceDefinitionList = new jspb.ExtensionFieldInfo(
    1053,
    {resourceDefinitionList: 0},
    proto.google.api.ResourceDescriptor,
     /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ (
         proto.google.api.ResourceDescriptor.toObject),
    1);

google_protobuf_descriptor_pb.FileOptions.extensionsBinary[1053] = new jspb.ExtensionFieldBinaryInfo(
    proto.google.api.resourceDefinitionList,
    jspb.BinaryReader.prototype.readMessage,
    jspb.BinaryWriter.prototype.writeRepeatedMessage,
    proto.google.api.ResourceDescriptor.serializeBinaryToWriter,
    proto.google.api.ResourceDescriptor.deserializeBinaryFromReader,
    false);
// This registers the extension field with the extended class, so that
// toObject() will function correctly.
google_protobuf_descriptor_pb.FileOptions.extensions[1053] = proto.google.api.resourceDefinitionList;


/**
 * A tuple of {field number, class constructor} for the extension
 * field named `resource`.
 * @type {!jspb.ExtensionFieldInfo.<!proto.google.api.ResourceDescriptor>}
 */
proto.google.api.resource = new jspb.ExtensionFieldInfo(
    1053,
    {resource: 0},
    proto.google.api.ResourceDescriptor,
     /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ (
         proto.google.api.ResourceDescriptor.toObject),
    0);

google_protobuf_descriptor_pb.MessageOptions.extensionsBinary[1053] = new jspb.ExtensionFieldBinaryInfo(
    proto.google.api.resource,
    jspb.BinaryReader.prototype.readMessage,
    jspb.BinaryWriter.prototype.writeMessage,
    proto.google.api.ResourceDescriptor.serializeBinaryToWriter,
    proto.google.api.ResourceDescriptor.deserializeBinaryFromReader,
    false);
// This registers the extension field with the extended class, so that
// toObject() will function correctly.
google_protobuf_descriptor_pb.MessageOptions.extensions[1053] = proto.google.api.resource;

goog.object.extend(exports, proto.google.api);
