Struct BranchProtectionRule

Source
pub struct BranchProtectionRule {
Show 26 fields pub admin_enforced: BranchProtectionRuleBoolean, pub allow_deletions_enforcement_level: BranchProtectionRuleEnforcementLevel, pub allow_force_pushes_enforcement_level: BranchProtectionRuleEnforcementLevel, pub authorized_actor_names: BranchProtectionRuleArray, pub authorized_actors_only: BranchProtectionRuleBoolean, pub authorized_dismissal_actors_only: BranchProtectionRuleBoolean, pub create_protected: Option<BranchProtectionRuleBoolean>, pub created_at: DateTime<Utc>, pub dismiss_stale_reviews_on_push: BranchProtectionRuleBoolean, pub id: i64, pub ignore_approvals_from_contributors: BranchProtectionRuleBoolean, pub linear_history_requirement_enforcement_level: BranchProtectionRuleEnforcementLevel, pub merge_queue_enforcement_level: BranchProtectionRuleEnforcementLevel, pub name: String, pub pull_request_reviews_enforcement_level: BranchProtectionRuleEnforcementLevel, pub repository_id: i64, pub require_code_owner_review: BranchProtectionRuleBoolean, pub require_last_push_approval: Option<BranchProtectionRuleBoolean>, pub required_approving_review_count: BranchProtectionRuleNumber, pub required_conversation_resolution_level: BranchProtectionRuleEnforcementLevel, pub required_deployments_enforcement_level: BranchProtectionRuleEnforcementLevel, pub required_status_checks: BranchProtectionRuleArray, pub required_status_checks_enforcement_level: BranchProtectionRuleEnforcementLevel, pub signature_requirement_enforcement_level: BranchProtectionRuleEnforcementLevel, pub strict_required_status_checks_policy: BranchProtectionRuleBoolean, pub updated_at: DateTime<Utc>,
}
Expand description

The branch protection rule. Includes a name and all the branch protection settings applied to branches that match the name. Binary settings are boolean. Multi-level configurations are one of off, non_admins, or everyone. Actor and build lists are arrays of strings.

JSON schema
{
 "title": "branch protection rule",
 "description": "The branch protection rule. Includes a `name` and all the [branch protection settings](https://docs.github.com/en/github/administering-a-repository/defining-the-mergeability-of-pull-requests/about-protected-branches#about-branch-protection-settings) applied to branches that match the name. Binary settings are boolean. Multi-level configurations are one of `off`, `non_admins`, or `everyone`. Actor and build lists are arrays of strings.",
 "type": "object",
 "required": [
   "admin_enforced",
   "allow_deletions_enforcement_level",
   "allow_force_pushes_enforcement_level",
   "authorized_actor_names",
   "authorized_actors_only",
   "authorized_dismissal_actors_only",
   "created_at",
   "dismiss_stale_reviews_on_push",
   "id",
   "ignore_approvals_from_contributors",
   "linear_history_requirement_enforcement_level",
   "merge_queue_enforcement_level",
   "name",
   "pull_request_reviews_enforcement_level",
   "repository_id",
   "require_code_owner_review",
   "required_approving_review_count",
   "required_conversation_resolution_level",
   "required_deployments_enforcement_level",
   "required_status_checks",
   "required_status_checks_enforcement_level",
   "signature_requirement_enforcement_level",
   "strict_required_status_checks_policy",
   "updated_at"
 ],
 "properties": {
   "admin_enforced": {
     "$ref": "#/definitions/branch-protection-rule-boolean"
   },
   "allow_deletions_enforcement_level": {
     "$ref": "#/definitions/branch-protection-rule-enforcement-level"
   },
   "allow_force_pushes_enforcement_level": {
     "$ref": "#/definitions/branch-protection-rule-enforcement-level"
   },
   "authorized_actor_names": {
     "$ref": "#/definitions/branch-protection-rule-array"
   },
   "authorized_actors_only": {
     "$ref": "#/definitions/branch-protection-rule-boolean"
   },
   "authorized_dismissal_actors_only": {
     "$ref": "#/definitions/branch-protection-rule-boolean"
   },
   "create_protected": {
     "$ref": "#/definitions/branch-protection-rule-boolean"
   },
   "created_at": {
     "type": "string",
     "format": "date-time"
   },
   "dismiss_stale_reviews_on_push": {
     "$ref": "#/definitions/branch-protection-rule-boolean"
   },
   "id": {
     "type": "integer"
   },
   "ignore_approvals_from_contributors": {
     "$ref": "#/definitions/branch-protection-rule-boolean"
   },
   "linear_history_requirement_enforcement_level": {
     "$ref": "#/definitions/branch-protection-rule-enforcement-level"
   },
   "merge_queue_enforcement_level": {
     "$ref": "#/definitions/branch-protection-rule-enforcement-level"
   },
   "name": {
     "type": "string"
   },
   "pull_request_reviews_enforcement_level": {
     "$ref": "#/definitions/branch-protection-rule-enforcement-level"
   },
   "repository_id": {
     "type": "integer"
   },
   "require_code_owner_review": {
     "$ref": "#/definitions/branch-protection-rule-boolean"
   },
   "require_last_push_approval": {
     "$ref": "#/definitions/branch-protection-rule-boolean"
   },
   "required_approving_review_count": {
     "$ref": "#/definitions/branch-protection-rule-number"
   },
   "required_conversation_resolution_level": {
     "$ref": "#/definitions/branch-protection-rule-enforcement-level"
   },
   "required_deployments_enforcement_level": {
     "$ref": "#/definitions/branch-protection-rule-enforcement-level"
   },
   "required_status_checks": {
     "$ref": "#/definitions/branch-protection-rule-array"
   },
   "required_status_checks_enforcement_level": {
     "$ref": "#/definitions/branch-protection-rule-enforcement-level"
   },
   "signature_requirement_enforcement_level": {
     "$ref": "#/definitions/branch-protection-rule-enforcement-level"
   },
   "strict_required_status_checks_policy": {
     "$ref": "#/definitions/branch-protection-rule-boolean"
   },
   "updated_at": {
     "type": "string",
     "format": "date-time"
   }
 },
 "additionalProperties": false,
 "$schema": "http://json-schema.org/draft-07/schema"
}

