Class: CloudsmithApi::RepositoryCreate

Inherits:
Object
  • Object
show all
Defined in:
lib/cloudsmith-api/models/repository_create.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ RepositoryCreate

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
# File 'lib/cloudsmith-api/models/repository_create.rb', line 362

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  if attributes.has_key?(:'cdn_url')
    self.cdn_url = attributes[:'cdn_url']
  end

  if attributes.has_key?(:'content_kind')
    self.content_kind = attributes[:'content_kind']
  else
    self.content_kind = 'Standard'
  end

  if attributes.has_key?(:'contextual_auth_realm')
    self.contextual_auth_realm = attributes[:'contextual_auth_realm']
  end

  if attributes.has_key?(:'copy_own')
    self.copy_own = attributes[:'copy_own']
  end

  if attributes.has_key?(:'copy_packages')
    self.copy_packages = attributes[:'copy_packages']
  else
    self.copy_packages = 'Read'
  end

  if attributes.has_key?(:'created_at')
    self.created_at = attributes[:'created_at']
  end

  if attributes.has_key?(:'default_privilege')
    self.default_privilege = attributes[:'default_privilege']
  else
    self.default_privilege = 'None'
  end

  if attributes.has_key?(:'delete_own')
    self.delete_own = attributes[:'delete_own']
  end

  if attributes.has_key?(:'delete_packages')
    self.delete_packages = attributes[:'delete_packages']
  else
    self.delete_packages = 'Admin'
  end

  if attributes.has_key?(:'deleted_at')
    self.deleted_at = attributes[:'deleted_at']
  end

  if attributes.has_key?(:'description')
    self.description = attributes[:'description']
  end

  if attributes.has_key?(:'distributes')
    if (value = attributes[:'distributes']).is_a?(Array)
      self.distributes = value
    end
  end

  if attributes.has_key?(:'docker_refresh_tokens_enabled')
    self.docker_refresh_tokens_enabled = attributes[:'docker_refresh_tokens_enabled']
  end

  if attributes.has_key?(:'ecdsa_keys')
    if (value = attributes[:'ecdsa_keys']).is_a?(Array)
      self.ecdsa_keys = value
    end
  end

  if attributes.has_key?(:'enforce_eula')
    self.enforce_eula = attributes[:'enforce_eula']
  end

  if attributes.has_key?(:'gpg_keys')
    if (value = attributes[:'gpg_keys']).is_a?(Array)
      self.gpg_keys = value
    end
  end

  if attributes.has_key?(:'index_files')
    self.index_files = attributes[:'index_files']
  end

  if attributes.has_key?(:'is_open_source')
    self.is_open_source = attributes[:'is_open_source']
  end

  if attributes.has_key?(:'is_private')
    self.is_private = attributes[:'is_private']
  end

  if attributes.has_key?(:'is_public')
    self.is_public = attributes[:'is_public']
  end

  if attributes.has_key?(:'manage_entitlements_privilege')
    self.manage_entitlements_privilege = attributes[:'manage_entitlements_privilege']
  else
    self.manage_entitlements_privilege = 'Admin'
  end

  if attributes.has_key?(:'move_own')
    self.move_own = attributes[:'move_own']
  end

  if attributes.has_key?(:'move_packages')
    self.move_packages = attributes[:'move_packages']
  else
    self.move_packages = 'Admin'
  end

  if attributes.has_key?(:'name')
    self.name = attributes[:'name']
  end

  if attributes.has_key?(:'namespace')
    self.namespace = attributes[:'namespace']
  end

  if attributes.has_key?(:'namespace_url')
    self.namespace_url = attributes[:'namespace_url']
  end

  if attributes.has_key?(:'num_downloads')
    self.num_downloads = attributes[:'num_downloads']
  end

  if attributes.has_key?(:'num_policy_violated_packages')
    self.num_policy_violated_packages = attributes[:'num_policy_violated_packages']
  end

  if attributes.has_key?(:'num_quarantined_packages')
    self.num_quarantined_packages = attributes[:'num_quarantined_packages']
  end

  if attributes.has_key?(:'open_source_license')
    self.open_source_license = attributes[:'open_source_license']
  end

  if attributes.has_key?(:'open_source_project_url')
    self.open_source_project_url = attributes[:'open_source_project_url']
  end

  if attributes.has_key?(:'package_count')
    self.package_count = attributes[:'package_count']
  end

  if attributes.has_key?(:'package_group_count')
    self.package_group_count = attributes[:'package_group_count']
  end

  if attributes.has_key?(:'proxy_npmjs')
    self.proxy_npmjs = attributes[:'proxy_npmjs']
  end

  if attributes.has_key?(:'proxy_pypi')
    self.proxy_pypi = attributes[:'proxy_pypi']
  end

  if attributes.has_key?(:'raw_package_index_enabled')
    self.raw_package_index_enabled = attributes[:'raw_package_index_enabled']
  end

  if attributes.has_key?(:'raw_package_index_signatures_enabled')
    self.raw_package_index_signatures_enabled = attributes[:'raw_package_index_signatures_enabled']
  end

  if attributes.has_key?(:'replace_packages')
    self.replace_packages = attributes[:'replace_packages']
  else
    self.replace_packages = 'Write'
  end

  if attributes.has_key?(:'replace_packages_by_default')
    self.replace_packages_by_default = attributes[:'replace_packages_by_default']
  end

  if attributes.has_key?(:'repository_type')
    self.repository_type = attributes[:'repository_type']
  end

  if attributes.has_key?(:'repository_type_str')
    self.repository_type_str = attributes[:'repository_type_str']
  else
    self.repository_type_str = 'Public'
  end

  if attributes.has_key?(:'resync_own')
    self.resync_own = attributes[:'resync_own']
  end

  if attributes.has_key?(:'resync_packages')
    self.resync_packages = attributes[:'resync_packages']
  else
    self.resync_packages = 'Admin'
  end

  if attributes.has_key?(:'scan_own')
    self.scan_own = attributes[:'scan_own']
  end

  if attributes.has_key?(:'scan_packages')
    self.scan_packages = attributes[:'scan_packages']
  else
    self.scan_packages = 'Read'
  end

  if attributes.has_key?(:'self_html_url')
    self.self_html_url = attributes[:'self_html_url']
  end

  if attributes.has_key?(:'self_url')
    self.self_url = attributes[:'self_url']
  end

  if attributes.has_key?(:'show_setup_all')
    self.show_setup_all = attributes[:'show_setup_all']
  end

  if attributes.has_key?(:'size')
    self.size = attributes[:'size']
  end

  if attributes.has_key?(:'size_str')
    self.size_str = attributes[:'size_str']
  end

  if attributes.has_key?(:'slug')
    self.slug = attributes[:'slug']
  end

  if attributes.has_key?(:'slug_perm')
    self.slug_perm = attributes[:'slug_perm']
  end

  if attributes.has_key?(:'storage_region')
    self.storage_region = attributes[:'storage_region']
  else
    self.storage_region = 'default'
  end

  if attributes.has_key?(:'strict_npm_validation')
    self.strict_npm_validation = attributes[:'strict_npm_validation']
  end

  if attributes.has_key?(:'tag_pre_releases_as_latest')
    self.tag_pre_releases_as_latest = attributes[:'tag_pre_releases_as_latest']
  end

  if attributes.has_key?(:'use_debian_labels')
    self.use_debian_labels = attributes[:'use_debian_labels']
  end

  if attributes.has_key?(:'use_default_cargo_upstream')
    self.use_default_cargo_upstream = attributes[:'use_default_cargo_upstream']
  end

  if attributes.has_key?(:'use_entitlements_privilege')
    self.use_entitlements_privilege = attributes[:'use_entitlements_privilege']
  else
    self.use_entitlements_privilege = 'Read'
  end

  if attributes.has_key?(:'use_noarch_packages')
    self.use_noarch_packages = attributes[:'use_noarch_packages']
  end

  if attributes.has_key?(:'use_source_packages')
    self.use_source_packages = attributes[:'use_source_packages']
  end

  if attributes.has_key?(:'use_vulnerability_scanning')
    self.use_vulnerability_scanning = attributes[:'use_vulnerability_scanning']
  end

  if attributes.has_key?(:'user_entitlements_enabled')
    self.user_entitlements_enabled = attributes[:'user_entitlements_enabled']
  end

  if attributes.has_key?(:'view_statistics')
    self.view_statistics = attributes[:'view_statistics']
  else
    self.view_statistics = 'Read'
  end
