A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.rs/octocrab/latest/octocrab/orgs/struct.OrgHandler.html below:

OrgHandler in octocrab::orgs - Rust

pub struct OrgHandler<'octo> {  }
Expand description Source§ Source

Add or update organization membership

Note

let invitation = octocrab.orgs("owner").add_or_update_membership("ferris", None).await?;
Source

Check if a user is, publicly or privately, a member of the organization.

assert!(octocrab.orgs("owner").check_membership("ferris").await?);
Source

Get an organization

To see many of the organization response values, you need to be an authenticated organization owner with the admin:org scope. When the value of two_factor_requirement_enabled is true, the organization requires all members, billing managers, and outside collaborators to enable two-factor authentication.

let org = octocrab.orgs("owner").get().await?;
Source

List repos for the specified organization.

use octocrab::params;

let page = octocrab::instance()
    .orgs("owner")
    .list_repos()
    .repo_type(params::repos::Type::Sources)
    .sort(params::repos::Sort::Pushed)
    .direction(params::Direction::Descending)
    .per_page(25)
    .page(5u32)
    .send()
    .await?;
Source

List events on this organization.

Takes an optional etag which allows for efficient polling. Here is a quick example to poll a organization’s events.

let mut etag = None;
loop {
    let response: Etagged<Page<Event>> = octocrab::instance()
        .orgs("owner")
        .events()
        .etag(etag)
        .send()
        .await?;
    if let Some(page) = response.value {
        } else {
        println!("No new data received, trying again soon");
    }
    etag = response.etag;
    }
Source

Creates a new webhook for the specified organization.

§Notes

Only authorized users or apps can modify organization webhooks.

§Examples
use octocrab::models::hooks::{Hook, Config as HookConfig, ContentType as HookContentType};

let config = HookConfig {
  url: "https://example.com".to_string(),
  content_type: Some(HookContentType::Json),
  insecure_ssl: None,
  secret: None
};

let hook = Hook {
  name: "web".to_string(),
  config,
  ..Hook::default()
};

let hook = octocrab.orgs("owner").create_hook(hook).await?;
Source

Lists members of the specified organization.

§Notes

Only authorized users who belong to the organization can list its members.

§Examples
let org_members = octocrab::instance().orgs("org").list_members().send().await?;
Source

Handle secrets on the organizaton

let octocrab = octocrab::instance();
let secrets = octocrab.orgs("org").secrets();

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4