[][src]Struct domo_pitchfork::pitchfork::StreamsRequestBuilder

pub struct StreamsRequestBuilder<'t, T: 't> where
    T: DeserializeOwned
{ pub auth: &'t str, pub method: Method, pub url: String, pub resp_t: PhantomData<*const T>, pub body: Option<String>, }

Request Builder for all Stream API interactions

Fields

auth: &'t strmethod: Methodurl: Stringresp_t: PhantomData<*const T>body: Option<String>

Methods

impl<'t> StreamsRequestBuilder<'t, StreamDataset>[src]

Request Builder for Stream API Endpoints

pub fn info(self, stream_id: u64) -> Result<StreamDataset, PitchforkError>[src]

Retrieve details for a given Domo Stream

Example

use domo_pitchfork::pitchfork::DomoPitchfork;
let domo = DomoPitchfork::with_token("token");
let stream_id = 123; // stream id to get details for.
let stream_info = domo.streams().info(stream_id)?;
println!("Stream Details: \n{:#?}", stream_info);

pub fn list(
    self,
    limit: u32,
    offset: u32
) -> Result<Vec<StreamDataset>, PitchforkError>
[src]

List Domo Streams. Max limit is 500. Offset is the offset of the Stream ID to begin list of streams within the response

Example

use domo_pitchfork::pitchfork::DomoPitchfork;
let domo = DomoPitchfork::with_token("token");
let list = domo.streams().list(5,0)?;
list.iter().map(|s| println!("Dataset Name: {}", s.dataset.name.as_ref().unwrap()));

pub fn search(
    self,
    query: StreamSearchQuery
) -> Result<Vec<StreamDataset>, PitchforkError>
[src]

Returns a list of StreamDatasets that meet the search query criteria.

Example

use domo_pitchfork::pitchfork::DomoPitchfork;
let domo = DomoPitchfork::with_token("token");
let user_id = 123; // User Id to search for streams for.
let query = StreamSearchQuery::DatasetOwnerId(user_id);
let list = domo.streams().search(query)?;
list.iter().map(|s| println!("Dataset Name: {}", s.dataset.name.as_ref().unwrap()));

pub fn create(
    self,
    ds_meta: &StreamDatasetSchema
) -> Result<StreamDataset, PitchforkError>
[src]

Create a new StreamDataset to create executions and upload data to.

pub fn delete(self, stream_id: u64) -> Result<(), PitchforkError>[src]

Delete a given Domo Stream. Warning: this action is destructive and cannot be reversed.

Example

let domo = DomoPitchfork::with_token(&token);

let stream_id = 123; //id of stream to delete.
// if it fails to delete print err msg.
if let Err(e) = domo.streams().delete(stream_id) {
    println!("{}", e)
}

pub fn modify_update_method(
    self,
    stream_id: u64,
    update_method: UpdateMethod
) -> Result<Dataset, PitchforkError>
[src]

Updates Stream Update Method settings

pub fn create_stream_execution(
    self,
    stream_id: u64
) -> Result<StreamExecution, PitchforkError>
[src]

Create a StreamExecution to upload data parts to and update the data in Domo. Warning: Creating an Execution on a Stream will abort all other Executions on that Stream. Each Stream can only have one active Execution at a time.

Example

use domo_pitchfork::pitchfork::DomoPitchfork;
let domo = DomoPitchfork::with_token("token");
let stream_id = 123; // stream id to create execution for.
let execution_info = domo.streams().create_stream_execution(stream_id)?;
println!("Stream Execution Details: \n{:#?}", execution_info);

pub fn execution_info(
    self,
    stream_id: u64,
    execution_id: u32
) -> Result<StreamExecution, PitchforkError>
[src]

Details for a StreamExecution for a given StreamDataset

Example

use domo_pitchfork::pitchfork::DomoPitchfork;
let domo = DomoPitchfork::with_token("token");
let stream_id = 123; // stream id to get execution info for.
let ex_id = 1; // execution id to get info for.
let execution_info = domo.streams().execution_info(stream_id, ex_id)?;
println!("Stream Execution Details: \n{:#?}", execution_info);

pub fn list_executions(
    self,
    stream_id: u64,
    limit: u32,
    offset: u32
) -> Result<Vec<StreamExecution>, PitchforkError>
[src]

List Domo Executions for a given Domo Stream. Max limit is 500. Offset is the offset of the Stream ID to begin list of streams within the response

Example

use domo_pitchfork::pitchfork::DomoPitchfork;
let domo = DomoPitchfork::with_token("token");
let stream_id = 123; // stream id to retrieve executions for.
let list = domo.streams().list_executions(stream_id, 50,0)?;
list.iter().map(|s| println!("Execution Id: {}", s.id));

pub fn upload_part(
    self,
    stream_id: u64,
    execution_id: u32,
    part: u32,
    csv_part: &str
) -> Result<StreamExecution, PitchforkError>
[src]

Upload a data part to a stream execution in progress. Parts can be uploaded simultaneously and in any order.

pub fn upload_serializable_part<T: Serialize>(
    self,
    stream_id: u64,
    execution_id: u32,
    part: u32,
    data: &[T]
) -> Result<StreamExecution, PitchforkError>
[src]

Upload a data part to a stream execution in progress where the data part is a Serializable vec of T. Parts can be uploaded simultaneously and in any order.

pub fn commit_execution(
    self,
    stream_id: u64,
    execution_id: u32
) -> Result<StreamExecution, PitchforkError>
[src]

Commit a stream execution and finalize insertion of dataparts into Domo Stream Dataset.

Example

use domo_pitchfork::pitchfork::DomoPitchfork;
let domo = DomoPitchfork::with_token("token");
let stream_id = 123; // stream id to finish execution for.
let ex_id = 1; // execution id to finalize and commit.
let execution_info = domo.streams().commit_execution(stream_id, ex_id)?;
println!("Stream Execution Details: \n{:#?}", execution_info);

pub fn abort_stream_execution(
    self,
    stream_id: u64,
    execution_id: u32
) -> Result<(), PitchforkError>
[src]

Abort a stream execution in progress and discard all data parts uploaded to the execution.

Example

use domo_pitchfork::pitchfork::DomoPitchfork;
let domo = DomoPitchfork::with_token("token");
let stream_id = 123; // stream id to abort execution for.
let ex_id = 1; // execution id to abort.
let execution_info = domo.streams().abort_stream_execution(stream_id, ex_id)?;
println!("Stream Execution Details: \n{:#?}", execution_info);

Trait Implementations

impl<'t, T> BaseRequest for StreamsRequestBuilder<'t, T> where
    T: DeserializeOwned
[src]

impl<'t, T> DomoRequest<T> for StreamsRequestBuilder<'t, T> where
    T: DeserializeOwned
[src]

impl<'t, T> From<DomoRequestBuilder<'t, T>> for StreamsRequestBuilder<'t, T> where
    T: DeserializeOwned
[src]

Auto Trait Implementations

impl<'t, T> !Send for StreamsRequestBuilder<'t, T>

impl<'t, T> !Sync for StreamsRequestBuilder<'t, T>

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T

impl<T, U> TryInto for T where
    U: TryFrom<T>, 

type Err = <U as TryFrom<T>>::Err