Skip to main content

CodeCommitState

Struct CodeCommitState 

Source
pub struct CodeCommitState {
    pub repositories: HashMap<String, Repository>,
    pub branches: HashMap<String, HashMap<String, Branch>>,
    pub commits: HashMap<String, HashMap<String, CommitRecord>>,
    pub files: HashMap<String, HashMap<String, HashMap<String, FileEntry>>>,
    pub pull_requests: HashMap<String, PullRequestRecord>,
    pub pull_request_counter: u64,
}

Fields§

§repositories: HashMap<String, Repository>§branches: HashMap<String, HashMap<String, Branch>>

branches keyed by repo_name -> branch_name -> Branch

§commits: HashMap<String, HashMap<String, CommitRecord>>

commits keyed by repo_name -> commit_id -> CommitRecord

§files: HashMap<String, HashMap<String, HashMap<String, FileEntry>>>

files keyed by repo_name -> commit_id -> file_path -> FileEntry

§pull_requests: HashMap<String, PullRequestRecord>

pull requests keyed by pull_request_id

§pull_request_counter: u64

next pull request number per repo

Implementations§

Source§

impl CodeCommitState

Source

pub fn create_repository( &mut self, name: &str, description: &str, account_id: &str, region: &str, ) -> Result<&Repository, CodeCommitError>

Source

pub fn get_repository(&self, name: &str) -> Result<&Repository, CodeCommitError>

Source

pub fn delete_repository(&mut self, name: &str) -> String

Source

pub fn list_repositories(&self) -> Vec<&Repository>

Source

pub fn update_repository_description( &mut self, name: &str, description: Option<&str>, ) -> Result<(), CodeCommitError>

Source

pub fn update_repository_name( &mut self, old_name: &str, new_name: &str, region: &str, account_id: &str, ) -> Result<(), CodeCommitError>

Source

pub fn create_branch( &mut self, repo_name: &str, branch_name: &str, commit_id: &str, ) -> Result<(), CodeCommitError>

Source

pub fn get_branch( &self, repo_name: &str, branch_name: &str, ) -> Result<&Branch, CodeCommitError>

Source

pub fn list_branches( &self, repo_name: &str, ) -> Result<Vec<String>, CodeCommitError>

Source

pub fn delete_branch( &mut self, repo_name: &str, branch_name: &str, ) -> Result<Branch, CodeCommitError>

Source

pub fn update_default_branch( &mut self, repo_name: &str, branch_name: &str, ) -> Result<(), CodeCommitError>

Source

pub fn create_commit( &mut self, repo_name: &str, branch_name: &str, parent_commit_id: Option<&str>, author_name: Option<&str>, author_email: Option<&str>, commit_message: Option<&str>, put_files: Vec<(String, String)>, delete_files: Vec<String>, ) -> Result<CommitRecord, CodeCommitError>

Source

pub fn get_commit( &self, repo_name: &str, commit_id: &str, ) -> Result<&CommitRecord, CodeCommitError>

Source

pub fn get_file( &self, repo_name: &str, commit_specifier: Option<&str>, file_path: &str, ) -> Result<(&CommitRecord, &FileEntry), CodeCommitError>

Source

pub fn get_folder( &self, repo_name: &str, commit_specifier: Option<&str>, folder_path: &str, ) -> Result<(String, Vec<FileEntry>, Vec<String>), CodeCommitError>

Source

pub fn put_file( &mut self, repo_name: &str, branch_name: &str, parent_commit_id: &str, file_path: &str, file_mode: Option<&str>, author_name: Option<&str>, author_email: Option<&str>, commit_message: Option<&str>, ) -> Result<CommitRecord, CodeCommitError>

Source

pub fn delete_file( &mut self, repo_name: &str, branch_name: &str, parent_commit_id: &str, file_path: &str, author_name: Option<&str>, author_email: Option<&str>, commit_message: Option<&str>, ) -> Result<CommitRecord, CodeCommitError>

Source

pub fn get_differences( &self, repo_name: &str, after_commit_specifier: &str, before_commit_specifier: Option<&str>, ) -> Result<Vec<(Option<FileEntry>, Option<FileEntry>, String)>, CodeCommitError>

Source

pub fn create_pull_request( &mut self, title: &str, description: &str, repo_name: &str, source_reference: &str, destination_reference: &str, ) -> Result<PullRequestRecord, CodeCommitError>

Source

pub fn get_pull_request( &self, pr_id: &str, ) -> Result<&PullRequestRecord, CodeCommitError>

Source

pub fn list_pull_requests( &self, repo_name: &str, status: Option<&str>, ) -> Vec<String>

Source

pub fn update_pull_request_status( &mut self, pr_id: &str, status: &str, ) -> Result<PullRequestRecord, CodeCommitError>

Source

pub fn tag_resource( &mut self, repo_name: &str, tags: HashMap<String, String>, ) -> Result<(), CodeCommitError>

Source

pub fn untag_resource( &mut self, repo_name: &str, tag_keys: &[String], ) -> Result<(), CodeCommitError>

Source

pub fn list_tags_for_resource( &self, repo_arn: &str, ) -> Result<HashMap<String, String>, CodeCommitError>

Trait Implementations§

Source§

impl Debug for CodeCommitState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CodeCommitState

Source§

fn default() -> CodeCommitState

Returns the “default value” for a type. Read more
Source§

impl From<&CodeCommitState> for CodeCommitStateView

Source§

fn from(state: &CodeCommitState) -> Self

Converts to this type from the input type.
Source§

impl From<CodeCommitStateView> for CodeCommitState

Source§

fn from(view: CodeCommitStateView) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more