end

Instance Attribute Details

#cdn_urlObject

Base URL from which packages and other artifacts are downloaded.



18
19
20
# File 'lib/cloudsmith-api/models/repository_create.rb', line 18

def cdn_url
  @cdn_url
end

#content_kindObject

The repository content kind determines whether this repository contains packages, or provides a distribution of packages from other repositories. You can only select the content kind at repository creation time.



21
22
23
# File 'lib/cloudsmith-api/models/repository_create.rb', line 21

def content_kind
  @content_kind
end

#contextual_auth_realmObject

If checked, missing credentials for this repository where basic authentication is required shall present an enriched value in the ‘WWW-Authenticate’ header containing the namespace and repository. This can be useful for tooling such as SBT where the authentication realm is used to distinguish and disambiguate credentials.



24
25
26
# File 'lib/cloudsmith-api/models/repository_create.rb', line 24

def contextual_auth_realm
  @contextual_auth_realm
end

#copy_ownObject

If checked, users can copy any of their own packages that they have uploaded, assuming that they still have write privilege for the repository. This takes precedence over privileges configured in the ‘Access Controls’ section of the repository, and any inherited from the org.



27
28
29
# File 'lib/cloudsmith-api/models/repository_create.rb', line 27

def copy_own
  @copy_own
end

#copy_packagesObject

This defines the minimum level of privilege required for a user to copy packages. Unless the package was uploaded by that user, in which the permission may be overridden by the user-specific copy setting.



30
31
32
# File 'lib/cloudsmith-api/models/repository_create.rb', line 30

