-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
461 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package ssclient | ||
|
||
type Config struct { | ||
BaseURL string | ||
Username string | ||
Key string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package ssclient | ||
|
||
import ( | ||
"github.com/google/uuid" | ||
"go.artefactual.dev/ssclient/kiota/models" | ||
"go.artefactual.dev/tools/ref" | ||
|
||
"github.com/artefactual/archivematica/hack/ccp/internal/derrors" | ||
) | ||
|
||
// TODO: why is kiota using ptrs for mandatory fields? | ||
|
||
func convertPipeline(m models.Pipelineable) (_ *Pipeline, err error) { | ||
derrors.Add(&err, "convertPipeline") | ||
|
||
r := &Pipeline{} | ||
|
||
if uid, err := uuid.Parse(ref.DerefZero(m.GetUuid())); err != nil { | ||
return nil, err | ||
} else { | ||
r.ID = uid | ||
} | ||
|
||
r.URI = ref.DerefZero(m.GetResourceUri()) | ||
|
||
return r, nil | ||
} | ||
|
||
func convertLocation(m models.Locationable) (_ *Location, err error) { | ||
derrors.Add(&err, "convertLocation") | ||
|
||
r := &Location{} | ||
|
||
if uid, err := uuid.Parse(ref.DerefZero(m.GetUuid())); err != nil { | ||
return nil, err | ||
} else { | ||
r.ID = uid | ||
} | ||
|
||
r.URI = ref.DerefZero(m.GetResourceUri()) | ||
r.Path = ref.DerefZero(m.GetPath()) | ||
r.RelativePath = ref.DerefZero(m.GetRelativePath()) | ||
r.Pipelines = m.GetPipeline() | ||
|
||
if ps := m.GetPurpose(); ps != nil { | ||
r.Purpose = ps.String() | ||
} | ||
|
||
return r, nil | ||
} |
Oops, something went wrong.