ExDoppler.SecretSyncs (ExDoppler v1.0.1)
View SourceModule for interacting with ExDoppler.Sync
๐ Resources
- ๐ Doppler docs
- ๐ Doppler API docs
- ๐ฌ Contact the maintainer (he's happy to help!)
Summary
Functions
Creates a new ExDoppler.Sync
Same as create_secrets_sync/3
but won't wrap a successful response in {:ok, response}
Same as delete_secrets_sync/3
but won't wrap a successful response in {:ok, response}
Retrieves a ExDoppler.Sync
Same as get_secrets_sync/2
but won't wrap a successful response in {:ok, response}
Functions
Creates a new ExDoppler.Sync
Read the API docs!
The data
payload differs with each integration.
Please use with care
๐ท๏ธ Params
- config - Config associated with the Sync (e.g
%Config{name: "dev_personal", project: "example-project" ...}
) - integration - Integration associated with the Sync (e.g
%Integration{slug: "e32d0dcd-c094-4606-aefa-c4127e2a1282" ...}
) - data - A map of data associated with the Sync; the fields will differ depending on the integration
โคต๏ธ Returns
โ On Success
{:ok, %ExDoppler.Sync{...}}
โ On Failure
{:error, err}
๐ป Examples
iex> alias ExDoppler.Config
iex> alias ExDoppler.Integrations
iex> alias ExDoppler.SecretSyncs
iex> [integration | _] = Integrations.list_integrations!()
iex> config = %Config{name: "github", project: "example-project"}
iex> if !Enum.empty?(integration.syncs), do: :ok = SecretSyncs.delete_secrets_sync!(config, hd(integration.syncs))
iex> {:ok, github_sync} = SecretSyncs.create_secrets_sync(config, integration, %{sync_target: "repo", repo_name: "ex_doppler"})
iex> {:ok, _secrets_sync} = SecretSyncs.get_secrets_sync(config, github_sync.slug)
iex> :ok = SecretSyncs.delete_secrets_sync!(config, github_sync)
๐ Resources
- ๐ Doppler API docs
- ๐ฌ Contact the maintainer (he's happy to help!)
Same as create_secrets_sync/3
but won't wrap a successful response in {:ok, response}
Deletes a ExDoppler.Sync
๐ท๏ธ Params
- config - Config associated with the Sync (e.g
%Config{name: "dev_personal", project: "example-project" ...}
) - sync - Sync to delete (e.g
%Sync{slug: "e32d0dcd-c094-4606-aefa-c4127e2a1282" ...}
) - delete_from_target - Whether or not to delete the synced data from the target integration. Defaults to
true
โคต๏ธ Returns
โ On Success
{:ok, {:success, true}}
โ On Failure
{:error, err}
๐ป Examples
iex> alias ExDoppler.Config
iex> alias ExDoppler.Integrations
iex> alias ExDoppler.SecretSyncs
iex> [integration | _] = Integrations.list_integrations!()
iex> config = %Config{name: "github", project: "example-project"}
iex> if !Enum.empty?(integration.syncs), do: :ok = SecretSyncs.delete_secrets_sync!(config, hd(integration.syncs))
iex> {:ok, github_sync} = SecretSyncs.create_secrets_sync(config, integration, %{sync_target: "repo", repo_name: "ex_doppler"})
iex> {:ok, _secrets_sync} = SecretSyncs.get_secrets_sync(config, github_sync.slug)
iex> :ok = SecretSyncs.delete_secrets_sync!(config, github_sync)
๐ Resources
- ๐ Doppler API docs
- ๐ฌ Contact the maintainer (he's happy to help!)
Same as delete_secrets_sync/3
but won't wrap a successful response in {:ok, response}
Retrieves a ExDoppler.Sync
๐ท๏ธ Params
- config - Config to get secrets from (e.g
%Config{name: "dev_personal", project: "example-project" ...}
) - sync_slug - Unique ID for the Sync
โคต๏ธ Returns
โ On Success
{:ok, %ExDoppler.Sync{...}}
โ On Failure
{:error, err}
๐ป Examples
iex> alias ExDoppler.Config
iex> alias ExDoppler.Integrations
iex> alias ExDoppler.SecretSyncs
iex> [integration | _] = Integrations.list_integrations!()
iex> config = %Config{name: "github", project: "example-project"}
iex> if !Enum.empty?(integration.syncs), do: :ok = SecretSyncs.delete_secrets_sync!(config, hd(integration.syncs))
iex> {:ok, github_sync} = SecretSyncs.create_secrets_sync(config, integration, %{sync_target: "repo", repo_name: "ex_doppler"})
iex> {:ok, _secrets_sync} = SecretSyncs.get_secrets_sync(config, github_sync.slug)
iex> :ok = SecretSyncs.delete_secrets_sync!(config, github_sync)
๐ Resources
- ๐ Doppler API docs
- ๐ฌ Contact the maintainer (he's happy to help!)
Same as get_secrets_sync/2
but won't wrap a successful response in {:ok, response}