def copy_packages
  @copy_packages
end

#created_atObject

Returns the value of attribute created_at.



32
33
34
# File 'lib/cloudsmith-api/models/repository_create.rb', line 32

def created_at
  @created_at
end

#default_privilegeObject

This defines the default level of privilege that all of your organization members have for this repository. This does not include collaborators, but applies to any member of the org regardless of their own membership role (i.e. it applies to owners, managers and members). Be careful if setting this to admin, because any member will be able to change settings.



35
36
37
# File 'lib/cloudsmith-api/models/repository_create.rb', line 35

def default_privilege
  @default_privilege
end

#delete_ownObject

If checked, users can delete any of their own packages that they have uploaded, assuming that they still have write privilege for the repository. This takes precedence over privileges configured in the ‘Access Controls’ section of the repository, and any inherited from the org.



38
39
40
# File 'lib/cloudsmith-api/models/repository_create.rb', line 38

def delete_own
  @delete_own
end

#delete_packagesObject

This defines the minimum level of privilege required for a user to delete packages. Unless the package was uploaded by that user, in which the permission may be overridden by the user-specific delete setting.



41
42
43
# File 'lib/cloudsmith-api/models/repository_create.rb', line 41

def delete_packages
  @delete_packages
end

#deleted_atObject

The datetime the repository was manually deleted at.



44
45
46
# File 'lib/cloudsmith-api/models/repository_create.rb', line 44

def deleted_at
  @deleted_at
end

#descriptionObject

A description of the repository’s purpose/contents.



47
48
49
# File 'lib/cloudsmith-api/models/repository_create.rb', line 47

def description
  @description
end

#distributesObject

The repositories distributed through this repo. Adding repos here is only valid if the content_kind is DISTRIBUTION.



50
51
52
# File 'lib/cloudsmith-api/models/repository_create.rb', line 50

def distributes
  @distributes
end

#docker_refresh_tokens_enabledObject

If checked, refresh tokens will be issued in addition to access tokens for Docker authentication. This allows unlimited extension of the lifetime of access tokens.



53
54
55
# File 'lib/cloudsmith-api/models/repository_create.rb', line 53

def docker_refresh_tokens_enabled
  @docker_refresh_tokens_enabled
end

#ecdsa_keysObject

Returns the value of attribute ecdsa_keys.



55
56
57
# File 'lib/cloudsmith-api/models/repository_create.rb', line 55

def ecdsa_keys
  @ecdsa_keys
end

#enforce_eulaObject

If checked, downloads will explicitly require acceptance of an EULA.



58
59
60
# File 'lib/cloudsmith-api/models/repository_create.rb', line 58

def enforce_eula
  @enforce_eula
end

#gpg_keysObject

Returns the value of attribute gpg_keys.



60
61
62
# File 'lib/cloudsmith-api/models/repository_create.rb', line 60

def gpg_keys
  @gpg_keys
end

#index_filesObject

If checked, files contained in packages will be indexed, which increase the synchronisation time required for packages. Note that it is recommended you keep this enabled unless the synchronisation time is significantly impacted.



63
64
65
# File 'lib/cloudsmith-api/models/repository_create.rb', line 63

def index_files
  @index_files
end

#is_open_sourceObject

Returns the value of attribute is_open_source.



65
66
67
# File 'lib/cloudsmith-api/models/repository_create.rb', line 65

def is_open_source
  @is_open_source
end

#is_privateObject

Returns the value of attribute is_private.



67
68
69
# File 'lib/cloudsmith-api/models/repository_create.rb', line 67

def is_private
  @is_private
end

#is_publicObject

Returns the value of attribute is_public.



69
70
71
# File 'lib/cloudsmith-api/models/repository_create.rb', line 69

def is_public
  @is_public
end

#manage_entitlements_privilegeObject

This defines the minimum level of privilege required for a user to manage entitlement tokens with private repositories. Management is the ability to create, alter, enable, disable or delete all tokens without a repository.



72
73
74
# File 'lib/cloudsmith-api/models/repository_create.rb', line 72

def manage_entitlements_privilege
  @manage_entitlements_privilege
end

#move_ownObject

If checked, users can move any of their own packages that they have uploaded, assuming that they still have write privilege for the repository. This takes precedence over privileges configured in the ‘Access Controls’ section of the repository, and any inherited from the org.



75
76
77
# File 'lib/cloudsmith-api/models/repository_create.rb', line 75

def move_own
  @move_own
end

#move_packagesObject

This defines the minimum level of privilege required for a user to move packages. Unless the package was uploaded by that user, in which the permission may be overridden by the user-specific move setting.



78
79
80
# File 'lib/cloudsmith-api/models/repository_create.rb', line 78

def move_packages
  @move_packages
end

#nameObject

A descriptive name for the repository.



81
82
83
# File 'lib/cloudsmith-api/models/repository_create.rb', line 81

def name
  @name
end

#namespaceObject

Namespace to which this repository belongs.



84
85
86
# File 'lib/cloudsmith-api/models/repository_create.rb', line 84

def namespace
  @namespace
end

#namespace_urlObject

