require 'date' module HelixWebServices # The Perforce stream specification defines a single stream.\n\nStreams are hierarchical branches with policies that control the structure and the flow of change.\nStream hierarchies are based on the stability of the streams, specified by the type you assign to the stream.\nDevelopment streams are least stable (most subject to change), mainline streams are somewhat stable, and release streams are highly stable.\nVirtual streams can be used to copy and merge between parent and child streams without storing local data.\nTask streams are lightweight short-lived branches that are useful for bug fixing or new features that only modify a small subset of the branch data.\n\nStream contents are defined by the paths that you map.\nBy default, a stream has the same structure as its parent (the stream from which it was branched), but you can override the structure, for example to ensure that specified files cannot be submitted or integrated to other streams. class StreamCommand # Specifies the stream's name (permanent identifier) and its path in the stream depot, in the form `//depotname/streamname`. attr_accessor :stream # The date the stream specification was last modified. attr_accessor :update # The date and time that the stream specification was last accessed by any Perforce command. attr_accessor :access # The Perforce user or group who owns the stream.\nThe default is the user who created the stream. attr_accessor :owner # Display name of the stream.\nUnlike the Stream: field, this field can be modified.\nDefaults to the streamname portion of the stream path. attr_accessor :name # The parent of this stream.\nMust be none if the stream's `Type:` is mainline, otherwise must be set to an existing stream identifier of the form `//depotname/streamname`. attr_accessor :parent # The stream’s type determines the expected flow of change.\nValid stream types are `mainline`, `virtual`, `development`, and `release`.\n\n- `mainline`:\nThe mainline stream is the parent of all streams in the stream depot. Every stream depot must have at least one mainline stream.\n\n- `virtual`:\nVirtual streams allow merging and copying between parent and child streams without storing local data.\nData is passed through to the destination (a non-virtual stream) after applying restrictions on the scope of files defined in the virtual stream’s view.\nBecause virtual streams do not have files in their depot namespace, it is impossible to import a virtual stream.\n\n- `release`:\nMore stable than the mainline.\nRelease streams copy from the parent and merge to the parent.\n\n- `development`:\nLess stable than the mainline.\nDevelopment streams expect to merge from parent streams and copy to the parent.\n\n- `task`:\nTask streams are lightweight short-lived branches that are useful for bug fixing or new features that only modify a small subset of the branch data.\nBecause branched (copied) files are tracked in a set of shadow tables which are later removed, repository metadata is kept to a minimum when using this type of stream.\nWorkspaces associated with task streams see all branched data, but only modified and promoted data is visible to users with access to the stream’s namespace.\nThe default is stream type is development. attr_accessor :type # Description of the stream. attr_accessor :description # Settings that configure stream behavior as follows:\n\n- `[un]locked`:\nEnable/disable other users' ability to edit or delete the stream.\nIf locked, the stream specification cannot be deleted, and only its owner can modify it.\nThe default is unlocked.\n\n- `[all,owner]submit`:\nSpecifies whether all users or only the owner of the stream can submit changes to the stream.\nThe default is allsubmit.\nIf the Owner: of a stream marked ownersubmit is a group, all users who are members of that group can submit changes to the stream.\n\n- `[no]toparent`:\nSpecifies whether integrations from the stream to its parent are expected.\nThe default is toparent.\n\n- `[no]fromparent`:\nSpecifies whether integrations to the stream from its parent are expected.\nThe default is fromparent for mainline and development streams, and nofromparent for release streams.\n\n- `mergeany,mergedown`:\nSpecifies whether the merge flow is restricted or whether merge is permitted from any other stream.\nFor example, the mergeany option would allow a merge from a child to a parent with no warnings.\nA virtual stream must have its flow options set to notoparent and nofromparent.\nFlow options are ignored for mainline streams. attr_accessor :options # Paths define how files are incorporated into the stream structure.\nSpecify paths using the following format:\n`path_type view_path [depot_path]`\nwhere `path_type` is a single keyword, `view_path` is a file path with no leading slashes, and the optional `depot_path` is a file path beginning with //.\n\nThe default path is `share ...`\n\nValid path types are:\n\n- `share view_path`: Specified files can be synced, submitted, and integrated to and from the parent stream.\n\n- `isolate view_path`: Specified files can be synced and submitted, but cannot be integrated to and from the parent stream.\n\n- `import view_path [depot_path]`: Specified files can be synced, but cannot be submitted or integrated to and from the parent stream.\nThe `view_path` is mapped as in the parent stream's view, or to an (optional) `depot_path`.\nThe `depot_path` may include a changelist specifier.\nThat stream's client workspaces will be limited to seeing revisions at that change or lower within that depot path.\nFor example, you can specify a depot path like this: `//depot/import/...@1000`.\nRevisions from changelists greater than 1000 will be automatically hidden from most commands.\nThe changelist limits in effect for a given stream workspace are displayed in a read-only client workspace specification field called ChangeView.\n\n- `import+ view_path [depot_path]`:\nFunctions like a standard import path, enabling you to map a path from outside the stream depot to your stream, but unlike a standard import path, you can submit changes to the files in an import+ path.\n\n- `exclude view_path`:\nSpecified files cannot be synced, submitted or integrated to and from the parent stream.\nBy default, streams inherit their structure from the parent stream (except mainlines, which have no parent).\nPaths are inherited by child stream views; a child stream’s path can downgrade the inherited view, but not upgrade it.\n(For example, a child stream can downgrade a shared path to an isolated path, but if the parent stream defines a path as isolated, its child cannot restore full access by specifying the path as shared.)\nNote that the `depot_path` is relevant only when the path_type is `import` or `import+`. attr_accessor :paths # Reassigns the location of workspace files.\nTo specify the source path and its location in the workspace, use the following syntax:\n`view_path_1 view_path_2`\nwhere `view_path_1` and `view_path_2` are Perforce view paths (omit leading slashes and leading or embedded wildcards; terminal wildcards are fine).\nFor example, to ensure that files are synced to the local ProjectX folder, remap as follows:\n`... projectX/...`\nLine ordering in the Remapped: field is significant: if more than one line remaps the same files, the later line takes precedence.\nRemappings are inherited by child streams and the workspaces associated with them. attr_accessor :remapped # A list of file or directory names to be ignored in client views. For example:\n\n```\n/tmp # ignores files named \"tmp\"\n/tmp/... # ignores directories named \"tmp\"\n.tmp # ignores file names ending in .tmp\n```\n\nLines in the `Ignored:` field can appear in any order.\nIgnored files and directories are inherited by child stream client views. attr_accessor :ignored # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'stream' => :'stream', :'update' => :'update', :'access' => :'access', :'owner' => :'owner', :'name' => :'name', :'parent' => :'parent', :'type' => :'type', :'description' => :'description', :'options' => :'options', :'paths' => :'paths', :'remapped' => :'remapped', :'ignored' => :'ignored' } end # Attribute type mapping. def self.swagger_types { :'stream' => :'String', :'update' => :'DateTime', :'access' => :'DateTime', :'owner' => :'String', :'name' => :'String', :'parent' => :'String', :'type' => :'String', :'description' => :'String', :'options' => :'String', :'paths' => :'Array', :'remapped' => :'Array', :'ignored' => :'Array' } end def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo} if attributes[:'stream'] self.stream = attributes[:'stream'] end if attributes[:'update'] self.update = attributes[:'update'] end if attributes[:'access'] self.access = attributes[:'access'] end if attributes[:'owner'] self.owner = attributes[:'owner'] end if attributes[:'name'] self.name = attributes[:'name'] end if attributes[:'parent'] self.parent = attributes[:'parent'] end if attributes[:'type'] self.type = attributes[:'type'] end if attributes[:'description'] self.description = attributes[:'description'] end if attributes[:'options'] self.options = attributes[:'options'] end if attributes[:'paths'] if (value = attributes[:'paths']).is_a?(Array) self.paths = value end end if attributes[:'remapped'] if (value = attributes[:'remapped']).is_a?(Array) self.remapped = value end end if attributes[:'ignored'] if (value = attributes[:'ignored']).is_a?(Array) self.ignored = value end end end # Check equality by comparing each attribute. def ==(o) return true if self.equal?(o) self.class == o.class && stream == o.stream && update == o.update && access == o.access && owner == o.owner && name == o.name && parent == o.parent && type == o.type && description == o.description && options == o.options && paths == o.paths && remapped == o.remapped && ignored == o.ignored end # @see the `==` method def eql?(o) self == o end # Calculate hash code according to all attributes. def hash [stream, update, access, owner, name, parent, type, description, options, paths, remapped, ignored].hash end # build the object from hash def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) else #TODO show warning in debug mode end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) else # data not found in attributes(hash), not an issue as the data can be optional end end self end def _deserialize(type, value) case type.to_sym when :DateTime DateTime.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :BOOLEAN if value.to_s =~ /^(true|t|yes|y|1)$/i true else false end when /\AArray<(?.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?.+), (?.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end when :Object value else # model _model = HelixWebServices.const_get(type).new _model.build_from_hash(value) end end def to_s to_hash.to_s end # to_body is an alias to to_body (backward compatibility)) def to_body to_hash end # return the object in the form of hash def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? hash[param] = _to_hash(value) end hash end # Method to output non-array value in the form of hash # For object, use to_hash. Otherwise, just return the value def _to_hash(value) if value.is_a?(Array) value.compact.map{ |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end end end