<commit_before>Puppet::Type.newtype(:ciscoucs_serviceprofile_clone) do
  @doc = 'This represents clone service profile on cisco ucs'
  ensurable

  newparam(:source_serviceprofile_name, :namevar => true) do
    desc "This parameter describes name of the source service profile"
    validate do |value|
      if value && value.strip.length != 0
        unless value =~ /\A[a-zA-Z0-9\d_\.\:\-\/\s]{1,31}+\Z/
          raise ArgumentError, "%s is invalid." % value
        end
      end
    end
  end

  newparam(:source_organization) do
    desc "This parameter describes name of the source organization. A valid format is org-root/[sub-organization]/[sub-organization]...."
    validate do |value|
      if value && value.strip.length != 0
        unless value =~ /\A[a-zA-Z0-9\d_\.\:\-\/\s]{1,31}+\Z/
          raise ArgumentError, "%s is invalid." % value
        end
      end
    end
  end

  newparam(:source_profile_dn) do
    desc "This parameter describes source service profile dn. A valid format is org-root/[sub-organization]/[sub-organization]..../ls-[profile name]"
    validate do |value|
      if value  &&  value.strip.length != 0
        unless value =~ /\A[a-zA-Z0-9\d_\.\:\-\/\s]{1,31}+\Z/
          raise ArgumentError, "%s is invalid." % value
        end
      end
    end
  end

  newparam(:target_serviceprofile_name) do
    desc "This parameter describes name of the target service profile"
    validate do |value|
      if value && value.strip.length != 0
        unless value =~ /\A[a-zA-Z0-9\d_\.\:\-\/\s]{1,31}+\Z/
          raise ArgumentError, "%s is invalid." % value
        end
      end
    end
  end

  newparam(:target_organization) do
    desc "This parameter describes name of the target organization. A valid format is org-root/[sub-organization]/[sub-organization]...."
    validate do |value|
      if value && value.strip.length != 0
        unless value =~ /\A[a-zA-Z0-9\d_\.\:\-\/\s]{1,31}+\Z/
          raise ArgumentError, "%s is invalid." % value
        end
      end
    end
  end

  newparam(:target_profile_dn) do
    desc "This parameter describes target service profile dn. A valid format is org-root/[sub-organization]/[sub-organization]..../ls-[profile name]"
    validate do |value|
      if value  &&  value.strip.length != 0
        unless value =~ /\A[a-zA-Z0-9\d_\.\:\-\/\s]{1,31}+\Z/
          raise ArgumentError, "%s is invalid." % value
        end
      end
    end
  end

  validate do
    if !self[:target_profile_dn] || self[:target_profile_dn].strip.length==0
      # if dn is empty then both org or profile name should exists.
      if (!self[:target_organization] || self[:target_organization].strip.length == 0) || (!self[:target_serviceprofile_name] || self[:target_serviceprofile_name].strip.length == 0)
        raise ArgumentError, "Provide either target profile dn or both target organization and target profile name as input."
      end
    end
    if !self[:source_profile_dn] || self[:source_profile_dn].strip.length==0
          # if dn is empty then both org or profile name should exists.
          if (!self[:source_organization] || self[:source_organization].strip.length == 0) || (!self[:source_serviceprofile_name] || self[:source_serviceprofile_name].strip.length == 0)
            raise ArgumentError, "Provide either source profile dn or both source organization and source profile name as input"
          end
        end
        
  end

end
<commit_msg>checked in for inline documentation<commit_after>Puppet::Type.newtype(:ciscoucs_serviceprofile_clone) do
  @doc = 'This represents the Clone Service Profile operation on the Cisco UCS.'
  ensurable

  newparam(:source_serviceprofile_name, :namevar => true) do
    desc "This parameter describes name of the source service profile"
    validate do |value|
      if value && value.strip.length != 0
        unless value =~ /\A[a-zA-Z0-9\d_\.\:\-\/\s]{1,31}+\Z/
          raise ArgumentError, "%s is invalid." % value
        end
      end
    end
  end

  newparam(:source_organization) do
    desc "This parameter describes name of the source organization. A valid format for the source organization is org-root/[sub-organization]/[sub-organization]...."
    validate do |value|
      if value && value.strip.length != 0
        unless value =~ /\A[a-zA-Z0-9\d_\.\:\-\/\s]{1,31}+\Z/
          raise ArgumentError, "%s is invalid." % value
        end
      end
    end
  end

  newparam(:source_profile_dn) do
    desc "This parameter describes source service profile dn. A valid format for source profile dn is org-root/[sub-organization]/[sub-organization]..../ls-[profile name]"
    validate do |value|
      if value  &&  value.strip.length != 0
        unless value =~ /\A[a-zA-Z0-9\d_\.\:\-\/\s]{1,31}+\Z/
          raise ArgumentError, "%s is invalid." % value
        end
      end
    end
  end

  newparam(:target_serviceprofile_name) do
    desc "This parameter describes name of the target service profile"
    validate do |value|
      if value && value.strip.length != 0
        unless value =~ /\A[a-zA-Z0-9\d_\.\:\-\/\s]{1,31}+\Z/
          raise ArgumentError, "%s is invalid." % value
        end
      end
    end
  end

  newparam(:target_organization) do
    desc "This parameter describes name of the target organization. A valid format for target organization is org-root/[sub-organization]/[sub-organization]...."
    validate do |value|
      if value && value.strip.length != 0
        unless value =~ /\A[a-zA-Z0-9\d_\.\:\-\/\s]{1,31}+\Z/
          raise ArgumentError, "%s is invalid." % value
        end
      end
    end
  end

  newparam(:target_profile_dn) do
    desc "This parameter describes target service profile dn. A valid format for target service profile dn is org-root/[sub-organization]/[sub-organization]..../ls-[profile name]"
    validate do |value|
      if value  &&  value.strip.length != 0
        unless value =~ /\A[a-zA-Z0-9\d_\.\:\-\/\s]{1,31}+\Z/
          raise ArgumentError, "%s is invalid." % value
        end
      end
    end
  end

  validate do
    if !self[:target_profile_dn] || self[:target_profile_dn].strip.length==0
      # if dn is empty then both org or profile name should exists.
      if (!self[:target_organization] || self[:target_organization].strip.length == 0) || (!self[:target_serviceprofile_name] || self[:target_serviceprofile_name].strip.length == 0)
        raise ArgumentError, "Either a target profile dn or both the target organization and target profile name is to be provided as an input."
      end
    end
    if !self[:source_profile_dn] || self[:source_profile_dn].strip.length==0
          # if dn is empty then both org or profile name should exists.
          if (!self[:source_organization] || self[:source_organization].strip.length == 0) || (!self[:source_serviceprofile_name] || self[:source_serviceprofile_name].strip.length == 0)
            raise ArgumentError, "Either a source profile dn or both the source organization and source profile name is to be provided as an input."
          end
        end
        
  end

end

{'fraction_non_alphanumeric': 0.1263782866836302, 'fraction_numerical': 0.011874469889737066, 'mean_word_length': 2.6023421588594706, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3427201', 'n_tokens_mistral': 2177, 'n_tokens_neox': 2055, 'n_words': 651}