require 'date' module HelixWebServices # A list of per-repo settings that override global settings. class GitFusionRepoGlobalOverrides # Defines the default Unicode setting that Git Fusion applies to new repos.\nThis setting is valid only when Git Fusion interacts with a Unicode-enabled Perforce server.\n\n(Defaults to `UTF-8`). attr_accessor :charset # Allow Git users to create new repos by pushing/pulling a git url which specifies a Perforce depot path.\nThis is similar to creating a repo from a p4 client. attr_accessor :depot_path_repo_creation_enable # Restrict which authenticated Git pushers are allowed to create new repos when depot-path-repo-creation-enable is enabled. attr_accessor :depot_path_repo_creation_p4group # Defines whether Git Fusion assigns either the Git commit author or the Git pusher as the owner of a pushed change (submit). attr_accessor :change_owner # Defines whether Git Fusion creates a new branch of Perforce depot file hierarchy for each copied branch of Git workspace history, including Git task branches as Git Fusion anonymous branches. attr_accessor :enable_git_branch_creation # Permits branch creation for Swarm reviews, even when enable-git-branch-creation is disabled. attr_accessor :enable_swarm_reviews # Defines whether Git Fusion copies merge commits and displays them in Perforce as integrations between Perforce branches. attr_accessor :enable_git_merge_commits # Defines whether Git Fusion allows Git submodules to be pushed to Perforce. attr_accessor :enable_git_submodules # Defines whether Git Fusion evaluates both the author's and pusher's Perforce write permissions during a push or evaluates only the pusher's permissions. attr_accessor :ignore_author_permissions # Enables you to trigger pre-flight commit scripts that enforce local policy for Git pushes. This can be especially useful if you have Perforce submit triggers that could reject a push and damage the repository. attr_accessor :preflight_commit # Enables you to require that Git clone, pull, or fetch requests check the Perforce protections table for the puller's read permission on the files being pulled. attr_accessor :read_permission_check # If the Perforce service includes any changelists submitted by Git Fusion 13.2 or earlier, you can prevent unnecessary merge commits by setting this key to the number of the last changelist submitted before your site upgraded to a later version of Git Fusion. attr_accessor :git_merge_avoidance_after_change_num # Set the format for entering Perforce jobs in Git commit descriptions so that they are recognized by Git Fusion and appear in Perforce changelists as fixes.\nBy default, job IDs whose string starts with \"job\" (as in job123456) are passed through to the changelist description and job field.\nUse this option if you want Git Fusion to recognize additional expressions, such as JIRA issue IDs. attr_accessor :job_lookup # Allow Git users to create new fully-populated depot branches within Perforce. attr_accessor :depot_branch_creation_enable # Restrict the authenticated Git pushers who are allowed to create new fully-populated depot branches, if depotBranchCreationEnable is enabled. attr_accessor :depot_branch_creation_p4group # Tell Git Fusion where to create new fully-populated depot branches, if depotBranchCreationEnable is enabled.\n\nDefault path is `//depot/[repo]/[git_branch_name]`. attr_accessor :depot_branch_creation_depot_path # Set how the depot path set in depotBranchCreationDepotPath should appear in Git.\n\nEnter a Perforce view specification that maps Perforce depot paths (left side) to Git work tree paths (right side).\nPerforce depot paths are relative to the root set in depotBranchCreationDepotPath.\n\nThe default `... ...` maps every file under the depotBranchCreationDepotPath root to Git.\nRight side paths must match the right side for every other branch already defined within a repo. attr_accessor :depot_branch_creation_view # When Git reports a copy file action, store that action in Perforce as a p4 integ.\nOften set in tandem with enableGitFindRenames.\n\nNo/Off/0%: Do not use Git's copy detection.\nTreat all possible file copy actions as p4 add actions.\n\n1%-100%: Use Git's copy detection. Value passed to git diff-tree --find-copies=n.\n\nGit Fusion also adds --find-copies-harder whenever adding --find-copies. attr_accessor :enable_git_find_copies # When Git reports a rename (also called move) file action, store that in Perforce as a p4 move.\nOften set in tandem with enableGitFindCopies.\n\n`No`/`Off`/`0%`: Do not use Git's rename detection.\nTreat all possible file rename actions as independent p4 delete and p4 add actions.\n\n`1%`-`100%`: Use Git's rename detection.\nValue passed to git diff-tree --find-renames=n. attr_accessor :enable_git_find_renames # Enables you to convert Perforce stream import paths to Git submodules when you clone a Git Fusion repository.\nIf set to Yes, you must also set either httpUrl or sshUrl. attr_accessor :enable_stream_imports # The URL used by Git to clone a repository from Git Fusion over HTTP.\nThis property is required if you want to use Perforce stream import paths as git submodules and you use HTTP(S). attr_accessor :http_url # The \"URL\" used by Git to clone a repository from Git Fusion using SSH.\nThis property is required if you want to use Perforce stream import paths as git submodules and you use SSH. attr_accessor :ssh_url # Defines whether Git Fusion pays attention to case when matching Git user email addresses to Perforce user account email addresses during the authorization check. attr_accessor :email_case_sensitivity # Defines the source that Git Fusion uses to identify the Perforce user associated with a Git push.\n\nDefaults to `git-email`.\n\nUse any one of the following values:\n\n- `git-email`: Use the email address of the Git author to look for a Perforce user account with the same email address. Git Fusion consults the p4gf_usermap file first, and if that fails to produce a match, it scans the Perforce user table.\n- `git-user`: Use the user.name field in the Git commit. This is the part of the author field before the email address.\n- `git-email-account`: Use the account portion of the Git author's email address. If the Git author's email value is `samwise@the_shire.com`, Git Fusion uses the Perforce account samwise.\n\nYou can also tell Git Fusion to iterate through multiple source types until it finds a matching Perforce account. Specify the source types in order of precedence, separated by commas. For example: git-user, git-email-account, git-email. attr_accessor :author_source # Natural number representing the number of megabytes of disk space that can be consumed by any single repo.\nThis value does not include the spaced consumed on the Perforce server. attr_accessor :limit_space_mb # Natural number representing the maximum number of commits allowed in a single push. attr_accessor :limit_commits_received # Natural number representing the maximum number of files allowed in a single push. attr_accessor :limit_files_received # Natural number representing the maximum number of megabytes allowed in a single push. attr_accessor :limit_megabytes_received # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'charset' => :'charset', :'depot_path_repo_creation_enable' => :'depotPathRepoCreationEnable', :'depot_path_repo_creation_p4group' => :'depotPathRepoCreationP4group', :'change_owner' => :'changeOwner', :'enable_git_branch_creation' => :'enableGitBranchCreation', :'enable_swarm_reviews' => :'enableSwarmReviews', :'enable_git_merge_commits' => :'enableGitMergeCommits', :'enable_git_submodules' => :'enableGitSubmodules', :'ignore_author_permissions' => :'ignoreAuthorPermissions', :'preflight_commit' => :'preflightCommit', :'read_permission_check' => :'readPermissionCheck', :'git_merge_avoidance_after_change_num' => :'gitMergeAvoidanceAfterChangeNum', :'job_lookup' => :'jobLookup', :'depot_branch_creation_enable' => :'depotBranchCreationEnable', :'depot_branch_creation_p4group' => :'depotBranchCreationP4group', :'depot_branch_creation_depot_path' => :'depotBranchCreationDepotPath', :'depot_branch_creation_view' => :'depotBranchCreationView', :'enable_git_find_copies' => :'enableGitFindCopies', :'enable_git_find_renames' => :'enableGitFindRenames', :'enable_stream_imports' => :'enableStreamImports', :'http_url' => :'httpUrl', :'ssh_url' => :'sshUrl', :'email_case_sensitivity' => :'emailCaseSensitivity', :'author_source' => :'authorSource', :'limit_space_mb' => :'limitSpaceMb', :'limit_commits_received' => :'limitCommitsReceived', :'limit_files_received' => :'limitFilesReceived', :'limit_megabytes_received' => :'limitMegabytesReceived' } end # Attribute type mapping. def self.swagger_types { :'charset' => :'String', :'depot_path_repo_creation_enable' => :'String', :'depot_path_repo_creation_p4group' => :'String', :'change_owner' => :'String', :'enable_git_branch_creation' => :'String', :'enable_swarm_reviews' => :'String', :'enable_git_merge_commits' => :'String', :'enable_git_submodules' => :'String', :'ignore_author_permissions' => :'String', :'preflight_commit' => :'String', :'read_permission_check' => :'String', :'git_merge_avoidance_after_change_num' => :'String', :'job_lookup' => :'String', :'depot_branch_creation_enable' => :'String', :'depot_branch_creation_p4group' => :'String', :'depot_branch_creation_depot_path' => :'String', :'depot_branch_creation_view' => :'String', :'enable_git_find_copies' => :'String', :'enable_git_find_renames' => :'String', :'enable_stream_imports' => :'String', :'http_url' => :'String', :'ssh_url' => :'String', :'email_case_sensitivity' => :'String', :'author_source' => :'String', :'limit_space_mb' => :'String', :'limit_commits_received' => :'String', :'limit_files_received' => :'String', :'limit_megabytes_received' => :'String' } 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[:'charset'] self.charset = attributes[:'charset'] end if attributes[:'depotPathRepoCreationEnable'] self.depot_path_repo_creation_enable = attributes[:'depotPathRepoCreationEnable'] end if attributes[:'depotPathRepoCreationP4group'] self.depot_path_repo_creation_p4group = attributes[:'depotPathRepoCreationP4group'] end if attributes[:'changeOwner'] self.change_owner = attributes[:'changeOwner'] end if attributes[:'enableGitBranchCreation'] self.enable_git_branch_creation = attributes[:'enableGitBranchCreation'] end if attributes[:'enableSwarmReviews'] self.enable_swarm_reviews = attributes[:'enableSwarmReviews'] end if attributes[:'enableGitMergeCommits'] self.enable_git_merge_commits = attributes[:'enableGitMergeCommits'] end if attributes[:'enableGitSubmodules'] self.enable_git_submodules = attributes[:'enableGitSubmodules'] end if attributes[:'ignoreAuthorPermissions'] self.ignore_author_permissions = attributes[:'ignoreAuthorPermissions'] end if attributes[:'preflightCommit'] self.preflight_commit = attributes[:'preflightCommit'] end if attributes[:'readPermissionCheck'] self.read_permission_check = attributes[:'readPermissionCheck'] end if attributes[:'gitMergeAvoidanceAfterChangeNum'] self.git_merge_avoidance_after_change_num = attributes[:'gitMergeAvoidanceAfterChangeNum'] end if attributes[:'jobLookup'] self.job_lookup = attributes[:'jobLookup'] end if attributes[:'depotBranchCreationEnable'] self.depot_branch_creation_enable = attributes[:'depotBranchCreationEnable'] end if attributes[:'depotBranchCreationP4group'] self.depot_branch_creation_p4group = attributes[:'depotBranchCreationP4group'] end if attributes[:'depotBranchCreationDepotPath'] self.depot_branch_creation_depot_path = attributes[:'depotBranchCreationDepotPath'] end if attributes[:'depotBranchCreationView'] self.depot_branch_creation_view = attributes[:'depotBranchCreationView'] end if attributes[:'enableGitFindCopies'] self.enable_git_find_copies = attributes[:'enableGitFindCopies'] end if attributes[:'enableGitFindRenames'] self.enable_git_find_renames = attributes[:'enableGitFindRenames'] end if attributes[:'enableStreamImports'] self.enable_stream_imports = attributes[:'enableStreamImports'] end if attributes[:'httpUrl'] self.http_url = attributes[:'httpUrl'] end if attributes[:'sshUrl'] self.ssh_url = attributes[:'sshUrl'] end if attributes[:'emailCaseSensitivity'] self.email_case_sensitivity = attributes[:'emailCaseSensitivity'] end if attributes[:'authorSource'] self.author_source = attributes[:'authorSource'] end if attributes[:'limitSpaceMb'] self.limit_space_mb = attributes[:'limitSpaceMb'] end if attributes[:'limitCommitsReceived'] self.limit_commits_received = attributes[:'limitCommitsReceived'] end if attributes[:'limitFilesReceived'] self.limit_files_received = attributes[:'limitFilesReceived'] end if attributes[:'limitMegabytesReceived'] self.limit_megabytes_received = attributes[:'limitMegabytesReceived'] end end # Check equality by comparing each attribute. def ==(o) return true if self.equal?(o) self.class == o.class && charset == o.charset && depot_path_repo_creation_enable == o.depot_path_repo_creation_enable && depot_path_repo_creation_p4group == o.depot_path_repo_creation_p4group && change_owner == o.change_owner && enable_git_branch_creation == o.enable_git_branch_creation && enable_swarm_reviews == o.enable_swarm_reviews && enable_git_merge_commits == o.enable_git_merge_commits && enable_git_submodules == o.enable_git_submodules && ignore_author_permissions == o.ignore_author_permissions && preflight_commit == o.preflight_commit && read_permission_check == o.read_permission_check && git_merge_avoidance_after_change_num == o.git_merge_avoidance_after_change_num && job_lookup == o.job_lookup && depot_branch_creation_enable == o.depot_branch_creation_enable && depot_branch_creation_p4group == o.depot_branch_creation_p4group && depot_branch_creation_depot_path == o.depot_branch_creation_depot_path && depot_branch_creation_view == o.depot_branch_creation_view && enable_git_find_copies == o.enable_git_find_copies && enable_git_find_renames == o.enable_git_find_renames && enable_stream_imports == o.enable_stream_imports && http_url == o.http_url && ssh_url == o.ssh_url && email_case_sensitivity == o.email_case_sensitivity && author_source == o.author_source && limit_space_mb == o.limit_space_mb && limit_commits_received == o.limit_commits_received && limit_files_received == o.limit_files_received && limit_megabytes_received == o.limit_megabytes_received end # @see the `==` method def eql?(o) self == o end # Calculate hash code according to all attributes. def hash [charset, depot_path_repo_creation_enable, depot_path_repo_creation_p4group, change_owner, enable_git_branch_creation, enable_swarm_reviews, enable_git_merge_commits, enable_git_submodules, ignore_author_permissions, preflight_commit, read_permission_check, git_merge_avoidance_after_change_num, job_lookup, depot_branch_creation_enable, depot_branch_creation_p4group, depot_branch_creation_depot_path, depot_branch_creation_view, enable_git_find_copies, enable_git_find_renames, enable_stream_imports, http_url, ssh_url, email_case_sensitivity, author_source, limit_space_mb, limit_commits_received, limit_files_received, limit_megabytes_received].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