API endpoint where data about this namespace can be retrieved.



87
88
89
# File 'lib/cloudsmith-api/models/repository_create.rb', line 87

def namespace_url
  @namespace_url
end

#num_downloadsObject

The number of downloads for packages in the repository.



90
91
92
# File 'lib/cloudsmith-api/models/repository_create.rb', line 90

def num_downloads
  @num_downloads
end

#num_policy_violated_packagesObject

Number of packages with policy violations in a repository.



93
94
95
# File 'lib/cloudsmith-api/models/repository_create.rb', line 93

def num_policy_violated_packages
  @num_policy_violated_packages
end

#num_quarantined_packagesObject

Number of quarantined packages in a repository.



96
97
98
# File 'lib/cloudsmith-api/models/repository_create.rb', line 96

def num_quarantined_packages
  @num_quarantined_packages
end

#open_source_licenseObject

The SPDX identifier of the open source license.



99
100
101
# File 'lib/cloudsmith-api/models/repository_create.rb', line 99

def open_source_license
  @open_source_license
end

#open_source_project_urlObject

The URL to the Open-Source project, used for validating that the project meets the requirements for Open-Source.



102
103
104
# File 'lib/cloudsmith-api/models/repository_create.rb', line 102

def open_source_project_url
  @open_source_project_url
end

#package_countObject

The number of packages in the repository.



105
106
107
# File 'lib/cloudsmith-api/models/repository_create.rb', line 105

def package_count
  @package_count
end

#package_group_countObject

The number of groups in the repository.



108
109
110
# File 'lib/cloudsmith-api/models/repository_create.rb', line 108

def package_group_count
  @package_group_count
end

#proxy_npmjsObject

If checked, Npm packages that are not in the repository when requested by clients will automatically be proxied from the public npmjs.org registry. If there is at least one version for a package, others will not be proxied.



111
112
113
# File 'lib/cloudsmith-api/models/repository_create.rb', line 111

def proxy_npmjs
  @proxy_npmjs
end

#proxy_pypiObject

If checked, Python packages that are not in the repository when requested by clients will automatically be proxied from the public pypi.python.org registry. If there is at least one version for a package, others will not be proxied.



114
115
116
# File 'lib/cloudsmith-api/models/repository_create.rb', line 114

def proxy_pypi
  @proxy_pypi
end

#raw_package_index_enabledObject

If checked, HTML and JSON indexes will be generated that list all available raw packages in the repository.



117
118
119
# File 'lib/cloudsmith-api/models/repository_create.rb', line 117

def raw_package_index_enabled
  @raw_package_index_enabled
end

#raw_package_index_signatures_enabledObject

If checked, the HTML and JSON indexes will display raw package GPG signatures alongside the index packages.



120
121
122
# File 'lib/cloudsmith-api/models/repository_create.rb', line 120

def raw_package_index_signatures_enabled
  @raw_package_index_signatures_enabled
end

#replace_packagesObject

This defines the minimum level of privilege required for a user to republish packages. Unless the package was uploaded by that user, in which the permission may be overridden by the user-specific republish setting. Please note that the user still requires the privilege to delete packages that will be replaced by the new package; otherwise the republish will fail.



123
124
125
# File 'lib/cloudsmith-api/models/repository_create.rb', line 123

def replace_packages
  @replace_packages
end

#replace_packages_by_defaultObject

If checked, uploaded packages will overwrite/replace any others with the same attributes (e.g. same version) by default. This only applies if the user has the required privilege for the republishing AND has the required privilege to delete existing packages that they don’t own.



126
127
128
# File 'lib/cloudsmith-api/models/repository_create.rb', line 126

def replace_packages_by_default
  @replace_packages_by_default
end

#repository_typeObject

The repository type changes how it is accessed and billed. Private repositories are visible only to you or authorized delegates. Open-Source repositories are always visible to everyone and are restricted by licensing, but are free to use and come with generous bandwidth/storage. You can only select Open-Source at repository creation time.



129
130
131
# File 'lib/cloudsmith-api/models/repository_create.rb', line 129

def repository_type
  @repository_type
end

#repository_type_strObject

The repository type changes how it is accessed and billed. Private repositories are visible only to you or authorized delegates. Public repositories are visible to all Cloudsmith users.



132
133
134
# File 'lib/cloudsmith-api/models/repository_create.rb', line 132

def repository_type_str
  @repository_type_str
end

#resync_ownObject

If checked, users can resync any of their own packages that they have uploaded, assuming that they still have write privilege for the repository. This takes precedence over privileges configured in the ‘Access Controls’ section of the repository, and any inherited from the org.



135
136
137
# File 'lib/cloudsmith-api/models/repository_create.rb', line 135

def resync_own
  @resync_own
end

#resync_packagesObject

This defines the minimum level of privilege required for a user to resync packages. Unless the package was uploaded by that user, in which the permission may be overridden by the user-specific resync setting.



138
139
140
# File 'lib/cloudsmith-api/models/repository_create.rb', line 138

def resync_packages
  @resync_packages
end

#scan_ownObject

