Class: Google::Apis::RemotebuildexecutionV1alpha::BuildBazelRemoteExecutionV2Directory

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/remotebuildexecution_v1alpha/classes.rb,
generated/google/apis/remotebuildexecution_v1alpha/representations.rb,
generated/google/apis/remotebuildexecution_v1alpha/representations.rb

Overview

A Directory represents a directory node in a file tree, containing zero or more children FileNodes, DirectoryNodes and SymlinkNodes. Each Node contains its name in the directory, either the digest of its content (either a file blob or a Directory proto) or a symlink target, as well as possibly some metadata about the file or directory. In order to ensure that two equivalent directory trees hash to the same value, the following restrictions MUST be obeyed when constructing a a Directory:

  • Every child in the directory must have a path of exactly one segment. Multiple levels of directory hierarchy may not be collapsed.
  • Each child in the directory must have a unique path segment (file name). Note that while the API itself is case-sensitive, the environment where the Action is executed may or may not be case-sensitive. That is, it is legal to call the API with a Directory that has both "Foo" and "foo" as children, but the Action may be rejected by the remote system upon execution.
  • The files, directories and symlinks in the directory must each be sorted in lexicographical order by path. The path strings must be sorted by code point, equivalently, by UTF-8 bytes.
  • The NodeProperties of files, directories, and symlinks must be sorted in lexicographical order by property name. A Directory that obeys the restrictions is said to be in canonical form. As an example, the following could be used for a file named bar and a directory named foo with an executable file named baz (hashes shortened for readability): json // (Directory proto) ` files: [ ` name: "bar", digest: ` hash: "4a73bc9d03...", size: 65534 `, node_properties: [ ` "name": "MTime", "value": "2017-01-15T01:30:15.01Z" ` ] ` ], directories: [ ` name: "foo", digest: ` hash: "4cf2eda940...", size: 43 ` ` ] ` // (Directory proto with hash "4cf2eda940..." and size 43) ` files: [ ` name: "baz", digest: ` hash: "b2c941073e...", size: 1294, `, is_executable: true ` ] `

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ BuildBazelRemoteExecutionV2Directory

Returns a new instance of BuildBazelRemoteExecutionV2Directory.



717
718
719
# File 'generated/google/apis/remotebuildexecution_v1alpha/classes.rb', line 717

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#directoriesArray<Google::Apis::RemotebuildexecutionV1alpha::BuildBazelRemoteExecutionV2DirectoryNode>

The subdirectories in the directory. Corresponds to the JSON property directories



700
701
702
# File 'generated/google/apis/remotebuildexecution_v1alpha/classes.rb', line 700

def directories
  @directories
end

#filesArray<Google::Apis::RemotebuildexecutionV1alpha::BuildBazelRemoteExecutionV2FileNode>

The files in the directory. Corresponds to the JSON property files



705
706
707
# File 'generated/google/apis/remotebuildexecution_v1alpha/classes.rb', line 705

def files
  @files
end

#node_propertiesArray<Google::Apis::RemotebuildexecutionV1alpha::BuildBazelRemoteExecutionV2NodeProperty>

The node properties of the Directory. Corresponds to the JSON property nodeProperties



710
711
712
# File 'generated/google/apis/remotebuildexecution_v1alpha/classes.rb', line 710

def node_properties
  @node_properties
end

The symlinks in the directory. Corresponds to the JSON property symlinks



715
716
717
# File 'generated/google/apis/remotebuildexecution_v1alpha/classes.rb', line 715

def symlinks
  @symlinks
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



722
723
724
725
726
727
# File 'generated/google/apis/remotebuildexecution_v1alpha/classes.rb', line 722

def update!(**args)
  @directories = args[:directories] if args.key?(:directories)
  @files = args[:files] if args.key?(:files)
  @node_properties = args[:node_properties] if args.key?(:node_properties)
  @symlinks = args[:symlinks] if args.key?(:symlinks)
end