Merge branch 'thehyve/fix-crunch-documentation' Fix a typo in Crunch Dispatch install...
[arvados.git] / sdk / go / arvados / collection.go
index 157ce1678873af7f709c16752e590fb79b2ea822..79be2f3f1d27d515f03b166573fd3c3c5fb0eb9b 100644 (file)
@@ -1,3 +1,7 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: Apache-2.0
+
 package arvados
 
 import (
@@ -6,23 +10,32 @@ import (
        "strings"
        "time"
 
-       "git.curoverse.com/arvados.git/sdk/go/manifest"
+       "git.curoverse.com/arvados.git/sdk/go/blockdigest"
 )
 
 // Collection is an arvados#collection resource.
 type Collection struct {
-       UUID                   string     `json:"uuid,omitempty"`
-       TrashAt                *time.Time `json:"trash_at,omitempty"`
-       ManifestText           string     `json:"manifest_text,omitempty"`
-       UnsignedManifestText   string     `json:"unsigned_manifest_text,omitempty"`
-       CreatedAt              *time.Time `json:"created_at,omitempty"`
-       ModifiedAt             *time.Time `json:"modified_at,omitempty"`
-       PortableDataHash       string     `json:"portable_data_hash,omitempty"`
-       ReplicationConfirmed   *int       `json:"replication_confirmed,omitempty"`
-       ReplicationConfirmedAt *time.Time `json:"replication_confirmed_at,omitempty"`
-       ReplicationDesired     *int       `json:"replication_desired,omitempty"`
-       DeleteAt               *time.Time `json:"delete_at,omitempty"`
-       IsTrashed              bool       `json:"is_trashed,omitempty"`
+       UUID                      string     `json:"uuid,omitempty"`
+       OwnerUUID                 string     `json:"owner_uuid,omitempty"`
+       TrashAt                   *time.Time `json:"trash_at,omitempty"`
+       ManifestText              string     `json:"manifest_text,omitempty"`
+       UnsignedManifestText      string     `json:"unsigned_manifest_text,omitempty"`
+       Name                      string     `json:"name,omitempty"`
+       CreatedAt                 *time.Time `json:"created_at,omitempty"`
+       ModifiedAt                *time.Time `json:"modified_at,omitempty"`
+       PortableDataHash          string     `json:"portable_data_hash,omitempty"`
+       ReplicationConfirmed      *int       `json:"replication_confirmed,omitempty"`
+       ReplicationConfirmedAt    *time.Time `json:"replication_confirmed_at,omitempty"`
+       ReplicationDesired        *int       `json:"replication_desired,omitempty"`
+       StorageClassesDesired     []string   `json:"storage_classes_desired,omitempty"`
+       StorageClassesConfirmed   []string   `json:"storage_classes_confirmed,omitempty"`
+       StorageClassesConfirmedAt *time.Time `json:"storage_classes_confirmed_at,omitempty"`
+       DeleteAt                  *time.Time `json:"delete_at,omitempty"`
+       IsTrashed                 bool       `json:"is_trashed,omitempty"`
+}
+
+func (c Collection) resourceName() string {
+       return "collection"
 }
 
 // SizedDigests returns the hash+size part of each data block
@@ -46,7 +59,7 @@ func (c *Collection) SizedDigests() ([]SizedDigest, error) {
                        return nil, fmt.Errorf("Invalid stream (<3 tokens): %q", line)
                }
                for _, token := range tokens[1:] {
-                       if !manifest.LocatorPattern.MatchString(token) {
+                       if !blockdigest.LocatorPattern.MatchString(token) {
                                // FIXME: ensure it's a file token
                                break
                        }