If checked, users can scan any of their own packages that they have uploaded, assuming that they still have write privilege for the repository. This takes precedence over privileges configured in the ‘Access Controls’ section of the repository, and any inherited from the org.



141
142
143
# File 'lib/cloudsmith-api/models/repository_create.rb', line 141

def scan_own
  @scan_own
end

#scan_packagesObject

This defines the minimum level of privilege required for a user to scan packages. Unless the package was uploaded by that user, in which the permission may be overridden by the user-specific scan setting.



144
145
146
# File 'lib/cloudsmith-api/models/repository_create.rb', line 144

def scan_packages
  @scan_packages
end

#self_html_urlObject

Website URL for this repository.



147
148
149
# File 'lib/cloudsmith-api/models/repository_create.rb', line 147

def self_html_url
  @self_html_url
end

#self_urlObject

API endpoint where data about this repository can be retrieved.



150
151
152
# File 'lib/cloudsmith-api/models/repository_create.rb', line 150

def self_url
  @self_url
end

#show_setup_allObject

If checked, the Set Me Up help for all formats will always be shown, even if you don’t have packages of that type uploaded. Otherwise, help will only be shown for packages that are in the repository. For example, if you have uploaded only NuGet packages, then the Set Me Up help for NuGet packages will be shown only.



153
154
155
# File 'lib/cloudsmith-api/models/repository_create.rb', line 153

def show_setup_all
  @show_setup_all
end

#sizeObject

The calculated size of the repository.



156
157
158
# File 'lib/cloudsmith-api/models/repository_create.rb', line 156

def size
  @size
end

#size_strObject

The calculated size of the repository (human readable).



159
160
161
# File 'lib/cloudsmith-api/models/repository_create.rb', line 159

def size_str
  @size_str
end

#slugObject

The slug identifies the repository in URIs.



162
163
164
# File 'lib/cloudsmith-api/models/repository_create.rb', line 162

def slug
  @slug
end

#slug_permObject

The slug_perm immutably identifies the repository. It will never change once a repository has been created.



165
166
167
# File 'lib/cloudsmith-api/models/repository_create.rb', line 165

def slug_perm
  @slug_perm
end

#storage_regionObject

The Cloudsmith region in which package files are stored.



168
169
170
# File 'lib/cloudsmith-api/models/repository_create.rb', line 168

def storage_region
  @storage_region
end

#strict_npm_validationObject

If checked, npm packages will be validated strictly to ensure the package matches specifcation. You can turn this on if you want to guarantee that the packages will work with npm-cli and other tools correctly.



171
172
173
# File 'lib/cloudsmith-api/models/repository_create.rb', line 171

def strict_npm_validation
  @strict_npm_validation
end

#tag_pre_releases_as_latestObject

If checked, packages pushed with a pre-release component on that version will be marked with the ‘latest’ tag. Note that if unchecked, a repository containing ONLY pre-release versions, will have no version marked latest which may cause incompatibility with native tools



174
175
176
# File 'lib/cloudsmith-api/models/repository_create.rb', line 174

def tag_pre_releases_as_latest
  @tag_pre_releases_as_latest
end

#use_debian_labelsObject

If checked, a ‘Label’ field will be present in Debian-based repositories. It will contain a string that identifies the entitlement token used to authenticate the repository, in the form of ‘source=t-<identifier>’; or ‘source=none’ if no token was used. You can use this to help with pinning.



177
178
179
# File 'lib/cloudsmith-api/models/repository_create.rb', line 177

def use_debian_labels
  @use_debian_labels
end

#use_default_cargo_upstreamObject

If checked, dependencies of uploaded Cargo crates which do not set an explicit value for "registry" will be assumed to be available from crates.io. If unchecked, dependencies with unspecified "registry" values will be assumed to be available in the registry being uploaded to. Uncheck this if you want to ensure that dependencies are only ever installed from Cloudsmith unless explicitly specified as belong to another registry.



180
181
182
# File 'lib/cloudsmith-api/models/repository_create.rb', line 180

def use_default_cargo_upstream
  @use_default_cargo_upstream
end

#use_entitlements_privilegeObject

This defines the minimum level of privilege required for a user to see/use entitlement tokens with private repositories. If a user does not have the permission, they will only be able to download packages using other credentials, such as email/password via basic authentication. Use this if you want to force users to only use their user-based token, which is tied to their access (if removed, they can’t use it).



183
184
185
# File 'lib/cloudsmith-api/models/repository_create.rb', line 183

def use_entitlements_privilege
  @use_entitlements_privilege
end

#use_noarch_packagesObject

If checked, noarch packages (if supported) are enabled in installations/configurations. A noarch package is one that is not tied to specific system architecture (like i686).



186
187
188
# File 'lib/cloudsmith-api/models/repository_create.rb', line 186

def use_noarch_packages
  @use_noarch_packages
end

#use_source_packagesObject

If checked, source packages (if supported) are enabled in installations/configurations. A source package is one that contains source code rather than built binaries.



189
190
191
# File 'lib/cloudsmith-api/models/repository_create.rb', line 189