Fields§

§admin_enforced: BranchProtectionRuleBoolean§allow_deletions_enforcement_level: BranchProtectionRuleEnforcementLevel§allow_force_pushes_enforcement_level: BranchProtectionRuleEnforcementLevel§authorized_actor_names: BranchProtectionRuleArray§authorized_actors_only: BranchProtectionRuleBoolean§authorized_dismissal_actors_only: BranchProtectionRuleBoolean§create_protected: Option<BranchProtectionRuleBoolean>§created_at: DateTime<Utc>§dismiss_stale_reviews_on_push: BranchProtectionRuleBoolean§id: i64§ignore_approvals_from_contributors: BranchProtectionRuleBoolean§linear_history_requirement_enforcement_level: BranchProtectionRuleEnforcementLevel§merge_queue_enforcement_level: BranchProtectionRuleEnforcementLevel§name: String§pull_request_reviews_enforcement_level: BranchProtectionRuleEnforcementLevel§repository_id: i64§require_code_owner_review: BranchProtectionRuleBoolean§require_last_push_approval: Option<BranchProtectionRuleBoolean>§required_approving_review_count: BranchProtectionRuleNumber§required_conversation_resolution_level: BranchProtectionRuleEnforcementLevel§required_deployments_enforcement_level: BranchProtectionRuleEnforcementLevel§required_status_checks: BranchProtectionRuleArray§required_status_checks_enforcement_level: BranchProtectionRuleEnforcementLevel§signature_requirement_enforcement_level: BranchProtectionRuleEnforcementLevel§strict_required_status_checks_policy: BranchProtectionRuleBoolean§updated_at: DateTime<Utc>

Implementations§

Trait Implementations§

Source§

impl Clone for BranchProtectionRule

Source§

fn clone(&self) -> BranchProtectionRule

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BranchProtectionRule

Source§

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

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

impl<'de> Deserialize<'de> for BranchProtectionRule

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<&BranchProtectionRule> for BranchProtectionRule

Source§

fn from(value: &BranchProtectionRule) -> Self

Converts to this type from the input type.
Source§

impl From<BranchProtectionRule> for BranchProtectionRule

Source§

fn from(value: BranchProtectionRule) -> Self

Converts to this type from the input type.
Source§

impl Serialize for BranchProtectionRule

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl TryFrom<BranchProtectionRule> for BranchProtectionRule

Source§

type Error = String

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

fn try_from(value: BranchProtectionRule) -> Result<Self, String>

Performs the conversion.

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,