Example #1
0
 public static Task TransformConfigSetPublished(
     this IJetfireClient client,
     int id,
     bool isPublic,
     CancellationToken ct = default
     ) => client.TransformConfigSetPublished(id, new TransformConfigPublishOptions {
     IsPublic = isPublic
 });
Example #2
0
        async Task Update(TransformConfigRead transformToUpdate, ResolvedManifest manifest)
        {
            var id = transformToUpdate.Id;
            await client.TransformConfigUpdate(id, new TransformConfigUpdate
            {
                Name         = manifest.Transformation.Name,
                Query        = manifest.Query,
                Destination  = ToDataSource(manifest.Transformation.Destination),
                ConflictMode = ToConflictModeString(manifest.Transformation.Action),
            });

            if (manifest.ReadApiKey != null)
            {
                await client.TransformConfigUpdateSourceApiKey(id, manifest.ReadApiKey);
            }
            if (manifest.WriteApiKey != null)
            {
                await client.TransformConfigUpdateDestinationApiKey(id, manifest.WriteApiKey);
            }
            if (manifest.ReadCredentials != null)
            {
                await client.TransformConfigUpdateSourceCredentials(id, manifest.ReadCredentials);
            }
            if (manifest.WriteCredentials != null)
            {
                await client.TransformConfigUpdateDestinationCredentials(id, manifest.WriteCredentials);
            }

            if (transformToUpdate.IsPublic != manifest.Transformation.Shared)
            {
                await client.TransformConfigSetPublished(id, manifest.Transformation.Shared);
            }

            if (transformToUpdate.ignoreNullFields != manifest.Transformation.IgnoreNullFields)
            {
                await client.TransformConfigSetIgnoreNullFields(id, manifest.Transformation.IgnoreNullFields);
            }
        }