def use_source_packages
  @use_source_packages
end

#use_vulnerability_scanningObject

If checked, vulnerability scanning will be enabled for all supported packages within this repository.



192
193
194
# File 'lib/cloudsmith-api/models/repository_create.rb', line 192

def use_vulnerability_scanning
  @use_vulnerability_scanning
end

#user_entitlements_enabledObject

If checked, users can use and manage their own user-specific entitlement token for the repository (if private). Otherwise, user-specific entitlements are disabled for all users.



195
196
197
# File 'lib/cloudsmith-api/models/repository_create.rb', line 195

def user_entitlements_enabled
  @user_entitlements_enabled
end

#view_statisticsObject

This defines the minimum level of privilege required for a user to view repository statistics, to include entitlement-based usage, if applicable. If a user does not have the permission, they won’t be able to view any statistics, either via the UI, API or CLI.



198
199
200
# File 'lib/cloudsmith-api/models/repository_create.rb', line 198

def view_statistics
  @view_statistics
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
# File 'lib/cloudsmith-api/models/repository_create.rb', line 223

def self.attribute_map
  {
    :'cdn_url' => :'cdn_url',
    :'content_kind' => :'content_kind',
    :'contextual_auth_realm' => :'contextual_auth_realm',
    :'copy_own' => :'copy_own',
    :'copy_packages' => :'copy_packages',
    :'created_at' => :'created_at',
    :'default_privilege' => :'default_privilege',
    :'delete_own' => :'delete_own',
    :'delete_packages' => :'delete_packages',
    :'deleted_at' => :'deleted_at',
    :'description' => :'description',
    :'distributes' => :'distributes',
    :'docker_refresh_tokens_enabled' => :'docker_refresh_tokens_enabled',
    :'ecdsa_keys' => :'ecdsa_keys',
    :'enforce_eula' => :'enforce_eula',
    :'gpg_keys' => :'gpg_keys',
    :'index_files' => :'index_files',
    :'is_open_source' => :'is_open_source',
    :'is_private' => :'is_private',
    :'is_public' => :'is_public',
    :'manage_entitlements_privilege' => :'manage_entitlements_privilege',
    :'move_own' => :'move_own',
    :'move_packages' => :'move_packages',
    :'name' => :'name',
    :'namespace' => :'namespace',
    :'namespace_url' => :'namespace_url',
    :'num_downloads' => :'num_downloads',
    :'num_policy_violated_packages' => :'num_policy_violated_packages',
    :'num_quarantined_packages' => :'num_quarantined_packages',
    :'open_source_license' => :'open_source_license',
    :'open_source_project_url' => :'open_source_project_url',
    :'package_count' => :'package_count',
    :'package_group_count' => :'package_group_count',
    :'proxy_npmjs' => :'proxy_npmjs',
    :'proxy_pypi' => :'proxy_pypi',
    :'raw_package_index_enabled' => :'raw_package_index_enabled',
    :'raw_package_index_signatures_enabled' => :'raw_package_index_signatures_enabled',
    :'replace_packages' => :'replace_packages',
    :'replace_packages_by_default' => :'replace_packages_by_default',
    :'repository_type' => :'repository_type',
    :'repository_type_str' => :'repository_type_str',
    :'resync_own' => :'resync_own',
    :'resync_packages' => :'resync_packages',
    :'scan_own' => :'scan_own',
    :'scan_packages' => :'scan_packages',
    :'self_html_url' => :'self_html_url',
    :'self_url' => :'self_url',
    :'show_setup_all' => :'show_setup_all',
    :'size' => :'size',
    :'size_str' => :'size_str',
    :'slug' => :'slug',
    :'slug_perm' => :'slug_perm',
    :'storage_region' => :'storage_region',
    :'strict_npm_validation' => :'strict_npm_validation',
    :'tag_pre_releases_as_latest' => :'tag_pre_releases_as_latest',
    :'use_debian_labels' => :'use_debian_labels',
    :'use_default_cargo_upstream' => :'use_default_cargo_upstream',
    :'use_entitlements_privilege' => :'use_entitlements_privilege',
    :'use_noarch_packages' => :'use_noarch_packages',
    :'use_source_packages' => :'use_source_packages',
    :'use_vulnerability_scanning' => :'use_vulnerability_scanning',
    :'user_entitlements_enabled' => :'user_entitlements_enabled',
    :'view_statistics' => :'view_statistics'
  }
end

.swagger_typesObject

Attribute type mapping.



292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
# File 'lib/cloudsmith-api/models/repository_create.rb', line 292

def self.swagger_types
  {
    :'cdn_url' => :'String',
    :'content_kind' => :'String',
    :'contextual_auth_realm' => :'BOOLEAN',
    :'copy_own' => :'BOOLEAN',
    :'copy_packages' => :'String',
    :'created_at' => :'DateTime',
    :'default_privilege' => :'String',
    :'delete_own' => :'BOOLEAN',
    :'delete_packages' => :'String',
    :'deleted_at' => :'DateTime',
    :'description' => :'String',
    :'distributes' => :'Array<String>',
    :'docker_refresh_tokens_enabled' => :'BOOLEAN',
    :'ecdsa_keys' => :'Array<RepositoryEcdsaKey>',
    :'enforce_eula' => :'BOOLEAN',
    :'gpg_keys' => :'Array<RepositoryGpgKey>',
    :'index_files' => :'BOOLEAN',
    :'is_open_source' => :'BOOLEAN',
    :'is_private' => :'BOOLEAN',
    :'is_public' => :'BOOLEAN',
    :'manage_entitlements_privilege' => :'String',
    :'move_own' => :'BOOLEAN',
    :'move_packages' => :'String',
    :'name' => :'String',
    :'namespace' => :'String',
    :'namespace_url' => :'String',
    :'num_downloads' => :'Integer',
    :'num_policy_violated_packages' => :'Integer',
    :'num_quarantined_packages' => :'Integer',
    :'open_source_license' => :'String',
    :'open_source_project_url' => :'String',
    :'package_count' => :'Integer',
    :'package_group_count' => :'Integer',
    :'proxy_npmjs' => :'BOOLEAN',
    :'proxy_pypi' => :'BOOLEAN',
    :'raw_package_index_enabled' => :'BOOLEAN',
    :'raw_package_index_signatures_enabled' => :'BOOLEAN',
    :'replace_packages' => :'String',
    :'replace_packages_by_default' => :'BOOLEAN',
    :'repository_type' => :'Integer',
    :'repository_type_str' => :'String',
    :'resync_own' => :'BOOLEAN',
    :'resync_packages' => :'String',
    :'scan_own' => :'BOOLEAN',
    :'scan_packages' => :'String',
    :'self_html_url' => :'String',
    :'self_url' => :'String',
    :'show_setup_all' => :'BOOLEAN',
    :'size' => :'Integer',
    :'size_str' => :'String',
    :'slug' => :'String',
    :'slug_perm' => :'String',
    :'storage_region' => :'String',
    :'strict_npm_validation' => :'BOOLEAN',
    :'tag_pre_releases_as_latest' => :'BOOLEAN',
    :'use_debian_labels' => :'BOOLEAN',
    :'use_default_cargo_upstream' => :'BOOLEAN',
    :'use_entitlements_privilege' => :'String',
    :'use_noarch_packages' => :'BOOLEAN',
    :'use_source_packages' => :'BOOLEAN',
    :'use_vulnerability_scanning' => :'BOOLEAN',
    :'user_entitlements_enabled' => :'BOOLEAN',
    :'view_statistics' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
# File 'lib/cloudsmith-api/models/repository_create.rb', line 817

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      cdn_url == o.cdn_url &&
      content_kind == o.content_kind &&
      contextual_auth_realm == o.contextual_auth_realm &&
      copy_own == o.copy_own &&
      copy_packages == o.copy_packages &&
      created_at == o.created_at &&
      default_privilege == o.default_privilege &&
      delete_own == o.delete_own &&
      delete_packages == o.delete_packages &&
      deleted_at == o.deleted_at &&
      description == o.description &&
      distributes == o.distributes &&
      docker_refresh_tokens_enabled == o.docker_refresh_tokens_enabled &&
      ecdsa_keys == o.ecdsa_keys &&
      enforce_eula == o.enforce_eula &&
      gpg_keys == o.gpg_keys &&
      index_files == o.index_files &&
      is_open_source == o.is_open_source &&
      is_private == o.is_private &&
      is_public == o.is_public &&
      manage_entitlements_privilege == o.manage_entitlements_privilege &&
      move_own == o.move_own &&
      move_packages == o.move_packages &&
      name == o.name &&
      namespace == o.namespace &&
      namespace_url == o.namespace_url &&
      num_downloads == o.num_downloads &&
      num_policy_violated_packages == o.num_policy_violated_packages &&
      num_quarantined_packages == o.num_quarantined_packages &&
      open_source_license == o.open_source_license &&
      open_source_project_url == o.open_source_project_url &&
      package_count == o.package_count &&
      package_group_count == o.package_group_count &&
      proxy_npmjs == o.proxy_npmjs &&
      proxy_pypi == o.proxy_pypi &&
      raw_package_index_enabled == o.raw_package_index_enabled &&
      raw_package_index_signatures_enabled == o.raw_package_index_signatures_enabled &&
      replace_packages == o.replace_packages &&
      replace_packages_by_default == o.replace_packages_by_default &&
      repository_type == o.repository_type &&
      repository_type_str == o.repository_type_str &&
      resync_own == o.resync_own &&
      resync_packages == o.resync_packages &&
      scan_own == o.scan_own &&
      scan_packages == o.scan_packages &&
      self_html_url == o.self_html_url &&
      self_url == o.self_url &&
      show_setup_all == o.show_setup_all &&
      size == o.size &&
      size_str == o.size_str &&
      slug == o.slug &&
      slug_perm == o.slug_perm &&
      storage_region == o.storage_region &&
      strict_npm_validation == o.strict_npm_validation &&
      tag_pre_releases_as_latest == o.tag_pre_releases_as_latest &&
      use_debian_labels == o.use_debian_labels &&
      use_default_cargo_upstream == o.use_default_cargo_upstream &&
      use_entitlements_privilege == o.use_entitlements_privilege &&
      use_noarch_packages == o.use_noarch_packages &&
      use_source_packages == o.use_source_packages &&
      use_vulnerability_scanning == o.use_vulnerability_scanning &&
      user_entitlements_enabled == o.user_entitlements_enabled &&
      view_statistics == o.view_statistics
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
# File 'lib/cloudsmith-api/models/repository_create.rb', line 921

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 =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\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
  else # model
    temp_model = CloudsmithApi.const_get(type).new
    temp_model.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



987
988
989
990
991
992
993
994
995
996
997
998
999
# File 'lib/cloudsmith-api/models/repository_create.rb', line 987

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

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
# File 'lib/cloudsmith-api/models/repository_create.rb', line 900

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


887
888
889
# File 'lib/cloudsmith-api/models/repository_create.rb', line 887

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



893
894
895
# File 'lib/cloudsmith-api/models/repository_create.rb', line 893

def hash
  [cdn_url, content_kind, contextual_auth_realm, copy_own, copy_packages, created_at, default_privilege, delete_own, delete_packages, deleted_at, description, distributes, docker_refresh_tokens_enabled, ecdsa_keys, enforce_eula, gpg_keys, index_files, is_open_source, is_private, is_public, manage_entitlements_privilege, move_own, move_packages, name, namespace, namespace_url, num_downloads, num_policy_violated_packages, num_quarantined_packages, open_source_license, open_source_project_url, package_count, package_group_count, proxy_npmjs, proxy_pypi, raw_package_index_enabled, raw_package_index_signatures_enabled, replace_packages, replace_packages_by_default, repository_type, repository_type_str, resync_own, resync_packages, scan_own, scan_packages, self_html_url, self_url, show_setup_all, size, size_str, slug, slug_perm, storage_region, strict_npm_validation, tag_pre_releases_as_latest, use_debian_labels, use_default_cargo_upstream, use_entitlements_privilege, use_noarch_packages, use_source_packages, use_vulnerability_scanning, user_entitlements_enabled, view_statistics].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



655
656
657
658
659
660
661
662
# File 'lib/cloudsmith-api/models/repository_create.rb', line 655

def list_invalid_properties
  invalid_properties = Array.new
  if @name.nil?
    invalid_properties.push('invalid value for "name", name cannot be nil.')
  end

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



967
968
969
# File 'lib/cloudsmith-api/models/repository_create.rb', line 967

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



973
974
975
976
977
978
979
980
981
# File 'lib/cloudsmith-api/models/repository_create.rb', line 973

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

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



961
962
963
# File 'lib/cloudsmith-api/models/repository_create.rb', line 961

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
# File 'lib/cloudsmith-api/models/repository_create.rb', line 666

def valid?
  content_kind_validator = EnumAttributeValidator.new('String', ['Standard', 'Distribution', 'Upstream'])
  return false unless content_kind_validator.valid?(@content_kind)
  copy_packages_validator = EnumAttributeValidator.new('String', ['Admin', 'Write', 'Read'])
  return false unless copy_packages_validator.valid?(@copy_packages)
  default_privilege_validator = EnumAttributeValidator.new('String', ['Admin', 'Write', 'Read', 'None'])
  return false unless default_privilege_validator.valid?(@default_privilege)
  delete_packages_validator = EnumAttributeValidator.new('String', ['Admin', 'Write'])
  return false unless delete_packages_validator.valid?(@delete_packages)
  manage_entitlements_privilege_validator = EnumAttributeValidator.new('String', ['Admin', 'Write', 'Read'])
  return false unless manage_entitlements_privilege_validator.valid?(@manage_entitlements_privilege)
  move_packages_validator = EnumAttributeValidator.new('String', ['Admin', 'Write', 'Read'])
  return false unless move_packages_validator.valid?(@move_packages)
  return false if @name.nil?
  replace_packages_validator = EnumAttributeValidator.new('String', ['Admin', 'Write'])
  return false unless replace_packages_validator.valid?(@replace_packages)
  repository_type_str_validator = EnumAttributeValidator.new('String', ['Public', 'Private', 'Open-Source'])
  return false unless repository_type_str_validator.valid?(@repository_type_str)
  resync_packages_validator = EnumAttributeValidator.new('String', ['Admin', 'Write'])
  return false unless resync_packages_validator.valid?(@resync_packages)
  scan_packages_validator = EnumAttributeValidator.new('String', ['Admin', 'Write', 'Read'])
  return false unless scan_packages_validator.valid?(@scan_packages)
  use_entitlements_privilege_validator = EnumAttributeValidator.new('String', ['Admin', 'Write', 'Read'])
  return false unless use_entitlements_privilege_validator.valid?(@use_entitlements_privilege)
  view_statistics_validator = EnumAttributeValidator.new('String', ['Admin', 'Write', 'Read'])
  return false unless view_statistics_validator.valid?(@view_statistics)
  true
end