hexsha stringlengths 40 40 | size int64 5 1.05M | ext stringclasses 98 values | lang stringclasses 21 values | max_stars_repo_path stringlengths 3 945 | max_stars_repo_name stringlengths 4 118 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 945 | max_issues_repo_name stringlengths 4 118 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 134k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 945 | max_forks_repo_name stringlengths 4 135 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 5 1.05M | avg_line_length float64 1 1.03M | max_line_length int64 2 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f03e5bf93777b1109bb4cda9f7dc5f97360072a4 | 719 | js | JavaScript | input-core/index.js | TranThinh96/react-phone-number-input | c96c1ce8257598efad685ae3a66e9640fd3e547a | [
"MIT"
] | null | null | null | input-core/index.js | TranThinh96/react-phone-number-input | c96c1ce8257598efad685ae3a66e9640fd3e547a | [
"MIT"
] | null | null | null | input-core/index.js | TranThinh96/react-phone-number-input | c96c1ce8257598efad685ae3a66e9640fd3e547a | [
"MIT"
] | null | null | null | export { default as default } from '../modules/PhoneInputNoCountrySelect'
export { parseRFC3966, formatRFC3966 } from '../modules/libphonenumber/RFC3966'
export { default as parsePhoneNumber } from '../modules/libphonenumber/parsePhoneNumber'
export { default as formatPhoneNumber, formatPhoneNumberIntl } from '../modules/libphonenumber/formatPhoneNumber'
export { default as isValidPhoneNumber } from '../modules/libphonenumber/isValidPhoneNumber'
export { default as isPossiblePhoneNumber } from '../modules/libphonenumber/isPossiblePhoneNumber'
export { default as getCountries } from '../modules/libphonenumber/getCountries'
export { getCountryCallingCode as getCountryCallingCode } from 'libphonenumber-js/core'
| 71.9 | 113 | 0.812239 |
a801f16868688ee3a09a2d452419c37dae022c9a | 2,769 | swift | Swift | IOTPayiOS/Views+ViewModels/AbstractView+ViewModels/IOTCardInfoView.swift | IOTPayAdmin/IOTPay-iOS | 967b47898e202e97c3dac4d9d6c38250cd4665e6 | [
"MIT"
] | 1 | 2021-05-07T00:56:08.000Z | 2021-05-07T00:56:08.000Z | IOTPayiOS/Views+ViewModels/AbstractView+ViewModels/IOTCardInfoView.swift | IOTPaySDK/IOTPay-iOS | 967b47898e202e97c3dac4d9d6c38250cd4665e6 | [
"MIT"
] | null | null | null | IOTPayiOS/Views+ViewModels/AbstractView+ViewModels/IOTCardInfoView.swift | IOTPaySDK/IOTPay-iOS | 967b47898e202e97c3dac4d9d6c38250cd4665e6 | [
"MIT"
] | null | null | null | //
// IOTCardInfoView.swift
// IOTPayUIPlayground
//
// Created by macbook on 2021-04-05.
//
import UIKit
@objc
public protocol IOTCardInfoViewDelegate: AnyObject {
func onDidCompleteValidate()
}
public class IOTCardInfoView: UIView {
@objc
public var delegate: IOTCardInfoViewDelegate?
let facade: IOTCardInfoComponentsFacade
//MARK: Constants
// init constants
var action: IOTNetworkRequestAction
let layout: IOTCardInfoViewLayout
let style: IOTCardInfoViewStyle
// default constatns
// models
let viewModel: IOTCardInfoViewModel
// calculated var
var screenW: CGFloat { UIScreen.main.bounds.width }
var screenH: CGFloat { UIScreen.main.bounds.height }
var isValid: Bool {
for textField in textFieldsay { if !textField.isValid { return false }}
return true
}
// temp var
private var textFieldsay: [IOTDeformableTextField] = []
// MARK: life cycle
public init(action: IOTNetworkRequestAction, layout: IOTCardInfoViewLayout, style: IOTCardInfoViewStyle) {
self.action = action
self.layout = layout
self.style = style
self.facade = IOTCardInfoComponentsFacade(action: action, layout: layout, style: style)
self.viewModel = IOTCardInfoViewModel()
super.init(frame: CGRect.zero)
commonInit()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func commonInit() {
setupDismissKeyboardCondition()
backgroundColor = IOTColor.labelBackground.uiColor
viewModel.delegate = self
facade.delegate = self
setupView()
layer.masksToBounds = true
}
deinit {}
private func setupDismissKeyboardCondition() {
let tap = UITapGestureRecognizer(target: self, action: #selector(onHideKeyboard))
addGestureRecognizer(tap)
}
@objc func onHideKeyboard() {
endEditing(true)
}
private func setupView() { }
private func setupUserInputTarget() { }
}
extension IOTCardInfoView: IOTCardInfoComponentsFacadeDelegate {
func onDidCompleteValidate() {
delegate?.onDidCompleteValidate()
}
}
extension IOTCardInfoView: IOTCardInfoViewModelDelegate {
func updatingComposition(fromSelection: IOTTextFieldSubject, toSeletion: IOTTextFieldSubject, aimation: Bool) { }
func updatingImageIcon(to state: IOTCardIconState) { }
}
enum SingleLineWidthRatios {
case normal
case fullHolderName
case fullCardNumber
var segmentRatioArr: [CGFloat] {
switch self {
case .normal: return [0.1, 0.3, 0.2, 0.2, 0.2]
case .fullHolderName: return [0.1, 0.7, 0.2, 0.2, 0.2]
case .fullCardNumber: return [0.1, 0.2, 0.5, 0.2, 0.2]
}
}
func ratioArr(at state: IOTTextFieldSubject?) -> [CGFloat] {
switch state {
case .holderName: return self.segmentRatioArr
case .cardNumber: return [0.1, 0.2, 0.5, 0.2, 0.2]
default: return [0.1, 0.3, 0.2, 0.2, 0.2]
}
}
}
| 22.330645 | 114 | 0.737089 |
4a6aba5b4e94dfc804ffad756628b79271447fab | 13,189 | js | JavaScript | 2018.01/anime2018.01.min.js | windasd/Anime-List | 8ef1cff4a320b3a91a1ee823b0324cc7bf73e981 | [
"WTFPL"
] | null | null | null | 2018.01/anime2018.01.min.js | windasd/Anime-List | 8ef1cff4a320b3a91a1ee823b0324cc7bf73e981 | [
"WTFPL"
] | null | null | null | 2018.01/anime2018.01.min.js | windasd/Anime-List | 8ef1cff4a320b3a91a1ee823b0324cc7bf73e981 | [
"WTFPL"
] | null | null | null | "use strict";
var Anime = (Anime = [{ name: "POP TEAM EPIC", date: "1/6", week: "Sat", time: "1:00", carrier: "Comic", season: "1", nameInJpn: "ポプテピピック", img: "https://i.imgur.com/AQLrEK1.jpg", official: "http://hoshiiro.jp/", description: '沒有黑暗,只有無知。 —威廉·莎士比亞— (註:圖片中的字為"去你的竹書房",喔對竹書房是這部漫畫的出版社)' }, { name: "爆肝工程師的異世界狂想曲", date: "1/11", week: "Thu", time: "23:30", carrier: "Comic", season: "1", nameInJpn: "デスマーチからはじまる異世界狂想曲", img: "https://i.imgur.com/Nlo1oZB.jpg", official: "http://deathma-anime.com/", description: "正在爆肝加班當中的程式設計師,遊戲中名為「佐藤」的鈴木一郎(29歲)。原本應該在小睡片刻的他,回過神竟發現自己被放逐到了陌生的異世界!連慌亂的閒暇都沒有,一大群從未見過的怪物逼近眼前,流星雨自天空傾盆而降——然後轉眼間,最強等級的力量和鉅額財富都得手了……!?就這樣,佐藤「溫馨,時而嚴肅,並兼具後宮」的異世界冒險故事就此展開!" }, { name: "刀劍亂舞花丸", date: "1/17", week: "Sun", time: "24:00", carrier: "Game", season: "2", nameInJpn: "刀剣乱舞-花丸-", img: "https://i.imgur.com/d1mvtE8.png", official: "http://touken-hanamaru.jp/index.html", description: "故事描述西元 2205 年時的政府為了對抗目的為干涉過去歷史的「歷史修正主義者」,擁有將刀劍喚醒的力量的審神者以及刀劍的付喪神「刀劍男士」送往各個時代展開戰役。花丸將以本丸為舞台,描寫刀劍男士們時而歡笑時而迷惑、一心一意地生活下去的故事。" }, { name: "銀之守墓人", date: "1/13", week: "Sat", time: "21:00", carrier: "Comic", season: "2", nameInJpn: "銀の墓守り", img: "https://i.imgur.com/RDcKXlD.png", official: "http://ginno-guardian.jp/", description: "描述少年陸水銀是位職業遊戲玩家,知曉此事的是一位和他同樣喜愛遊戲的校內第一美少女陸怜。某天,水銀從怜手上得到了網絡遊戲「盜墓遊戲」程式,但怜卻突然遭到綁架。當水銀碰觸到被留下的程式之時,意外被吸入了遊戲世界之中......." }, { name: "七大罪", date: "1/13", week: "Sat", time: "12:00", carrier: "Comic", season: "2", nameInJpn: "七つの大罪", img: "https://i.imgur.com/SfnWppv.png", official: "http://www.7-taizai.net/", description: "故事描述一個看似個小鬼頭的酒館老闆,加上一隻會說話的豬‧霍克與他的移動店面,開始了酒吧兼情報收集站的生活,卻因緣際會遇到穿著盔甲的美少女‧伊麗莎白。身為公主的伊麗莎白,是為了拯救王國而踏上尋找「七大罪」的旅程。" }, { name: "OVERLORD", date: "1/9", week: "Tue", time: "10:30", carrier: "Novel", season: "2", nameInJpn: "OVERLORD", img: "https://i.imgur.com/KxeyfPO.png", official: "http://overlord-anime.com/", description: "描述過去曾一度引起極大話題的網路遊戲,其原本應該靜靜的迎接停止一切服務的,只是沒想到時間一到卻造成了玩家無法登出!在現實世界中只是位喜好電玩的青年現在卻變成了有著骷髏外表的最強魔法師「飛鼠」,他將率領公會展開一場前所未有的傳說。" }, { name: "粗點心戰爭", date: "1/11", week: "Thu", time: "2:28", carrier: "Comic", season: "2", nameInJpn: "だがしかし", img: "https://i.imgur.com/4YZTUfi.png", official: "http://www.tbs.co.jp/anime/dagashi/", description: "粗點心是廉價零食的統稱,其中承載了無數孩子們的夢想!家在偏僻半島的鹿丸粗點心屋的兒子 九,勉為其難的被父親拜託看店。父親雖然表示九在粗點心領域有天賦,可是九卻不想繼承家業。然而某天偶遇了點心控的迷之美少女 枝垂瑩,鄉村的點心之夏就此開始。" }, { name: "齊木楠雄的災難", date: "1/16", week: "Tue", time: "1:35", carrier: "Comic", season: "2", nameInJpn: "斉木楠雄のΨ難", img: "https://i.imgur.com/fOI8WyX.png", official: "http://www.saikikusuo.com/", description: "在一個平凡的日本家庭,父母都很普通,齊木楠雄的出生卻不平凡。齊木楠雄天生下來就是個超能力者,雖然擁有足以毀滅世界的力量,但齊木楠雄每天只是想辦法讓自己默默地隱藏在人群之中。不想引人注目因此極力做個平凡人,直到國中都順利當個不起眼的學生。" }, { name: "飆速宅男", date: "1/8", week: "Mon", time: "2:05", carrier: "Comic", season: "4", nameInJpn: "弱虫ペダル", img: "https://i.imgur.com/vDLwNOW.png", official: "http://yowapeda.com/", description: "描述熱愛動漫、遊戲和秋葉原的他,原本打算高中後一定要加入動漫研究社,不過,卻因為社員不足而中止活動。面對這樣的狀況,主角因此感到意志消沉。某日在訓練時見到坂道騎車爬坡的過程,一場又一場的熱血的高中自行車競技聯賽故事,就此展開。" }, { name: "庫洛魔法使透明牌篇", date: "1/7", week: "Sun", time: "7:30", carrier: "Comic", season: "1", nameInJpn: "カードキャプターさくら クリアカード編", img: "https://i.imgur.com/mk0RI6Q.png", official: "http://ccsakura-official.com/", description: "描述木之本櫻因有一天不小心打開了她父親所收藏的魔法書,意外把有魔法力量的「庫洛卡片」釋放,因此展開了和庫洛卡守護獸可魯貝洛斯及好友們一同收服庫洛卡的冒險。新作則描述成為中學的小櫻與小狼再次相見的故事。" }, { name: "銀魂", date: "1/7", week: "Sun", time: "1:35", carrier: "Comic", season: "5", nameInJpn: "銀魂", img: "https://i.imgur.com/m9fNubI.png", official: "http://www.j-gintama.com/", description: "描述江戶時代末期,被稱為天人的謎之異星人來襲;於是地球人與天人之間的戰爭瞬即爆發,為數眾多的武士和攘夷派志士都參與與天人的戰鬥。在這樣的時代,有一個武士「坂田銀時」與同伴「志村新八」、「神樂」愉快地過著異想天開的生活。" }, { name: "紫羅蘭永恆花園", date: "1/10", week: "Wed", time: "0:00", carrier: "Novel", season: "1", nameInJpn: "ヴァイオレット・エヴァーガーデン", img: "https://i.imgur.com/vX7v28u.png", official: "http://violet-evergarden.jp/", description: "描述自動手記人偶能將人類的話語記下並書寫的機械。當初,此種機械是奧蘭多博士為其愛妻所製,但現時卻於世上廣泛普及,並出現能提供租借人偶的機構。女主角正是一名金髮綠瞳自動手記人偶少女。她去往不同的地方,為不同的委託人工作。" }, { name: "皇帝聖印戰記", date: "1/5", week: "Fri", time: "24:00", carrier: "Novel", season: "1", nameInJpn: "グランクレスト戦記", img: "https://i.imgur.com/Imz3zbQ.png", official: "http://grancrest-anime.jp/", description: "描述不知何時起君主們捨棄了「淨化混沌」這一理念,開始了互相爭奪聖印和領土的戰亂—— 魔法師希露卡以及流浪騎士提歐兩人交換的主從之誓,會為混沌與戰亂的大陸帶來變革之風嗎......。" }, { name: "三麗鷗男子", date: "1/6", week: "Sat", time: "22:00", carrier: "Original", season: "1", nameInJpn: "サンリオ男子", img: "https://i.imgur.com/Bapd6oX.png", official: "http://sdan-anime.com/", description: "是以五位喜愛三麗鷗旗下角色的帥氣男高中生為中心,有著喜愛布丁狗的長谷川康太、喜愛美樂蒂的水野佑、喜愛 Hello Kitty 的吉野俊介、喜愛大耳狗的源誠一郎、以及喜愛雙星仙子的西宮諒五人,以美男子、戀愛、青春故事為主軸展開。" }, { name: "搖曳露營", date: "1/4", week: "Thu", time: "23:00", carrier: "Comic", season: "1", nameInJpn: "ゆるキャン△", img: "https://i.imgur.com/COXfdTY.png", official: "http://yurucamp.jp/", description: "描寫冬季的富士山公路上、一名騎著自行車的少女來到露營地租借露營場所,這位俐落將所有設備準備好的少女名為凜,她在路上偶爾遇見一位睡在路邊的女孩撫子,一場專屬於少女的野營物語也就此開幕!" }, { name: "學園奶爸", date: "1/7", week: "Sun", time: "23:00", carrier: "Comic", season: "1", nameInJpn: "学園ベビーシッターズ", img: "https://i.imgur.com/X2NHAF9.png", official: "http://gakubaby-anime.com/", description: "因為空難事件失去雙親的龍一和年幼的弟弟虎太郎,兩兄弟雖然被森之宮學園的理事長收養,但交換條件卻是龍一必須「要在學園的保母室當保母」。面對這些活力十足的小朋友們,龍一要怎麼辦呢?超人氣學園「育嬰」緊急行動開始了。" }, { name: "戀如雨止", date: "1/11", week: "Thu", time: "24:55", carrier: "Comic", season: "1", nameInJpn: "恋は雨上がりのように", img: "https://i.imgur.com/PiM6VEH.png", official: "http://www.koiame-anime.com/", description: "描述一名外表冷酷、不擅長表達感情而常常被其他人誤解的 17 歲高中二年級少女「橘晶」,暗戀上了打工的 45 歲家庭餐廳店長──近藤正己。於青春十字路口停滯不前的她,與面臨人生折返點的他,由這兩人紡織而成的小小戀曲,開奏。" }, { name: "Fate/EXTRA", date: "1/27", week: "Wed", time: "24:00", carrier: "Game", season: "1", nameInJpn: "Fate/EXTRA Last Encore", img: "https://i.imgur.com/hMgvCNv.png", official: "http://fate-extra-lastencore.com/", description: "故事描述原本應該是普通的校園生活,但隨著對現況違和感,主人公踏入了名為聖杯戰爭的零和遊戲。經過預選後共誕生了共 128 名 Master,一但戰敗就會迎來死亡,忘記過去的主人公,能在眾多 Master 中勝出嗎?" }, { name: "三顆星彩色冒險", date: "1/7", week: "Sun", time: "22:30", carrier: "Comic", season: "1", nameInJpn: "三ツ星カラーズ", img: "https://i.imgur.com/J1UOJ4r.png", official: "http://mitsuboshi-anime.com/", description: "故事以為了守護阿美橫町、公園、動物園以及上野而日夜四處奔波的小學女生三人組,結衣、小幸、以及琴葉所組成的「COLORS」為中心,展開了各式的樣的女子物語。" }, { name: "Slow Start", date: "1/6", week: "Sat", time: "24:30", carrier: "Comic", season: "1", nameInJpn: "スロウスタート", img: "https://i.imgur.com/TcnuYlw.png", official: "http://slow-start.com/", description: "女主角一之瀬花名,因為生病的關係因此錯過了入學考試,因此高中比起起他同學要晚了一年入學。也因為這樣,花名將她比其他人還要大一歲的事情作為秘密,與同學們展開日常的校園生活。" }, { name: "刀使之巫女", date: "1/5", week: "Fri", time: "21:30", carrier: "Original", season: "1", nameInJpn: "刀使ノ巫女", img: "https://i.imgur.com/NB8VAhb.png", official: "http://tojinomiko.jp/", description: "古往今來,巫女用御刀驅除威脅人間的異形——荒魂。她們穿著制服配帶著刀,被稱為刀使。她們是正式屬於警察組織的特別祭祀機動隊。是被特例允許帶刀的國家公務員。同時她們大多也是全國有 5 個點的初高中統一訓練學校的學生。" }, { name: "伊藤潤二集", date: "1/7", week: "Sun", time: "22:00", carrier: "Comic", season: "1", nameInJpn: "伊藤潤二『コレクション』", img: "https://i.imgur.com/8Xf6ePR.png", official: "http://itojunji-anime.com/", description: "伊藤潤二是日本著名恐怖漫畫家。出生於日本的岐阜縣,原本從事齒模技工。自他年幼時期便熱衷於楳圖一雄與古賀新一的恐怖漫畫,遂展開其自身的繪畫生涯。" }, { name: "DAME×PRINCE", date: "1/10", week: "Wed", time: "22:30", carrier: "Game", season: "1", nameInJpn: "ダメプリ ANIME CARAVAN", img: "https://i.imgur.com/HcSy2Yu.png", official: "https://damepri-anime.jp/", description: "原作是一款享受和各種糟糕王子戀愛的遊戲。遊戲中可攻略角色包括有超級自戀好色、國家級偶像但卻是死宅等奇怪的王子。作為弱小國家的公主的玩家,為了自己的國家必須攻略鄰國王子的心。" }, { name: "柑橘味香氣 citrus", date: "1/6", week: "Sat", time: "23:30", carrier: "Comic", season: "1", nameInJpn: "citrus", img: "https://i.imgur.com/OF68Usf.png", official: "http://citrus-anime.com/", description: "從來沒有談過戀愛的辣妹女高中生柚子,一本正經的黑髮美女學生會長芽依。兩人因父母再婚而成為姊妹,初此見面就對彼此留下最惡劣的印象。但在學校意外目擊芽依被帥哥導師雨宮強吻的柚子,衝擊性的場面在她腦內揮之不去......。" }, { name: "IDOLiSH7", date: "1/7", week: "Sun", time: "22:30", carrier: "Game", season: "1", nameInJpn: "アイドリッシュセブン", img: "https://i.imgur.com/JhB81LR.png", official: "http://idolish7.com/aninana/", description: "遊戲中玩家所扮演的角色是小鳥遊事務所的經紀人,負責社內男性偶像組合 IDOLiSH7,與 7 名新人偶像一起向著成為超級明星而努力拼搏!除了小鳥遊事務所以外,目前還有一個對手事務所——八乙女事務所,負責對手團TRIGGER的培養。**首次放送播送兩集 1/1 TOKYO MX 20:00" }, { name: "愛吃拉麵的小泉同學", date: "1/4", week: "Thu", time: "20:00", carrier: "Comic", season: "1", nameInJpn: "ラーメン大好き小泉さん", img: "https://i.imgur.com/om5XG9B.png", official: "http://ramen-koizumi.com/", description: "大澤悠的班上來了一位轉學生小泉。沉默寡言且神祕的小泉,她是不斷追求新美味拉麵的拉麵達人,對拉麵以外的事毫無興趣,突然去當地吃拉麵的行動力和執著心都很高,因為不吃其它食物的想法所以沒有朋友。" }, { name: "霸穹 封神演義", date: "1/12", week: "Fri", time: "22:00", carrier: "Comic", season: "1", nameInJpn: "覇穹 封神演義", img: "https://i.imgur.com/E3M5nkm.png", official: "http://www.tvhoushin-engi.com/", description: "原作故事的時空被設置在公元前 1100 年左右,也即是中國商朝末年紂王統治的年期。一直以來仙人界與人間界均相安無事,甚少互相干預。但自從仙人界的妲己下降到人間界並憑藉其妖術魅惑紂王,導致民不聊生,三大仙人便決定插手干預整個情況。" }, { name: "擅長捉弄人的高木同學", date: "1/8", week: "Mon", time: "23:00", carrier: "Comic", season: "1", nameInJpn: "からかい上手の高木さん", img: "https://i.imgur.com/O6cwlLb.png", official: "http://takagi3.me/", description: "普通的男子中學生西片,和一位古靈精怪的女生高木坐在一起,高木經長捉弄著遲鈍的西片,把他耍得團團轉,教室後面是他們小動作的空間。儘管西片總想著報復回去,但卻始終在高木層出不窮的點子面前以失敗告終。" }, { name: "博多豚骨拉麵", date: "1/12", week: "Fri", time: "22:30", carrier: "Novel", season: "1", nameInJpn: "博多豚骨ラーメンズ", img: "https://i.imgur.com/sXO2aR4.png", official: "http://hakatatonkotsu-anime.com/", description: "在看似和平的福岡,事實上暗地裡卻瀰漫著犯罪的氣息。在總人口 3% 皆為殺手的都市裡,這裡已經成為殺手激戰的舞台。而在故事圍繞在殺手、偵探、復仇家、拷問家等人身上時,錯綜複雜的劇情就此展開。" }, { name: "BEATLESS", date: "1/12", week: "Fri", time: "25:55", carrier: "Novel", season: "1", nameInJpn: "BEATLESS", img: "https://i.imgur.com/tyacYTy.png", official: "http://beatless-anime.jp/", description: "敘述在 22 世紀初人類社會的大小事情幾乎全部交由被稱為「hIE」的機器人負責,hIE 作為擁有著超越人類智慧的道具而生。人類社會面臨老齡化和少子化帶來的勞動力減少,hIE 的出現填補了人類勞動力的空缺讓人類社會高度自動化......。" }, { name: "龍王的工作!", date: "1/8", week: "Mon", time: "22:00", carrier: "Novel", season: "1", nameInJpn: "りゅうおうのおしごと!~かんそうせん~", img: "https://i.imgur.com/H0LUCJf.png", official: "http://www.ryuoh-anime.com/", description: "描述十六歲即獲得將棋界二大頭銜之一「龍王」,但之後因為連戰連敗的關係,被取了「廢物龍王」的稱號。某天回到家裡時,眼前冒出了一位 JS:「我依照約定來了,請收我為弟子!」八一對自己答應過的事情完全沒有印象,卻展開了與 JS 同居的生活......。" }, { name: "櫻花忍法帖", date: "1/8", week: "Mon", time: "24:00", carrier: "Comic", season: "1", nameInJpn: "バジリスク ~桜花忍法帖~ ", img: "https://i.imgur.com/cfKJ2M2.png", official: "http://basilisk-ouka.jp/", description: "以《甲賀忍法帖》10 年後作為舞台,描寫寬永 3 年,再次集結了菁英們的甲賀與伊賀,以甲賀八郎與伊賀五花這兩位少年少女們為中心,捲入了與操縱著非人力量的集團之間的戰鬥。" }, { name: "小木乃伊到我家", date: "1/11", week: "Thu", time: "1:58", carrier: "Comic", season: "1", nameInJpn: "ミイラの飼い方", img: "https://i.imgur.com/kilcFiB.jpg", official: "http://www.tbs.co.jp/anime/miira/", description: "遠從埃及而來的木乃伊,小小一隻又超會賣萌...牠什麼都吃,還會幫忙做家事!?男高中生跟小木乃伊的療癒生活點滴就此展開。" }, { name: "DARLING in the FRANXX", date: "1/13", week: "Sat", time: "23:30", carrier: "Original", season: "1", nameInJpn: "ダーリン・イン・ザ・フランキス", img: "https://i.imgur.com/LfJoGZ4.png", official: "http://darli-fra.jp/", description: "遙遠的未來,人類在荒廢的大地上建設了移動要塞都市。在那當中建造的駕駛員居住設施米斯特汀,通稱鳥籠。孩子們就住在那裡。對外面的世界一無所知。對自由的天空一無所知。他們被告知的使命,只有戰鬥而已......。" }, { name: "妖精森林的小不點", date: "1/12", week: "Fri", time: "21:00", carrier: "Comic", season: "1", nameInJpn: "ハクメイとミコチ", img: "https://i.imgur.com/ZXJRYcv.png", official: "http://hakumiko.com/", description: "主角是個身高 9 公分的小小女孩御子地跟白明,原本不相識的兩人誤打誤撞而住在同一個屋簷下。某天看到報紙上有人目擊到夕陽鷹出沒,馬上就準備好東西拉著御子地上山去等,後來才發現原來夕陽鷹曾經是御子地在 10 年前曾經短暫飼養過的白鳥......。" }, { name: "刻刻", date: "1/7", week: "Sun", time: "24:30", carrier: "Comic", season: "1", nameInJpn: "刻刻", img: "https://i.imgur.com/A6hdiR9.png", official: "http://kokkoku-anime.com/", description: "與家人一起生活的佑河樹里,某日她的哥哥與外甥遭人誘拐,為了拯救家人,樹里的祖父使用佑河家代代相傳的「止界術」將時間暫停,但沒想到進入止界的樹里一行人,居然遇到其他能在止界中行動的人……。" }, { name: "酒鬼妹子", date: "1/11", week: "Thu", time: "2:43", carrier: "Comic", season: "1", nameInJpn: "たくのみ。", img: "https://i.imgur.com/5UcrhNT.png", official: "http://www.tbs.co.jp/anime/takunomi/", description: "老家在岡山的天月滿,因為工作緣故來隻身一人來到東京,入住春野公寓,與性格迥異的三位女生開始了合租生活。" }, { name: "牙鬥獸娘", date: "1/12", week: "Fri", time: "26:25", carrier: "Comic", season: "1", nameInJpn: "キリングバイツ", img: "https://i.imgur.com/ObuGGwZ.png", official: "http://killingbites-anime.com/", description: "舉行於地下社會,超越人類認知的「獸人」間的決鬥「牙鬥(Killing Bites)」。" }, { name: "童話・少女", date: "1/11", week: "Thu", time: "21:00", carrier: "Novel", season: "1", nameInJpn: "メルヘン・メドヘン", img: "https://i.imgur.com/awF0lgj.png", official: "http://maerchen-anime.com/", description: "開始於散布於世界各處的童話「原書」,少女們將與「原書」相遇、被選擇後成為能夠使用魔法的「原書使者」,作品描述少女們如何奮鬥成為一個原書使者,是一部充滿夢想、魔法與青春的物語。" }, { name: "比宇宙還遠的地方", date: "1/2", week: "Tue", time: "20:30", carrier: "Original", season: "1", nameInJpn: "宇宙よりも遠い場所", img: "https://i.imgur.com/u9hPaIb.png", official: "http://yorimoi.com/", description: "不論何時,我們的一步都是從好奇心開始的。未曾見過的風景,未曾聽過的聲 音,未曾聞過的香氣,未曾碰觸過的質感,未曾嘗過的食物,以及未曾感受過的胸 中鼓動,不知何時忘卻的碎片,拋棄了的感動,將它們重拾起來的旅程。" }, { name: "七美德", date: "1/26", week: "Fri", time: "24:25", carrier: "Original", season: "1", nameInJpn: "七つの美徳", img: "https://i.imgur.com/v6NsZs5.png", official: "http://7-virtues.net/anime/", description: "天界為了阻止魔王們的「七大罪」蔓延,因而派遣天使去人間界找尋擁有「七美德」的候補救世主,然而這七位天使卻各自有著性格缺陷,另一方面,降臨至地面的天使們,則開始執行尋找救世主候補的任務……。" }]).sort(function(i, e) {
return new Date(2018, i.date.split("/")[0], i.date.split("/")[1], i.time.split(":")[0], i.time.split(":")[1]) - new Date(2018, e.date.split("/")[0], e.date.split("/")[1], e.time.split(":")[0], e.time.split(":")[1]);
}); | 2,637.8 | 12,950 | 0.706725 |
98aa2cc9e118509291b519bd76b0c96a41355509 | 688 | html | HTML | src/T3-CSS/12-negative-margin.html | fsande/class-code-examples | 354bbbbc76c4b74576a848981e7f8ffc2812a923 | [
"MIT"
] | null | null | null | src/T3-CSS/12-negative-margin.html | fsande/class-code-examples | 354bbbbc76c4b74576a848981e7f8ffc2812a923 | [
"MIT"
] | 39 | 2021-03-25T10:00:21.000Z | 2022-01-31T21:07:28.000Z | src/T3-CSS/12-negative-margin.html | fsande/class-code-examples | 354bbbbc76c4b74576a848981e7f8ffc2812a923 | [
"MIT"
] | null | null | null | <!--
Universidad de La Laguna
Escuela Superior de Ingeniería y Tecnología
Grado en Ingeniería Informática
Programación de Aplicaciones Interactivas
@author F. de Sande
@since 24.apr.2020
@desc CSS Negative margin
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>12 PAI: HTML & CSS</title>
<link rel=stylesheet href="negative-margin.css">
</head>
<body>
<h1>PAI: Negative Margin</h1>
<div id="header"></div>
<div id="profile">
<img src="https://es.gravatar.com/userimage/42228651/736cf79b052cc5f6548f7a4ea57eb656.jpg?size=200" alt="Avatar" height="140">
</div>
</body>
</html>
| 24.571429 | 130 | 0.688953 |
67894fccf703594d1a76be7dd4eb360609ce82c7 | 112 | sql | SQL | schema.sql | MichelleMcConville/14-rev-engineering-code | fa893eca2d791a89224d4ad97b12df0e836fb865 | [
"WTFPL"
] | null | null | null | schema.sql | MichelleMcConville/14-rev-engineering-code | fa893eca2d791a89224d4ad97b12df0e836fb865 | [
"WTFPL"
] | null | null | null | schema.sql | MichelleMcConville/14-rev-engineering-code | fa893eca2d791a89224d4ad97b12df0e836fb865 | [
"WTFPL"
] | null | null | null | DROP DATABASE IF EXISTS passport_demo;
-- Creates the "passport_demo" database --
CREATE DATABASE passport_demo; | 37.333333 | 42 | 0.8125 |
08a3074d7868b432bcfaa771338814592eab491c | 2,166 | go | Go | day19/part1/main.go | AntonKosov/advent-of-code-2020 | 8c55224bdbbbfc5b66477d76261e715254303dbf | [
"MIT"
] | null | null | null | day19/part1/main.go | AntonKosov/advent-of-code-2020 | 8c55224bdbbbfc5b66477d76261e715254303dbf | [
"MIT"
] | null | null | null | day19/part1/main.go | AntonKosov/advent-of-code-2020 | 8c55224bdbbbfc5b66477d76261e715254303dbf | [
"MIT"
] | null | null | null | package main
import (
"fmt"
"strings"
"github.com/AntonKosov/advent-of-code-2020/aoc"
)
func main() {
rules, messages := read()
r := process(rules, messages)
fmt.Printf("Answer: %v\n", r)
}
type matcher interface {
verify(rules map[int]matcher, message string, start int) (last int, ok bool)
}
type runeMatcher struct {
r rune
}
func (m runeMatcher) verify(_ map[int]matcher, message string, start int) (last int, ok bool) {
return start, message[start] == byte(m.r)
}
type sequenceMatcher struct {
sequence []int
}
func (m sequenceMatcher) verify(rules map[int]matcher, message string, start int) (last int, ok bool) {
for _, rule := range m.sequence {
matcher := rules[rule]
last, ok = matcher.verify(rules, message, start)
if !ok {
return 0, false
}
start = last + 1
}
return last, true
}
type sequencesMatcher struct {
sequences []sequenceMatcher
}
func (m sequencesMatcher) verify(rules map[int]matcher, message string, start int) (last int, ok bool) {
for _, s := range m.sequences {
last, ok = s.verify(rules, message, start)
if ok {
return last, true
}
}
return 0, false
}
func read() (rules map[int]matcher, messages []string) {
rules = make(map[int]matcher)
lines := aoc.ReadAllInput()
i := 0
for {
line := lines[i]
if line == "" {
break
}
sc := strings.Split(line, ":")
ruleId := aoc.StrToInt(sc[0])
var m matcher
sp := sc[1]
if strings.Contains(sp, "\"") {
m = runeMatcher{r: rune(sp[2])}
} else if strings.Contains(sp, "|") {
sm := sequencesMatcher{}
rs := strings.Split(sp, "|")
for _, r := range rs {
sm.sequences = append(sm.sequences, sequenceMatcher{sequence: aoc.StrToInts(r, " ")})
}
m = sm
} else {
m = sequenceMatcher{sequence: aoc.StrToInts(sp, " ")}
}
rules[ruleId] = m
i++
}
for j := i + 1; j < len(lines); j++ {
line := lines[j]
if line != "" {
messages = append(messages, line)
}
}
return rules, messages
}
func process(rules map[int]matcher, messages []string) int {
sum := 0
for _, m := range messages {
if last, ok := rules[0].verify(rules, m, 0); ok && last == len(m)-1 {
sum++
}
}
return sum
}
| 19.513514 | 104 | 0.626039 |
f059d72c27fc6cb556c4bc0d26b29b2c46df568c | 78 | js | JavaScript | app/utils/color.js | ExplorViz/explorviz-frontend-extension-dashboard | 23787b404b5559a488d49211309484a710bce6f1 | [
"Apache-2.0",
"MIT"
] | null | null | null | app/utils/color.js | ExplorViz/explorviz-frontend-extension-dashboard | 23787b404b5559a488d49211309484a710bce6f1 | [
"Apache-2.0",
"MIT"
] | 4 | 2020-09-05T02:01:17.000Z | 2022-02-12T12:30:09.000Z | app/utils/color.js | ExplorViz/explorviz-frontend-extension-dashboard | 23787b404b5559a488d49211309484a710bce6f1 | [
"Apache-2.0",
"MIT"
] | null | null | null | export { default } from 'explorviz-frontend-extension-dashboard/utils/color';
| 39 | 77 | 0.794872 |
0cb66d2801b2daaa2e8e7ffbed52fec520091038 | 3,499 | py | Python | yolox/models/simo_fpn.py | RawFisher/YOLOX | bec9423bdd25a9e85b976c32d774e31a33fcefed | [
"Apache-2.0"
] | null | null | null | yolox/models/simo_fpn.py | RawFisher/YOLOX | bec9423bdd25a9e85b976c32d774e31a33fcefed | [
"Apache-2.0"
] | null | null | null | yolox/models/simo_fpn.py | RawFisher/YOLOX | bec9423bdd25a9e85b976c32d774e31a33fcefed | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
import torch
import torch.nn as nn
from .sdc_darknet import SDCCSPDarknet
# from .simo_darknet import SIMOCSPDarknet
from .network_blocks import BaseConv, CSPLayer, DWConv
from .network_blocks import get_activation
class SIMOFPN(nn.Module):
"""
YOLOv3 model. Darknet 53 is the default backbone of this model.
"""
def __init__(
self,
depth=1.0,
width=1.0,
in_features=("dark5",),
in_channels=[1024,],
encode_channels=[256, 256, 256],
out_channels=[256, 256, 256],
depthwise=False,
act="silu",
):
super().__init__()
self.backbone = SDCCSPDarknet(depth, width, depthwise=depthwise, act=act)
# self.backbone = SIMOCSPDarknet(depth, width, depthwise=depthwise, act=act)
self.in_features = in_features
self.in_channels = in_channels
self.out_channels = out_channels
self.encode_channels = encode_channels
Conv = DWConv if depthwise else BaseConv
self.upsample = nn.Upsample(scale_factor=2, mode="nearest")
self.align_layers = nn.ModuleList()
for idx in range(len(self.in_channels)):
self.align_layers.append(
Conv(int(self.in_channels[idx] * width), int(self.encode_channels[idx] * width), 1, 1, act=act)
)
# bottom-up conv
self.level_conv2_layers = nn.ModuleList()
for idx in range(len(self.out_channels)):
self.level_conv2_layers.append(
Conv(int(self.encode_channels[idx] * width), int(self.encode_channels[idx] * width), 3, 1, act=act)
)
# extra layers
self.extra_lvl_in_conv = ExtraConv(
int(self.encode_channels[0] * width), int(self.encode_channels[0] * width), 3, 2, act=act
)
self.top_down_blocks = ExtraConv(
int(self.encode_channels[0] * width), int(self.encode_channels[0] * width), 3, 2, act=act
)
def forward(self, input):
"""
Args:
inputs: input images.
Returns:
Tuple[Tensor]: FPN feature.
"""
# backbone
out_features = self.backbone(input)
features = [align(out_features[f]) for f, align in zip(self.in_features, self.align_layers)]
[C5] = features
P5 = C5
P4 = self.upsample(P5)
P3 = self.upsample(P4)
P5 = self.level_conv2_layers[0](P5)
P4 = self.level_conv2_layers[1](P4)
P3 = self.level_conv2_layers[2](P3)
# extra layers
P6 = self.extra_lvl_in_conv(C5) + self.top_down_blocks(P5)
outputs = (P3, P4, P5, P6)
return outputs
class ExtraConv(nn.Module):
"""A Conv2d -> Batchnorm -> silu/leaky relu block"""
def __init__(
self, in_channels, out_channels, ksize, stride, groups=1, bias=False, act="silu"
):
super().__init__()
pad = ksize // 2
self.conv = nn.Conv2d(
in_channels,
out_channels,
kernel_size=ksize,
stride=stride,
padding=pad,
groups=groups,
bias=bias,
)
self.bn = nn.BatchNorm2d(out_channels)
self.act = get_activation(act, inplace=True)
def forward(self, x):
return self.act(self.bn(self.conv(x)))
def fuseforward(self, x):
return self.act(self.conv(x)) | 30.964602 | 115 | 0.595027 |
24db6984d3261023bf438d7c4ec038c3e286f0c7 | 429 | go | Go | common/db/db_test.go | fakegit/crocodile | 5f03e6bc6b595aefb70b6693ee7c05f49d3a3f79 | [
"MIT"
] | 755 | 2019-07-21T11:13:12.000Z | 2022-02-07T02:33:53.000Z | common/db/db_test.go | fakegit/crocodile | 5f03e6bc6b595aefb70b6693ee7c05f49d3a3f79 | [
"MIT"
] | 72 | 2020-02-29T08:19:29.000Z | 2022-01-27T10:15:22.000Z | common/db/db_test.go | fakegit/crocodile | 5f03e6bc6b595aefb70b6693ee7c05f49d3a3f79 | [
"MIT"
] | 125 | 2019-07-21T11:13:13.000Z | 2022-01-10T02:53:43.000Z | package db
import (
"context"
"os"
"testing"
)
func TestNewDb(t *testing.T) {
err := NewDb(Drivename("sqlite3"),
Dsn("sqlite3.db"),
MaxIdleConnection(10),
MaxQueryTime(3),
MaxQueryTime(3),
MaxOpenConnection(3),
)
if err != nil {
t.Fatalf("NewDb Err: %v", err)
}
conn, err := GetConn(context.Background())
if err != nil {
t.Fatalf("Get Conn Err: %v", err)
}
conn.Close()
_ = os.Remove("sqlite3.db")
}
| 15.321429 | 43 | 0.620047 |
817f8b433b02ed041d7a8a8e146b97296ef6a72e | 2,549 | swift | Swift | TwitterClient/Views/TweetCell.swift | vijayanands/TwitterClient | ccec20ee080d16b26ef3fe647231c31f96b5f7e3 | [
"Apache-2.0"
] | null | null | null | TwitterClient/Views/TweetCell.swift | vijayanands/TwitterClient | ccec20ee080d16b26ef3fe647231c31f96b5f7e3 | [
"Apache-2.0"
] | 1 | 2017-10-02T12:11:48.000Z | 2017-10-02T12:11:48.000Z | TwitterClient/Views/TweetCell.swift | vijayanands/TwitterClient | ccec20ee080d16b26ef3fe647231c31f96b5f7e3 | [
"Apache-2.0"
] | null | null | null | //
// TweetCell.swift
// TwitterClient
//
// Created by Vijayanand on 9/29/17.
// Copyright © 2017 Vijayanand. All rights reserved.
//
import UIKit
import AFNetworking
import NSDateMinimalTimeAgo
class TweetCell: UITableViewCell {
@IBOutlet weak var profileImage: UIImageView!
@IBOutlet weak var starImage: UIImageView!
@IBOutlet weak var retweetImage2: UIImageView!
@IBOutlet weak var retweetImage1: UIImageView!
@IBOutlet weak var retweetInfoLabel: UILabel!
@IBOutlet weak var tweetTextLabel: UILabel!
@IBOutlet weak var timestampLabel: UILabel!
@IBOutlet weak var nameLabel: UILabel!
@IBOutlet weak var usernameLabel: UILabel!
@IBOutlet weak var inReplyToUser: UILabel!
@IBOutlet weak var inReplyToLabel: UILabel!
@IBOutlet weak var retweetCount: UILabel!
@IBOutlet weak var favoritesCount: UILabel!
func customInit(tweet: Tweet) {
nameLabel.text = tweet.user?.name as String?
usernameLabel.text = tweet.user?.screenName as String?
Utilities.setImage(forImage: profileImage, using: (tweet.user?.profileImageUrl!)!)
tweetTextLabel.text = tweet.text as String?
starImage.image = UIImage(named: "star.png")
favoritesCount.text = String("\(tweet.favoriteCount ?? 0)")
retweetImage1.image = UIImage(named: "retweet.png")
retweetImage2.image = UIImage(named: "retweet.png")
retweetCount.text = String("\(tweet.retweetCount ?? 0)")
if let retweet_count = tweet.retweetCount {
if retweet_count > 0 {
retweetImage1.isHidden = false
retweetInfoLabel.isHidden = false
} else {
retweetImage1.isHidden = true
retweetInfoLabel.isHidden = true
}
} else {
retweetImage1.isHidden = true
retweetInfoLabel.isHidden = true
}
// set timestamp of tweet
timestampLabel.text = tweet.createdAt?.timeAgo()
if tweet.inReplyTo != nil {
inReplyToUser.isHidden = false
inReplyToLabel.isHidden = false
inReplyToUser.text = tweet.inReplyTo! as String
} else {
inReplyToUser.isHidden = true
inReplyToLabel.isHidden = true
}
if tweet.retweetedBy != nil {
retweetInfoLabel.isHidden = false
retweetImage1.isHidden = false
retweetInfoLabel.text = (tweet.retweetedBy! as String) + " retweeted"
} else {
retweetInfoLabel.isHidden = true
retweetImage1.isHidden = true
}
}
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
}
| 30.345238 | 84 | 0.728129 |
048beffe982dcf86ca0d95eb957a66db3d09f3b8 | 1,256 | kt | Kotlin | src/main/kotlin/novah/ide/NovahIde.kt | stackoverflow/novah | dbb2c4795ac0254bca353c90e7a510aa5d1222b2 | [
"Apache-2.0"
] | 6 | 2021-02-15T08:25:28.000Z | 2022-03-30T08:30:53.000Z | src/main/kotlin/novah/ide/NovahIde.kt | stackoverflow/novah | dbb2c4795ac0254bca353c90e7a510aa5d1222b2 | [
"Apache-2.0"
] | null | null | null | src/main/kotlin/novah/ide/NovahIde.kt | stackoverflow/novah | dbb2c4795ac0254bca353c90e7a510aa5d1222b2 | [
"Apache-2.0"
] | null | null | null | /**
* Copyright 2021 Islon Scherer
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package novah.ide
import org.eclipse.lsp4j.launch.LSPLauncher
import java.util.logging.Level
import java.util.logging.LogManager
import java.util.logging.Logger
object NovahIde {
fun run(verbose: Boolean) {
LogManager.getLogManager().reset()
val globalLogger: Logger = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME)
globalLogger.level = Level.OFF
val server = NovahServer(verbose)
val launcher = LSPLauncher.createServerLauncher(server, System.`in`, System.out)
val client = launcher.remoteProxy
server.connect(client)
val fut = launcher.startListening()
fut.get()
}
} | 32.205128 | 88 | 0.714968 |
71173d92a5b1892fd0dab6ee2f17b8b800a17d94 | 1,166 | ts | TypeScript | src/retrospection/retrospection.module.ts | cookie-god/picooha | 526b2ab82628d32182ce4915562d3b1a76dc128a | [
"MIT"
] | null | null | null | src/retrospection/retrospection.module.ts | cookie-god/picooha | 526b2ab82628d32182ce4915562d3b1a76dc128a | [
"MIT"
] | null | null | null | src/retrospection/retrospection.module.ts | cookie-god/picooha | 526b2ab82628d32182ce4915562d3b1a76dc128a | [
"MIT"
] | null | null | null | import { Module } from "@nestjs/common";
import { TypeOrmModule } from "@nestjs/typeorm";
import { MonthObjective } from "src/entity/month-objective.entity";
import { MonthRetrospective } from "src/entity/month-retrospective.entity";
import { TodayObjective } from "src/entity/today-objective.entity";
import { TodayRetrospective } from "src/entity/today-retrospective.entity";
import { WeekObjective } from "src/entity/week-objective.entity";
import { WeekRetrospective } from "src/entity/week-retrospective.entity";
import { YearObjective } from "src/entity/year-objective.entity";
import { YearRetrospective } from "src/entity/year-retrospective.entity";
import { RetrospectionController } from "./retrospection.controller";
import { RetrospectionService } from "./retrospection.service";
@Module({
imports: [
TypeOrmModule.forFeature([
TodayObjective,
WeekObjective,
MonthObjective,
YearObjective,
TodayRetrospective,
WeekRetrospective,
MonthRetrospective,
YearRetrospective,
]),
],
controllers: [RetrospectionController],
providers: [RetrospectionService],
})
export class RetrospectionModule {}
| 37.612903 | 75 | 0.746998 |
e8fb499b8bff3a7d1f52fd19a5495fe47b6684e5 | 2,165 | py | Python | bot/lib/controller/GetCommentTask.py | nullwriter/ig-actor | a089107657ccdf11ba213160c4cc5d3690cecd76 | [
"MIT"
] | null | null | null | bot/lib/controller/GetCommentTask.py | nullwriter/ig-actor | a089107657ccdf11ba213160c4cc5d3690cecd76 | [
"MIT"
] | null | null | null | bot/lib/controller/GetCommentTask.py | nullwriter/ig-actor | a089107657ccdf11ba213160c4cc5d3690cecd76 | [
"MIT"
] | null | null | null | import time
import re
from FileLogger import FileLogger as FL
import datetime
class GetCommentTask:
def __init__(self, task, name="extract-comment"):
self.task = task
self.name = name
self.comments = []
self.log = FL('Extracted Comments {:%Y-%m-%d %H:%M:%S}.txt'.format(datetime.datetime.now()))
def init_task(self):
hash_index = 0
loop = True
max_index = len(self.task.hashtags)
next_max_id = ""
while loop:
self.task.check_ops_limit()
current_hash = self.task.hashtags[hash_index]
self.task.api.getHashtagFeed(current_hash, maxid=next_max_id)
print ""
print "CURRENT HASHTAG = " + current_hash
print ""
ig_media = self.task.api.LastJson
if "next_max_id" not in ig_media:
print "####### Changing hashtag #######"
hash_index += 1
next_max_id = ""
if hash_index >= max_index - 1:
break
else:
next_max_id = self.do_task(ig_media)
def do_task(self, ig_media):
last_max_id = ig_media['next_max_id']
if "ranked_items" in ig_media:
key = "ranked_items"
else:
key = "items"
for ig in ig_media[key]:
self.task.api.getMediaComments(ig["id"])
for c in reversed(self.task.api.LastJson['comments']):
txt = c['text']
if self.check_string(txt):
self.comments.append(txt)
print "Comment = " + txt.encode('utf-8', 'ignore').decode('utf-8')
self.log.add_to_file(txt=txt)
self.task.task_count += 1
time.sleep(1)
time.sleep(self.task.get_time_delay())
return last_max_id
"""""
Checks if string doesnt contain special non-english characters, @, or Follow Me.
"""""
def check_string(self,str):
pattern = re.compile("^(?!follow|followme)[\s\w\d\?><;,\{\}\[\]\-_\+=!\#\$%^&\*\|\']*$")
return pattern.match(str)
| 28.116883 | 100 | 0.525635 |
9bf019a97e17ab6db55be53ebc7df5af35fcf7e8 | 99 | js | JavaScript | strapi-web-app/extensions/users-permissions/config/jwt.js | pytilia/strapi | 9571036a2a9e254b9472419cd00ee89c77fbd912 | [
"MIT"
] | null | null | null | strapi-web-app/extensions/users-permissions/config/jwt.js | pytilia/strapi | 9571036a2a9e254b9472419cd00ee89c77fbd912 | [
"MIT"
] | null | null | null | strapi-web-app/extensions/users-permissions/config/jwt.js | pytilia/strapi | 9571036a2a9e254b9472419cd00ee89c77fbd912 | [
"MIT"
] | null | null | null | module.exports = {
jwtSecret: process.env.JWT_SECRET || 'ec17671b-975b-4f98-8f86-d3d93be90894'
}; | 33 | 77 | 0.747475 |
f09a0066b2eb5c4f2af574d576c2f423421893ba | 446 | lua | Lua | lua/entities/npc_bail/shared.lua | FriksGit/script_gmod_arrestsystem | b04843148818b0fcd0d90bc26eafcd381b5459e1 | [
"MIT"
] | null | null | null | lua/entities/npc_bail/shared.lua | FriksGit/script_gmod_arrestsystem | b04843148818b0fcd0d90bc26eafcd381b5459e1 | [
"MIT"
] | null | null | null | lua/entities/npc_bail/shared.lua | FriksGit/script_gmod_arrestsystem | b04843148818b0fcd0d90bc26eafcd381b5459e1 | [
"MIT"
] | null | null | null | ENT.Type = 'ai'
ENT.Base = 'base_ai'
ENT.PrintName = 'npc_bail'
ENT.Author = ''
ENT.Category = "Jail NPC"
ENT.Spawnable = true
ENT.AdminSpawnable = true
ENT.CanUse = true
target = target or {}
function GetTarget()
return target or {}
end
function ENT:InitVars()
self.CoolDown = 3
self.CanUse = true
self.NextUse = CurTime()
if( CLIENT )then return end
util.AddNetworkString( 'open_bail_menu' )
end
if( SERVER )then AddCSLuaFile() end | 16.518519 | 42 | 0.710762 |
27245a00da453cb1099bd92712e33086e36a9ef1 | 4,840 | css | CSS | public/css/style.css | IlincaM/Beauty | eddac7621655fe029b87a3749d765bd2381b0de9 | [
"MIT"
] | null | null | null | public/css/style.css | IlincaM/Beauty | eddac7621655fe029b87a3749d765bd2381b0de9 | [
"MIT"
] | null | null | null | public/css/style.css | IlincaM/Beauty | eddac7621655fe029b87a3749d765bd2381b0de9 | [
"MIT"
] | null | null | null | html{
height:100%;
min-height:100%;
}
/*!
* Start Bootstrap - The Big Picture (http://startbootstrap.com/)
* Copyright 2013-2016 Start Bootstrap
* Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap/blob/gh-pages/LICENSE)
*/
body {
background: url(../images/bk.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
.img{
max-width: 100%;
max-height: 100%;
}
.full {
background: url(../images/bk.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
.forImg{
width: 30%;
}
.titlePage {
text-align: center;
font: 200 50px/1.3 'Great Vibes', Helvetica, sans-serif;
color: HSL(347, 65%, 23.5%);
text-shadow: 4px 4px 3px rgba(0,0,0,0.1);
}
.titlePagePost {
text-align: center;
font: 200 50px/1.3 'Great Vibes', Helvetica, sans-serif;
color: white;
text-shadow: 4px 4px 3px rgba(0,0,0,0.1);
}
.articles{
height: 235px;
color: #000;
line-height: 1.25em;
text-align: justify;
text-indent: 2.5em;
background:hsla(347, 65%, 24%, 0.44);
}
.articlesImg{
max-height: 235px;
color: #000;
line-height: 1.25em;
text-align: justify;
text-indent: 2.5em;
background:hsla(347, 65%, 24%, 0.44);
}
.allPost{
background: hsla(347, 65%, 24%, 0.44);
}
.row{
margin-left: 0px;
margin-right: 0px;
}
.h2centre{
text-align:center;
}
.pArticleBody{
color: beige;
font-size: 1.1em;
line-height: 1.3em;
text-align: justify;
text-indent: 2.5em;
background: hsla(347, 65%, 24%, 0.44);
border: #aad4e5 0px;
}
.pArticleBodyIndex{
top: 20px;
color: beige;
font-size: 1em;
line-height: 1.25em;
text-align: justify;
min-height:187px;
text-indent: 2.5em;
background: hsla(347, 65%, 24%, 0.44);
border: #aad4e5 0px;
}
.pArticleBodyImg{
color: beige;
font-size: 1em;
line-height: 1.25em;
text-align: justify;
text-indent: 2.5em;
background: hsla(347, 65%, 24%, 0.44);
border: #aad4e5 0px;
}
.alignImg{
text-align: center;
background: hsla(347, 65%, 24%, 0.44);
}
.subtitle{
text-align: center;
font: 200 50px/1.3 'Great Vibes', Helvetica, sans-serif;
color: #C0C0C0;
text-shadow: 4px 4px 3px rgba(0,0,0,0.1);
}
.blog{
text-align: center;
font-size: 21px;
color:white;
text-shadow: 4px 4px 3px rgba(0,0,0,0.1);
padding-top: 64px;
}
.navbar-inverse .navbar-nav>li>a{
color:white;
}
/*.dropdown{
margin-top: 15px;
}*/
.me{
margin-left: 15px;
/* text-transform: uppercase;*/
/* text-shadow: 1px 1px 1px #000;*/
color: #fff;
font-size: 24px;
float: left;
border-bottom:1px solid rgba(221, 221, 221, 0);
margin-left: 0px;
margin-top: 0px;
width: 170px;
/*height: 85px;*/
z-index: 12;
background: transparent url(../images/overlay.png) no-repeat bottom right;
-moz-box-shadow: 0px 0px 2px #000 inset;
-webkit-box-shadow: 0px 0px 2px #000 inset;
box-shadow: 0px 0px 2px #000 inset;
}
.labelColor{
color: white;
}
.labelColorOptions{
color: lightpink;
}
.white{
position: relative;
color: white;
}
.btn-color{
background: HSL(347, 65%, 23.5%);
}
.btn-h1-spacing{
margin-top: 18px;
}
.form-spacing-top{
margin-top: 30px;
}
.background-wrap {
position: fixed;
z-index: -1000;
width: 100%;
height: 100%;
overflow: hidden;
top: 0;
left: 0;
}
#video-bg-elem {
position: absolute;
top: 0;
left: 0;
min-width: 100%;
min-height: 100%;
}
.video-bg-elem1 {
position: fixed;
top: 0;
left: 0;
min-width: 110%;
min-height: 100%;
}
.hid {
display: none;
}
.comment {
margin-bottom: 45px;
color: white;
}
.author-image {
width: 50px;
height: 50px;
border-radius: 50%;
float: left;
}
.author-name {
float:left;
margin-left: 15px;
color: white;
}
.author-name>h4 {
margin: 5px 0px;
}
.author-name>p {
font-size: 11px;
font-style: italic;
color: white;
}
.comment-content {
clear: both;
margin-left: 65px;
font-size: 16px;
line-height: 1.3em;
color:white;
}
.comment-count {
margin-bottom: 45px;
color:white;
}
.backend-comments {
margin-top: 50px;
color: white;
}
#a01 {
height: 35px;
}
.wrappers {
padding-bottom: 15px;
margin-bottom: 20px;
background-color: white;
border-radius: 22px;
opacity: 0.8;
}
.wrappersC {
padding: 15px;
margin-bottom: 20px;
background: hsla(347, 65%, 24%, 0.44);
border-radius: 22px;
opacity: 0.8;
} | 16.982456 | 96 | 0.597521 |
4aadc6540b418611a6a6d0ad9f66ff0cc0983222 | 4,473 | kt | Kotlin | app/src/main/java/com/foobarust/deliverer/ui/settings/SettingsFragment.kt | foobar-UST/foobar-deliverer | 99c8b007436a9b192ca83eebff1bcc6aae1c095a | [
"MIT"
] | null | null | null | app/src/main/java/com/foobarust/deliverer/ui/settings/SettingsFragment.kt | foobar-UST/foobar-deliverer | 99c8b007436a9b192ca83eebff1bcc6aae1c095a | [
"MIT"
] | null | null | null | app/src/main/java/com/foobarust/deliverer/ui/settings/SettingsFragment.kt | foobar-UST/foobar-deliverer | 99c8b007436a9b192ca83eebff1bcc6aae1c095a | [
"MIT"
] | 1 | 2021-08-02T19:48:41.000Z | 2021-08-02T19:48:41.000Z | package com.foobarust.deliverer.ui.settings
import android.content.Intent
import android.content.pm.PackageManager
import android.net.Uri
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.core.view.isVisible
import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels
import androidx.fragment.app.viewModels
import androidx.lifecycle.lifecycleScope
import com.foobarust.android.utils.showShortToast
import com.foobarust.deliverer.R
import com.foobarust.deliverer.databinding.FragmentSettingsBinding
import com.foobarust.deliverer.ui.main.MainViewModel
import com.foobarust.deliverer.utils.AutoClearedValue
import com.foobarust.deliverer.utils.applySystemWindowInsetsPadding
import com.foobarust.deliverer.utils.findNavController
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.google.android.material.snackbar.Snackbar
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.launch
import javax.inject.Inject
/**
* Created by kevin on 3/13/21
*/
@AndroidEntryPoint
class SettingsFragment : Fragment(), SettingsAdapter.SettingsAdapterListener {
private var binding: FragmentSettingsBinding by AutoClearedValue(this)
private val mainViewModel: MainViewModel by activityViewModels()
private val settingsViewModel: SettingsViewModel by viewModels()
@Inject
lateinit var packageManager: PackageManager
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View {
binding = FragmentSettingsBinding.inflate(inflater, container, false)
// Set toolbar
binding.appBarLayout.applySystemWindowInsetsPadding(applyTop = true)
// Setup recycler view
val settingsAdapter = SettingsAdapter(this)
binding.settingsRecyclerView.run {
adapter = settingsAdapter
setHasFixedSize(true)
}
viewLifecycleOwner.lifecycleScope.launch {
settingsViewModel.settingsListModels.collect {
settingsAdapter.submitList(it)
}
}
// Ui state
settingsViewModel.settingsUiState.observe(viewLifecycleOwner) {
binding.loadingProgressBar.isVisible = it == SettingsUiState.LOADING
}
// Show snack bar
viewLifecycleOwner.lifecycleScope.launch {
settingsViewModel.snackBarMessage.collect {
showMessageSnackbar(it)
}
}
return binding.root
}
override fun onProfileClicked() {
findNavController(R.id.settingsFragment)?.navigate(
SettingsFragmentDirections.actionSettingsFragmentToProfileFragment()
)
}
override fun onSectionItemClicked(sectionId: String) {
when (sectionId) {
SETTINGS_EMPLOYED_BY -> findNavController(R.id.settingsFragment)?.navigate(
SettingsFragmentDirections.actionSettingsFragmentToSellerMiscFragment()
)
SETTINGS_CONTACT_US -> sendContactUsEmail()
SETTINGS_TERMS_CONDITIONS -> findNavController(R.id.settingsFragment)?.navigate(
SettingsFragmentDirections.actionSettingsFragmentToLicenseFragment()
)
SETTINGS_SIGN_OUT -> showSignOutConfirmDialog()
}
}
private fun showMessageSnackbar(message: String) {
Snackbar.make(binding.coordinatorLayout, message, Snackbar.LENGTH_SHORT).show()
}
private fun sendContactUsEmail() {
val intent = Intent(Intent.ACTION_SENDTO).apply {
data = Uri.parse("mailto:")
putExtra(Intent.EXTRA_EMAIL, arrayOf("kthon@connect.ust.hk"))
}
if (intent.resolveActivity(packageManager) != null) {
startActivity(intent)
} else {
showShortToast(getString(R.string.error_resolve_activity_failed))
}
}
private fun showSignOutConfirmDialog() {
MaterialAlertDialogBuilder(requireContext())
.setTitle(getString(R.string.sign_out_dialog_title))
.setMessage(getString(R.string.sign_out_dialog_message))
.setPositiveButton(android.R.string.ok) { _, _ -> mainViewModel.onUserSignOut() }
.setNegativeButton(android.R.string.cancel) { dialog, _ -> dialog.dismiss() }
.show()
}
} | 35.5 | 93 | 0.713168 |
5c416dd6a8e01cc434989adb0fd6df537e940bd3 | 21 | css | CSS | build/isolation/is-a.min.css | nwmcsween/asm.css | 8036ae5cbdd111c4b3169375ba4e5514d1041413 | [
"MIT"
] | null | null | null | build/isolation/is-a.min.css | nwmcsween/asm.css | 8036ae5cbdd111c4b3169375ba4e5514d1041413 | [
"MIT"
] | 2 | 2016-06-14T05:31:51.000Z | 2016-06-25T02:15:46.000Z | build/isolation/is-a.min.css | nwmcsween/asm.css | 8036ae5cbdd111c4b3169375ba4e5514d1041413 | [
"MIT"
] | 1 | 2016-06-21T09:49:28.000Z | 2016-06-21T09:49:28.000Z | .is-a{isolation:auto} | 21 | 21 | 0.761905 |
75438b608ab0040ba4fd0f38d7601aa421b5dcc0 | 270 | h | C | Example/WJCamera/WJAppDelegate.h | Scorpio-git/WJCamera | 9372256aa8b3dd8cb385589f83c0f0882e9b578e | [
"MIT"
] | 5 | 2019-09-02T01:30:11.000Z | 2021-09-09T12:33:01.000Z | Example/WJCamera/WJAppDelegate.h | dev-wwj/WJCamera | 9372256aa8b3dd8cb385589f83c0f0882e9b578e | [
"MIT"
] | null | null | null | Example/WJCamera/WJAppDelegate.h | dev-wwj/WJCamera | 9372256aa8b3dd8cb385589f83c0f0882e9b578e | [
"MIT"
] | 1 | 2019-08-22T06:33:55.000Z | 2019-08-22T06:33:55.000Z | //
// WJAppDelegate.h
// WJCamera
//
// Created by scorpion on 08/29/2019.
// Copyright (c) 2019 scorpion. All rights reserved.
//
@import UIKit;
@interface WJAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
| 16.875 | 62 | 0.714815 |
6611cb667f41333d39b1395eb440f1d7c9616f37 | 69 | css | CSS | crypto-cars-dapp/src/app/components/home/home.component.css | PeterAsenov22/LimeAcademy | 09231095197dbd52b375eb9a30848bac95d78809 | [
"MIT"
] | 1 | 2019-01-11T15:46:22.000Z | 2019-01-11T15:46:22.000Z | crypto-cars-dapp/src/app/components/home/home.component.css | PeterAsenov22/LimeAcademy | 09231095197dbd52b375eb9a30848bac95d78809 | [
"MIT"
] | null | null | null | crypto-cars-dapp/src/app/components/home/home.component.css | PeterAsenov22/LimeAcademy | 09231095197dbd52b375eb9a30848bac95d78809 | [
"MIT"
] | null | null | null | .cars-table{
margin: 30px;
}
.address-spent{
margin-top: 30px;
} | 9.857143 | 19 | 0.637681 |
5fe7c45f95fbc7304154beaf634d1d54e87df833 | 8,144 | h | C | include/list.h | MAX-EINSTEIN/Crystal | a1e9060f771e1700a161061fb092798a4cf57144 | [
"MIT"
] | null | null | null | include/list.h | MAX-EINSTEIN/Crystal | a1e9060f771e1700a161061fb092798a4cf57144 | [
"MIT"
] | null | null | null | include/list.h | MAX-EINSTEIN/Crystal | a1e9060f771e1700a161061fb092798a4cf57144 | [
"MIT"
] | null | null | null | /*
Copyright (c) 2019, Junaid Siddiqui
Permission to use, copy, modify, and/or distribute this software
for any purpose with or without fee is hereby granted, provided
that the above copyright notice and this permission notice appear
in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/**
* @file list.h
*
* @brief Doubly-linked list.
*
* A doubly-linked list stores a collection of values. Each entry in
* the list (represented by a pointer a @ref ListEntry structure)
* contains a link to the next entry and the previous entry.
* It is therefore possible to iterate over entries in the list in either
* direction.
*
* To create an empty list, create a new variable which is a pointer to
* a @ref List structure, and initialise it to NULL.
* To destroy an entire list, use @ref list_free.
*
* To add a value to a list, use @ref list_push_back or @ref list_push_front.
*
* To remove a value from a list, use @ref list_remove_entry or
* @ref list_remove_data.
*
* To access an entry in the list by index, use @ref list_nth_entry or
* @ref list_nth_data.
*
* To modify data in the list use @ref list_set_data.
*
* To sort a list, use @ref list_sort.
*/
#ifndef LIST_H
#define LIST_H
#include <stdlib.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* A _List struct is used to represent a Doubly-linked list.
* The empty list is represented by a NULL pointer.
* To initialise a new doubly linked list,
* simply create a variable of this type
* containing a pointer to NULL.
*/
typedef struct _List List;
/**
* Represents an entry in a doubly-linked list.
*/
typedef struct _ListEntry ListEntry;
/**
* A value stored in a list.
*/
typedef void *ListValue;
/**
* An iterator used to traverse the list
*/
typedef ListEntry ListIterator;
/**
* A reverse iterator for the list
*/
typedef ListEntry ListReverseIterator;
/**
* Callback function used to compare values in a list when sorting.
*
* @param value1 The first value to compare.
* @param value2 The second value to compare.
* @return A negative value if value1 should be sorted before
* value2, a positive value if value1 should be sorted
* after value2, zero if value1 and value2 are equal.
*/
typedef int (*ListCompareFunc)(ListValue value1, ListValue value2);
/**
* Callback function used to determine of two values in a list are
* equal.
*
* @param value1 The first value to compare.
* @param value2 The second value to compare.
* @return True if value1 and value2 are equal, false
* if they are not equal.
*/
typedef bool (*ListEqualFunc)(ListValue value1, ListValue value2);
/**
* Callback function used to print the data in the list.
*
* @param data Data to print
*/
typedef void (*ListPrintData)(ListValue data);
/**
* Create a new list.
*
* @return Pointer to the new list (List*)
*/
List* list_new();
/**
* Free an entire list.
*
* @param list The list to free.
*/
void list_free(List *list);
/**
* Prepend a value to the start of a list.
*
* @param list Pointer to the list to prepend to.
* @param data The value to prepend.
* @return True if value is appended, otherwise false
*/
bool list_push_front(List *list, ListValue data);
/**
* Append a value to the end of a list.
*
* @param list Pointer to the list to append to.
* @param data The value to append.
* @return True if value is appended, otherwise false
*/
bool list_push_back(List *list, ListValue data);
/**
* Removes a value from the start of a list.
*
* @param list Pointer to the list to remove from.
* @return True if value is removed successfully, otherwise false
*/
bool list_pop_front(List *list);
/**
* Removes a value from the end of a list.
*
* @param list Pointer to the list to remove from.
* @return True if value is removed successfully, otherwise false
*/
bool list_pop_back(List *list);
/**
* Retrieve the entry at a specified index in a list.
*
* @param list The list.
* @param n The index into the list .
* @return The entry at the specified index, or NULL if out of range.
*/
ListEntry *list_nth_entry(List *list, unsigned int n);
/**
* Retrieve the value at a specified entry in the list.
*
* @param entry The entry to retrieve data from
* @return The pointer to data/value, or NULL
*/
ListValue list_data(ListEntry* entry);
/**
* Retrieve the value at a specified index in the list.
*
* @param list The list.
* @param n The index into the list.
* @return The value at the specified index, or @ref LIST_NULL if
* unsuccessful.
*/
ListValue list_nth_data(List *list, unsigned int n);
/**
* Returns the size of a list.
*
* @param list The list.
* @return The number of entries in the list.
*/
size_t list_size(List *list);
/**
* Returns true if the list is empty, false otherwise
*
* @param list The list.
* @return True if list is empty, false otherwise .
*/
bool list_empty(List *list);
/**
* Prints the contents of a list.
*
* @param list The list.
* @param print_data A function to print a particular data
* @return void
*/
void list_print(List *list, ListPrintData print);
/**
* Remove all occurrences of a particular value from a list.
*
* @param list Pointer to the list.
* @param callback Function to invoke to compare values in the list
* with the value to be removed.
* @param data The value to remove from the list.
* @return The number of entries removed from the list.
*/
bool list_remove_data(List *list, ListEqualFunc callback, ListValue data);
/**
* Remove nth entry from a list.
*
* @param list Pointer to the list.
* @param n The position of entry to remove
* @return If the entry is not found in the list, returns false,
* else returns true.
*/
bool list_remove_nth_entry(List* list, size_t n);
/**
* Returns an iterator next to a given iterator
*
* @param itr Pointer to the iterator
* @return Pointer next to the given iterator
*/
ListIterator* list_iter_next(ListIterator * itr);
/**
* Returns a reverse iterator prev to a given reverseiterator
*
* @param itr Pointer to the reverse iterator
* @return Pointer previous to the given reverse iterator
*/
ListReverseIterator * list_rev_prev(ListIterator * itr);
/**
* Returns an iterator to the beginning of the list
*
* @param list Pointer to the list.
*/
ListIterator* list_begin(List *list);
/**
* Returns an iterator to the end of the list
*
* @param list Pointer to the list.
*/
ListIterator* list_end(List *list);
/**
* Returns an reverse iterator to the beginning of the list (end)
*
* @param list Pointer to the list.
*/
ListReverseIterator* list_rbegin(List *list);
/**
* Returns an reverse iterator to the end of the list (beginnning)
*
* @param list Pointer to the list.
*/
ListReverseIterator* list_rend(List *list);
#ifdef __cplusplus
}
#endif
#endif // LIST_H ends | 25.853968 | 80 | 0.638261 |
bb7974137efae482fa229bfc9e1a4cb1c1a26cc0 | 3,637 | rs | Rust | src/public/status.rs | teketekere/gmo-coin-rs | 1dc9625d832c34163a395bd6aa148ffcdb7f1751 | [
"MIT"
] | 2 | 2021-06-16T23:45:49.000Z | 2022-02-03T07:48:02.000Z | src/public/status.rs | teketekere/gmo-coin-rs | 1dc9625d832c34163a395bd6aa148ffcdb7f1751 | [
"MIT"
] | null | null | null | src/public/status.rs | teketekere/gmo-coin-rs | 1dc9625d832c34163a395bd6aa148ffcdb7f1751 | [
"MIT"
] | null | null | null | //! 取引所ステータスAPIを実装する。
use crate::end_point::*;
use crate::error::Error;
use crate::headers::Headers;
use crate::http_client::*;
use crate::json::*;
use crate::response::*;
use chrono::{DateTime, Utc};
use serde::Deserialize;
/// 取引所ステータスAPIのパス。
const STATUS_API_PATH: &str = "/v1/status";
/// 取引所ステータス OPEN。
const EXCHANGE_STATUS_OPEN: &str = "OPEN";
/// 取引所ステータス PREOPEN。
const EXCHANGE_STATUS_PREOPEN: &str = "PREOPEN";
/// 取引所ステータス MAINTENANCE。
const EXCHANGE_STATUS_MAINTENANCE: &str = "MAINTENANCE";
/// 取引所ステータスAPIから返ってくるレスポンスのうち`data`の部分を格納する構造体。
#[derive(Deserialize)]
pub struct Data {
/// 取引所ステータス。
pub status: String,
}
/// 取引所ステータスAPIから返ってくるレスポンスを格納する構造体。
#[derive(Deserialize)]
pub struct Status {
/// ステータスコード。
pub status: i16,
/// APIが呼び出された時間。
#[serde(deserialize_with = "gmo_timestamp_to_chrono_timestamp")]
pub responsetime: DateTime<Utc>,
/// レスポンスの`data`の部分。
pub data: Data,
}
impl RestResponse<Status> {
/// 取引所が開いているか?
pub fn is_open(&self) -> bool {
self.body.data.status == EXCHANGE_STATUS_OPEN
}
/// 取引所がプレオープン中か?
/// プレオープンは定時メンテナンスの前後30分の間。
pub fn is_pre_open(&self) -> bool {
self.body.data.status == EXCHANGE_STATUS_PREOPEN
}
/// 取引所がメンテナンス中か?
/// 定時メンテナンスは日本時間で毎週水曜15:00 - 16:00。
pub fn is_maintenance(&self) -> bool {
self.body.data.status == EXCHANGE_STATUS_MAINTENANCE
}
/// 取引所のステータスを返す。
pub fn status(&self) -> &String {
&self.body.data.status
}
}
/// 取引所ステータスAPIを呼び出す。
pub async fn request_status(http_client: &impl HttpClient) -> Result<RestResponse<Status>, Error> {
let url = format!("{}{}", PUBLIC_ENDPOINT, STATUS_API_PATH,);
let headers = Headers::create_empty_headers();
let response = http_client.get(url, &headers).await?;
parse_from_http_response::<Status>(&response)
}
#[cfg(test)]
mod tests {
use crate::http_client::tests::InmemClient;
use crate::public::status::*;
use chrono::SecondsFormat;
const STATUS_RESPONSE_SAMPLE: &str = r#"{
"status": 0,
"data": {
"status": "OPEN"
},
"responsetime": "2019-03-19T02:15:06.001Z"
}"#;
#[tokio::test]
async fn test_status() {
let body = STATUS_RESPONSE_SAMPLE;
let http_client = InmemClient {
http_status_code: 200,
body_text: body.to_string(),
return_error: false,
};
let resp = request_status(&http_client).await.unwrap();
assert_eq!(resp.http_status_code, 200);
assert_eq!(resp.body.status, 0);
assert_eq!(
resp.body
.responsetime
.to_rfc3339_opts(SecondsFormat::Millis, true),
"2019-03-19T02:15:06.001Z"
);
assert_eq!(resp.status(), "OPEN");
assert_eq!(resp.is_open(), true);
}
#[tokio::test]
async fn test_status_when_body_cannot_be_parsed() {
let body = "json parse dekinaiyo";
let http_client = InmemClient {
http_status_code: 200,
body_text: body.to_string(),
return_error: false,
};
let resp = request_status(&http_client).await;
assert_eq!(resp.is_err(), true);
}
#[tokio::test]
async fn test_status_when_inner_error_happens() {
let body = STATUS_RESPONSE_SAMPLE;
let http_client = InmemClient {
http_status_code: 200,
body_text: body.to_string(),
return_error: true,
};
let resp = request_status(&http_client).await;
assert_eq!(resp.is_err(), true);
}
}
| 26.742647 | 99 | 0.619192 |
0c7de1d97913a4091e354725bc2562a43f7d9e56 | 14,825 | py | Python | pinochle/Game.py | Atrus619/DeckOfCards | bf0668ea26041e7faab2b88a03d42ba6887d054a | [
"MIT"
] | 1 | 2019-06-27T12:14:38.000Z | 2019-06-27T12:14:38.000Z | pinochle/Game.py | Atrus619/DeckOfCards | bf0668ea26041e7faab2b88a03d42ba6887d054a | [
"MIT"
] | 18 | 2019-07-14T17:40:22.000Z | 2019-11-11T01:54:07.000Z | pinochle/Game.py | Atrus619/DeckOfCards | bf0668ea26041e7faab2b88a03d42ba6887d054a | [
"MIT"
] | null | null | null | from pinochle.State import State
from classes.Deck import Deck
from classes.Hand import Hand
from pinochle.MeldUtil import MeldUtil
from pinochle.Meld import Meld
from pinochle.Trick import Trick
from pinochle.MeldTuple import MeldTuple
from util.Constants import Constants as cs
from util.util import print_divider
from copy import deepcopy
import random
import numpy as np
import util.state_logger as sl
import logging
from config import Config as cfg
import pinochle.card_util as cu
import time
import pandas as pd
from util.Vectors import Vectors as vs
logging.basicConfig(format='%(levelname)s:%(message)s', level=cfg.logging_level)
# pinochle rules: https://www.pagat.com/marriage/pin2hand.html
class Game:
def __init__(self, name, players, run_id="42069", current_cycle=None, human_test=False, config=cfg):
# Setting run_id = None results in no records being saved to database
self.run_id = run_id
self.name = name.upper()
self.players = players # This is a list
self.number_of_players = len(self.players)
self.dealer = players[0]
self.trump_card = None
self.trump = None
self.priority = random.randint(0, 1)
self.meld_util = None
self.current_cycle = current_cycle # To determine the current value of epsilon
self.human_test = human_test
self.config = config
self.exp_df = pd.DataFrame(columns=['agent_id', 'opponent_id', 'run_id', 'vector', 'action', 'next_vector',
'reward', 'meld_action'])
self.last_meld_state = None
if self.name == cs.PINOCHLE:
self.deck = Deck("pinochle")
else:
self.deck = Deck()
self.hands = {}
self.melds = {}
self.scores = {}
self.meldedCards = {}
self.discard_pile = Hand()
self.player_inter_trick_history = {} # One entry per player, each entry is a tuple containing (prior_state, row_id entry in initial db update)
for player in self.players:
self.hands[player] = Hand()
self.melds[player] = Meld()
self.scores[player] = [0]
self.meldedCards[player] = {}
def create_state(self, played_card=None):
return State(self, played_card)
def deal(self):
for i in range(12):
for player in self.players:
self.hands[player].add_cards(self.deck.pull_top_cards(1))
self.trump_card = self.deck.pull_top_cards(1)[0]
self.trump = self.trump_card.suit
self.meld_util = MeldUtil(self.trump)
# Expected card input: VALUE,SUIT. Example: Hindex
# H = hand, M = meld
def collect_trick_cards(self, player, state):
if type(player).__name__ == 'Human':
trick_input = player.get_action(state, msg=player.name + " select card for trick:")
else: # Bot
if self.human_test:
logging.debug("Model hand before action:")
state.convert_to_human_readable_format(player)
trick_index, meld_index = player.get_action(state, self, current_cycle=self.current_cycle, is_trick=True)
trick_input, _ = player.convert_model_output(trick_index=trick_index, meld_index=meld_index, game=self, is_trick=True)
source = trick_input[0]
index = int(trick_input[1:])
if source == "H":
card_input = self.hands[player].cards[index]
card = self.hands[player].pull_card(card_input)
elif source == "M":
mt = self.melds[player].pull_melded_card(self.melds[player].melded_cards[index])
card = mt.card
print_divider()
logging.debug("Player " + player.name + " plays: " + str(card)) # TODO: Fix this later (possible NULL)
return card
def collect_meld_cards(self, player, state, limit=12):
"""
Collecting cards for meld scoring from player who won trick
:param player: Player we are collecting from
:param state: Current state of game
:param limit: Maximum number of cards that can be collected
:return: list of MeldTuples and whether the interaction was valid (boolean)
"""
first_hand_card = True
valid = True
original_hand_cards = deepcopy(self.hands[player])
original_meld_cards = deepcopy(self.melds[player])
collected_hand_cards = []
collected_meld_cards = []
score = 0
meld_class = None
combo_name = None
if type(player).__name__ == 'Human':
while len(collected_hand_cards) + len(collected_meld_cards) < limit:
if first_hand_card:
print_divider()
logging.debug("For meld please select first card from hand.")
user_input = player.get_action(state, msg=player.name + " select card, type 'Y' to exit:")
if user_input == 'Y':
break
source = user_input[0]
index = int(user_input[1:])
if first_hand_card:
if source != "H":
print_divider()
logging.debug("In case of meld, please select first card from hand.")
continue
first_hand_card = False
if source == "H":
card_input = self.hands[player].cards[index]
card = self.hands[player].pull_card(card_input)
collected_hand_cards.append(card)
elif source == "M":
mt = self.melds[player].pull_melded_card(self.melds[player].melded_cards[index])
collected_meld_cards.append(mt)
# Combine collected hand and meld card lists for score calculation
collected_cards = collected_hand_cards + [mt.card for mt in collected_meld_cards]
if len(collected_cards) > 0:
score, meld_class, combo_name = self.meld_util.calculate_score(collected_cards)
if score == 0:
valid = False
else:
for mt in collected_meld_cards:
original_meld_class = mt.meld_class
if original_meld_class == meld_class:
original_meld_score = mt.score
if original_meld_score <= score:
valid = False
break
if not valid:
self.hands[player] = original_hand_cards
self.melds[player] = original_meld_cards
else: # Bot
valid = True
trick_action, meld_action = player.get_action(state, self, current_cycle=self.current_cycle, is_trick=False)
if meld_action == vs.MELD_COMBINATIONS_ONE_HOT_VECTOR.__len__():
# model chose to pass melding
return [], valid
score, meld_class, combo_name, collected_cards = \
player.convert_model_output(trick_index=trick_action, meld_index=meld_action, game=self, is_trick=False)
return [MeldTuple(card, combo_name, meld_class, score) for card in collected_cards], valid
def play_trick(self):
"""
priority: 0 or 1 for index in player list
:return: index of winner (priority for next trick)
"""
print_divider()
logging.debug(f'Phase 1\tTrick #{12 - len(self.deck)//2}\t{len(self.deck)} card{"s" if len(self.deck) > 1 else ""} remaining in deck')
trick_start_state = self.create_state()
trick = Trick(self.players, self.trump)
# Determine which player goes first based on priority arg
""" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# TRICK PLAYER LIST IS NOT ALWAYS THE SAME AS THE GAME PLAYER LIST
# THEY COULD BE IN DIFFERENT ORDER
"""
player_order = list(self.players)
player_1 = player_order.pop(self.priority)
player_2 = player_order[0]
trick_player_list = [player_1, player_2]
# Collect card for trick from each player based on order
card_1 = self.collect_trick_cards(player_1, trick_start_state) # Collect card from first player based on priority
if self.human_test:
time.sleep(cfg.human_test_pause_length)
# Recording the first card that was played
first_move_state = self.create_state(card_1)
if self.human_test and 'get_Qs' in dir(self.players[0].model):
print_divider()
bot_state = trick_start_state if self.players[0] == player_1 else first_move_state
human_state = trick_start_state if self.players[1] == player_1 else first_move_state
logging.debug(self.players[0].model.get_Qs(player=self.players[0], player_state=bot_state, opponent=self.players[1], opponent_state=human_state))
if self.players[0] in self.player_inter_trick_history and self.run_id is not None: # Don't update on first trick of game
p1_update_dict = {'player': player_1, 'state_1': self.player_inter_trick_history[player_1][0],
'state_2': trick_start_state, 'row_id': self.player_inter_trick_history[player_1][1]}
p2_update_dict = {'player': player_2, 'state_1': self.player_inter_trick_history[player_2][0],
'state_2': first_move_state, 'row_id': self.player_inter_trick_history[player_2][1]}
self.exp_df = sl.update_state(df=self.exp_df, p1=p1_update_dict, p2=p2_update_dict, win_reward=self.config.win_reward)
card_2 = self.collect_trick_cards(player_2, first_move_state) # Collect card from second player based on priority
if self.human_test:
time.sleep(cfg.human_test_pause_length)
print_divider()
logging.debug("LETS GET READY TO RUMBLE!!!!!!!!!!!!!!!!!!!!!!!")
logging.debug("Card 1: " + str(card_1))
logging.debug("Card 2: " + str(card_2))
if self.human_test:
time.sleep(cfg.human_test_pause_length)
# Determine winner of trick based on collected cards
result = cu.compare_cards(self.trump, card_1, card_2)
print_divider()
logging.debug("VICTOR : " + str(player_1.name if result == 0 else player_2.name))
if self.human_test:
time.sleep(cfg.human_test_pause_length)
# Separate winner and loser for scoring, melding, and next hand
winner = trick_player_list.pop(result)
loser = trick_player_list[0]
# Winner draws a card from the stock, followed by the loser drawing a card from the stock
# TODO: Come back here and allow winner to choose when down to last 2 cards (optional af)
self.hands[winner].add_cards(self.deck.pull_top_cards(1))
if len(self.deck) == 0:
self.hands[loser].add_cards(self.trump_card)
else:
self.hands[loser].add_cards(self.deck.pull_top_cards(1))
# Winner can now meld if they so choose
print_divider()
logging.debug(winner.name + " select cards for meld:")
# Verify that meld is valid. If meld is invalid, force the user to retry.
self.last_meld_state = self.create_state()
mt_list = []
# no melding in this version
while 1:
mt_list, valid = self.collect_meld_cards(winner, self.last_meld_state)
if valid:
break
else:
print_divider()
logging.debug("Invalid combination submitted, please try again.")
# Update scores
if len(mt_list) == 0: # No cards melded, so score is 0
meld_score = 0
else:
meld_score = mt_list[0].score # Score is the same for all MeldTuples in mt_list
trick_score = trick.calculate_trick_score(card_1, card_2)
total_score = meld_score + trick_score
self.discard_pile.add_cards([card_1, card_2])
# log states and actions, player order = TRICK ORDER
if self.run_id is not None:
p1_dict = {'player': player_1, 'state': trick_start_state, 'card': card_1}
p2_dict = {'player': player_2, 'state': first_move_state, 'card': card_2}
meld_dict = {'player': winner, 'meld': mt_list}
self.exp_df, self.player_inter_trick_history = \
sl.log_state(df=self.exp_df, p1=p1_dict, p2=p2_dict, meld=meld_dict,
run_id=self.run_id, history=self.player_inter_trick_history)
self.scores[winner].append(self.scores[winner][-1] + total_score)
self.scores[loser].append(self.scores[loser][-1])
# Update winner's meld
for mt in mt_list:
self.melds[winner].add_melded_card(mt)
# set new priority
self.priority = self.players.index(winner)
def play(self):
while len(self.deck) > 0:
self.play_trick()
final_scores = [self.scores[player][-1] for player in self.players]
winner_index = np.argmax(final_scores)
if self.run_id is not None:
# GAME ORDER (because it doesn't matter here)
end_game_state = self.create_state()
p1_update_dict = {'player': self.players[0], 'state_1': self.player_inter_trick_history[self.players[0]][0], 'state_2': end_game_state,
'row_id': self.player_inter_trick_history[self.players[0]][1]}
p2_update_dict = {'player': self.players[1], 'state_1': self.player_inter_trick_history[self.players[1]][0], 'state_2': end_game_state,
'row_id': self.player_inter_trick_history[self.players[1]][1]}
self.exp_df = sl.update_state(df=self.exp_df, p1=p1_update_dict, p2=p2_update_dict, winner=self.players[winner_index], win_reward=self.config.win_reward,
final_trick_winner=self.players[self.priority])
self.exp_df = sl.log_final_meld(df=self.exp_df, meld_state=self.last_meld_state, history=self.player_inter_trick_history,
final_trick_winner=self.players[self.priority], end_game_state=end_game_state, run_id=self.run_id,
winner=self.players[winner_index], win_reward=self.config.win_reward)
print_divider()
logging.debug("Winner: " + str(self.players[winner_index]) + "\tScore: " + str(final_scores[winner_index]))
logging.debug(
"Loser: " + str(self.players[1 - winner_index]) + "\tScore: " + str(final_scores[1 - winner_index]))
return winner_index, None if self.run_id is None else self.exp_df
| 44.924242 | 165 | 0.616256 |
cb3e47da1921d4af6bf49fbcf0afcbea8ba47bc7 | 135 | h | C | cbits/RadosEnv.h | alphaHeavy/leveldb-rados | b486957c8ea5651139723a44d6c76b3b2cc3a825 | [
"BSD-3-Clause"
] | null | null | null | cbits/RadosEnv.h | alphaHeavy/leveldb-rados | b486957c8ea5651139723a44d6c76b3b2cc3a825 | [
"BSD-3-Clause"
] | null | null | null | cbits/RadosEnv.h | alphaHeavy/leveldb-rados | b486957c8ea5651139723a44d6c76b3b2cc3a825 | [
"BSD-3-Clause"
] | null | null | null | #include <leveldb/c.h>
extern "C"
{
extern leveldb_env_t* leveldb_create_rados_env(const char* config_file, const char* pool_name);
}
| 19.285714 | 95 | 0.77037 |
d5d55071c6b7c780d9a177d61c0d44db4bf98f10 | 246 | kt | Kotlin | app/src/main/java/asvid/github/io/roomapp/model/OwnerModel.kt | asvid/RoomApp | ef7c437325e44500d927bbe825f296805139f6b5 | [
"MIT"
] | null | null | null | app/src/main/java/asvid/github/io/roomapp/model/OwnerModel.kt | asvid/RoomApp | ef7c437325e44500d927bbe825f296805139f6b5 | [
"MIT"
] | null | null | null | app/src/main/java/asvid/github/io/roomapp/model/OwnerModel.kt | asvid/RoomApp | ef7c437325e44500d927bbe825f296805139f6b5 | [
"MIT"
] | null | null | null | package asvid.github.io.roomapp.model
data class OwnerModel(
val login: String,
var id: Long? = null
)
data class OwnerWithGistsModel(
var login: String,
var id: Long? = null,
var gists: List<GistModel>
) | 20.5 | 37 | 0.626016 |
012c4177089d0b1ab2b57d73327bd7f1cb6fdea6 | 83 | sql | SQL | ViewPolicies.sql | treebat1/SQLSecurity | 0620ba6e52d6cf8efffca3c1de3c4d2b16dd49de | [
"MIT"
] | null | null | null | ViewPolicies.sql | treebat1/SQLSecurity | 0620ba6e52d6cf8efffca3c1de3c4d2b16dd49de | [
"MIT"
] | null | null | null | ViewPolicies.sql | treebat1/SQLSecurity | 0620ba6e52d6cf8efffca3c1de3c4d2b16dd49de | [
"MIT"
] | null | null | null | SELECT *
FROM msdb..syspolicy_management_facets
WHERE execution_mode % 2 = 1; | 27.666667 | 41 | 0.746988 |
ad2bf60836d9768e0913589cd0394787c0dc6fab | 701,540 | rs | Rust | sdk/clouddirectory/src/error.rs | jdisanti/aws-sdk-rust | 85cf3154ab5105a88710e8f0b923a81aa1ab5ea2 | [
"Apache-2.0"
] | 1 | 2022-03-02T02:19:58.000Z | 2022-03-02T02:19:58.000Z | sdk/clouddirectory/src/error.rs | jdisanti/aws-sdk-rust | 85cf3154ab5105a88710e8f0b923a81aa1ab5ea2 | [
"Apache-2.0"
] | null | null | null | sdk/clouddirectory/src/error.rs | jdisanti/aws-sdk-rust | 85cf3154ab5105a88710e8f0b923a81aa1ab5ea2 | [
"Apache-2.0"
] | null | null | null | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// Error type for the `AddFacetToObject` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct AddFacetToObjectError {
/// Kind of error that occurred.
pub kind: AddFacetToObjectErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `AddFacetToObject` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum AddFacetToObjectErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Operations are only permitted on enabled directories.</p>
DirectoryNotEnabledException(crate::error::DirectoryNotEnabledException),
/// <p>The <a>Facet</a> that you provided was not well formed or could not be
/// validated with the schema.</p>
FacetValidationException(crate::error::FacetValidationException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for AddFacetToObjectError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
AddFacetToObjectErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
AddFacetToObjectErrorKind::DirectoryNotEnabledException(_inner) => _inner.fmt(f),
AddFacetToObjectErrorKind::FacetValidationException(_inner) => _inner.fmt(f),
AddFacetToObjectErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
AddFacetToObjectErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
AddFacetToObjectErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
AddFacetToObjectErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
AddFacetToObjectErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
AddFacetToObjectErrorKind::ValidationException(_inner) => _inner.fmt(f),
AddFacetToObjectErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for AddFacetToObjectError {
fn code(&self) -> Option<&str> {
AddFacetToObjectError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl AddFacetToObjectError {
/// Creates a new `AddFacetToObjectError`.
pub fn new(kind: AddFacetToObjectErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `AddFacetToObjectError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: AddFacetToObjectErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `AddFacetToObjectError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: AddFacetToObjectErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `AddFacetToObjectErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
AddFacetToObjectErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `AddFacetToObjectErrorKind::DirectoryNotEnabledException`.
pub fn is_directory_not_enabled_exception(&self) -> bool {
matches!(
&self.kind,
AddFacetToObjectErrorKind::DirectoryNotEnabledException(_)
)
}
/// Returns `true` if the error kind is `AddFacetToObjectErrorKind::FacetValidationException`.
pub fn is_facet_validation_exception(&self) -> bool {
matches!(
&self.kind,
AddFacetToObjectErrorKind::FacetValidationException(_)
)
}
/// Returns `true` if the error kind is `AddFacetToObjectErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
AddFacetToObjectErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `AddFacetToObjectErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(
&self.kind,
AddFacetToObjectErrorKind::InvalidArnException(_)
)
}
/// Returns `true` if the error kind is `AddFacetToObjectErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
AddFacetToObjectErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `AddFacetToObjectErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
AddFacetToObjectErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `AddFacetToObjectErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
AddFacetToObjectErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `AddFacetToObjectErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
AddFacetToObjectErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for AddFacetToObjectError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
AddFacetToObjectErrorKind::AccessDeniedException(_inner) => Some(_inner),
AddFacetToObjectErrorKind::DirectoryNotEnabledException(_inner) => Some(_inner),
AddFacetToObjectErrorKind::FacetValidationException(_inner) => Some(_inner),
AddFacetToObjectErrorKind::InternalServiceException(_inner) => Some(_inner),
AddFacetToObjectErrorKind::InvalidArnException(_inner) => Some(_inner),
AddFacetToObjectErrorKind::LimitExceededException(_inner) => Some(_inner),
AddFacetToObjectErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
AddFacetToObjectErrorKind::RetryableConflictException(_inner) => Some(_inner),
AddFacetToObjectErrorKind::ValidationException(_inner) => Some(_inner),
AddFacetToObjectErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `ApplySchema` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ApplySchemaError {
/// Kind of error that occurred.
pub kind: ApplySchemaErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `ApplySchema` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ApplySchemaErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that an attempt to make an attachment was invalid. For example, attaching two nodes
/// with a link type that is not applicable to the nodes or attempting to apply a schema to a directory a second time.</p>
InvalidAttachmentException(crate::error::InvalidAttachmentException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that a schema could not be created due to a naming conflict. Please select a
/// different name and then try again.</p>
SchemaAlreadyExistsException(crate::error::SchemaAlreadyExistsException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for ApplySchemaError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ApplySchemaErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
ApplySchemaErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
ApplySchemaErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
ApplySchemaErrorKind::InvalidAttachmentException(_inner) => _inner.fmt(f),
ApplySchemaErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
ApplySchemaErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
ApplySchemaErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
ApplySchemaErrorKind::SchemaAlreadyExistsException(_inner) => _inner.fmt(f),
ApplySchemaErrorKind::ValidationException(_inner) => _inner.fmt(f),
ApplySchemaErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ApplySchemaError {
fn code(&self) -> Option<&str> {
ApplySchemaError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl ApplySchemaError {
/// Creates a new `ApplySchemaError`.
pub fn new(kind: ApplySchemaErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `ApplySchemaError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: ApplySchemaErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `ApplySchemaError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ApplySchemaErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `ApplySchemaErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(&self.kind, ApplySchemaErrorKind::AccessDeniedException(_))
}
/// Returns `true` if the error kind is `ApplySchemaErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
ApplySchemaErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `ApplySchemaErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(&self.kind, ApplySchemaErrorKind::InvalidArnException(_))
}
/// Returns `true` if the error kind is `ApplySchemaErrorKind::InvalidAttachmentException`.
pub fn is_invalid_attachment_exception(&self) -> bool {
matches!(
&self.kind,
ApplySchemaErrorKind::InvalidAttachmentException(_)
)
}
/// Returns `true` if the error kind is `ApplySchemaErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(&self.kind, ApplySchemaErrorKind::LimitExceededException(_))
}
/// Returns `true` if the error kind is `ApplySchemaErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
ApplySchemaErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `ApplySchemaErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
ApplySchemaErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `ApplySchemaErrorKind::SchemaAlreadyExistsException`.
pub fn is_schema_already_exists_exception(&self) -> bool {
matches!(
&self.kind,
ApplySchemaErrorKind::SchemaAlreadyExistsException(_)
)
}
/// Returns `true` if the error kind is `ApplySchemaErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, ApplySchemaErrorKind::ValidationException(_))
}
}
impl std::error::Error for ApplySchemaError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ApplySchemaErrorKind::AccessDeniedException(_inner) => Some(_inner),
ApplySchemaErrorKind::InternalServiceException(_inner) => Some(_inner),
ApplySchemaErrorKind::InvalidArnException(_inner) => Some(_inner),
ApplySchemaErrorKind::InvalidAttachmentException(_inner) => Some(_inner),
ApplySchemaErrorKind::LimitExceededException(_inner) => Some(_inner),
ApplySchemaErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
ApplySchemaErrorKind::RetryableConflictException(_inner) => Some(_inner),
ApplySchemaErrorKind::SchemaAlreadyExistsException(_inner) => Some(_inner),
ApplySchemaErrorKind::ValidationException(_inner) => Some(_inner),
ApplySchemaErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `AttachObject` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct AttachObjectError {
/// Kind of error that occurred.
pub kind: AttachObjectErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `AttachObject` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum AttachObjectErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Operations are only permitted on enabled directories.</p>
DirectoryNotEnabledException(crate::error::DirectoryNotEnabledException),
/// <p>The <a>Facet</a> that you provided was not well formed or could not be
/// validated with the schema.</p>
FacetValidationException(crate::error::FacetValidationException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that an attempt to make an attachment was invalid. For example, attaching two nodes
/// with a link type that is not applicable to the nodes or attempting to apply a schema to a directory a second time.</p>
InvalidAttachmentException(crate::error::InvalidAttachmentException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>Indicates that a link could not be created due to a naming conflict. Choose a different
/// name and then try again.</p>
LinkNameAlreadyInUseException(crate::error::LinkNameAlreadyInUseException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for AttachObjectError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
AttachObjectErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
AttachObjectErrorKind::DirectoryNotEnabledException(_inner) => _inner.fmt(f),
AttachObjectErrorKind::FacetValidationException(_inner) => _inner.fmt(f),
AttachObjectErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
AttachObjectErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
AttachObjectErrorKind::InvalidAttachmentException(_inner) => _inner.fmt(f),
AttachObjectErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
AttachObjectErrorKind::LinkNameAlreadyInUseException(_inner) => _inner.fmt(f),
AttachObjectErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
AttachObjectErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
AttachObjectErrorKind::ValidationException(_inner) => _inner.fmt(f),
AttachObjectErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for AttachObjectError {
fn code(&self) -> Option<&str> {
AttachObjectError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl AttachObjectError {
/// Creates a new `AttachObjectError`.
pub fn new(kind: AttachObjectErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `AttachObjectError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: AttachObjectErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `AttachObjectError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: AttachObjectErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `AttachObjectErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(&self.kind, AttachObjectErrorKind::AccessDeniedException(_))
}
/// Returns `true` if the error kind is `AttachObjectErrorKind::DirectoryNotEnabledException`.
pub fn is_directory_not_enabled_exception(&self) -> bool {
matches!(
&self.kind,
AttachObjectErrorKind::DirectoryNotEnabledException(_)
)
}
/// Returns `true` if the error kind is `AttachObjectErrorKind::FacetValidationException`.
pub fn is_facet_validation_exception(&self) -> bool {
matches!(
&self.kind,
AttachObjectErrorKind::FacetValidationException(_)
)
}
/// Returns `true` if the error kind is `AttachObjectErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
AttachObjectErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `AttachObjectErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(&self.kind, AttachObjectErrorKind::InvalidArnException(_))
}
/// Returns `true` if the error kind is `AttachObjectErrorKind::InvalidAttachmentException`.
pub fn is_invalid_attachment_exception(&self) -> bool {
matches!(
&self.kind,
AttachObjectErrorKind::InvalidAttachmentException(_)
)
}
/// Returns `true` if the error kind is `AttachObjectErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(&self.kind, AttachObjectErrorKind::LimitExceededException(_))
}
/// Returns `true` if the error kind is `AttachObjectErrorKind::LinkNameAlreadyInUseException`.
pub fn is_link_name_already_in_use_exception(&self) -> bool {
matches!(
&self.kind,
AttachObjectErrorKind::LinkNameAlreadyInUseException(_)
)
}
/// Returns `true` if the error kind is `AttachObjectErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
AttachObjectErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `AttachObjectErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
AttachObjectErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `AttachObjectErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, AttachObjectErrorKind::ValidationException(_))
}
}
impl std::error::Error for AttachObjectError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
AttachObjectErrorKind::AccessDeniedException(_inner) => Some(_inner),
AttachObjectErrorKind::DirectoryNotEnabledException(_inner) => Some(_inner),
AttachObjectErrorKind::FacetValidationException(_inner) => Some(_inner),
AttachObjectErrorKind::InternalServiceException(_inner) => Some(_inner),
AttachObjectErrorKind::InvalidArnException(_inner) => Some(_inner),
AttachObjectErrorKind::InvalidAttachmentException(_inner) => Some(_inner),
AttachObjectErrorKind::LimitExceededException(_inner) => Some(_inner),
AttachObjectErrorKind::LinkNameAlreadyInUseException(_inner) => Some(_inner),
AttachObjectErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
AttachObjectErrorKind::RetryableConflictException(_inner) => Some(_inner),
AttachObjectErrorKind::ValidationException(_inner) => Some(_inner),
AttachObjectErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `AttachPolicy` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct AttachPolicyError {
/// Kind of error that occurred.
pub kind: AttachPolicyErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `AttachPolicy` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum AttachPolicyErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Operations are only permitted on enabled directories.</p>
DirectoryNotEnabledException(crate::error::DirectoryNotEnabledException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>Indicates that the requested operation can only operate on policy objects.</p>
NotPolicyException(crate::error::NotPolicyException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for AttachPolicyError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
AttachPolicyErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
AttachPolicyErrorKind::DirectoryNotEnabledException(_inner) => _inner.fmt(f),
AttachPolicyErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
AttachPolicyErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
AttachPolicyErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
AttachPolicyErrorKind::NotPolicyException(_inner) => _inner.fmt(f),
AttachPolicyErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
AttachPolicyErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
AttachPolicyErrorKind::ValidationException(_inner) => _inner.fmt(f),
AttachPolicyErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for AttachPolicyError {
fn code(&self) -> Option<&str> {
AttachPolicyError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl AttachPolicyError {
/// Creates a new `AttachPolicyError`.
pub fn new(kind: AttachPolicyErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `AttachPolicyError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: AttachPolicyErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `AttachPolicyError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: AttachPolicyErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `AttachPolicyErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(&self.kind, AttachPolicyErrorKind::AccessDeniedException(_))
}
/// Returns `true` if the error kind is `AttachPolicyErrorKind::DirectoryNotEnabledException`.
pub fn is_directory_not_enabled_exception(&self) -> bool {
matches!(
&self.kind,
AttachPolicyErrorKind::DirectoryNotEnabledException(_)
)
}
/// Returns `true` if the error kind is `AttachPolicyErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
AttachPolicyErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `AttachPolicyErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(&self.kind, AttachPolicyErrorKind::InvalidArnException(_))
}
/// Returns `true` if the error kind is `AttachPolicyErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(&self.kind, AttachPolicyErrorKind::LimitExceededException(_))
}
/// Returns `true` if the error kind is `AttachPolicyErrorKind::NotPolicyException`.
pub fn is_not_policy_exception(&self) -> bool {
matches!(&self.kind, AttachPolicyErrorKind::NotPolicyException(_))
}
/// Returns `true` if the error kind is `AttachPolicyErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
AttachPolicyErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `AttachPolicyErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
AttachPolicyErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `AttachPolicyErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, AttachPolicyErrorKind::ValidationException(_))
}
}
impl std::error::Error for AttachPolicyError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
AttachPolicyErrorKind::AccessDeniedException(_inner) => Some(_inner),
AttachPolicyErrorKind::DirectoryNotEnabledException(_inner) => Some(_inner),
AttachPolicyErrorKind::InternalServiceException(_inner) => Some(_inner),
AttachPolicyErrorKind::InvalidArnException(_inner) => Some(_inner),
AttachPolicyErrorKind::LimitExceededException(_inner) => Some(_inner),
AttachPolicyErrorKind::NotPolicyException(_inner) => Some(_inner),
AttachPolicyErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
AttachPolicyErrorKind::RetryableConflictException(_inner) => Some(_inner),
AttachPolicyErrorKind::ValidationException(_inner) => Some(_inner),
AttachPolicyErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `AttachToIndex` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct AttachToIndexError {
/// Kind of error that occurred.
pub kind: AttachToIndexErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `AttachToIndex` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum AttachToIndexErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Operations are only permitted on enabled directories.</p>
DirectoryNotEnabledException(crate::error::DirectoryNotEnabledException),
/// <p>An object has been attempted to be attached to an object that does not have the appropriate attribute value.</p>
IndexedAttributeMissingException(crate::error::IndexedAttributeMissingException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that an attempt to make an attachment was invalid. For example, attaching two nodes
/// with a link type that is not applicable to the nodes or attempting to apply a schema to a directory a second time.</p>
InvalidAttachmentException(crate::error::InvalidAttachmentException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>Indicates that a link could not be created due to a naming conflict. Choose a different
/// name and then try again.</p>
LinkNameAlreadyInUseException(crate::error::LinkNameAlreadyInUseException),
/// <p>Indicates that the requested operation can only operate on index objects.</p>
NotIndexException(crate::error::NotIndexException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for AttachToIndexError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
AttachToIndexErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
AttachToIndexErrorKind::DirectoryNotEnabledException(_inner) => _inner.fmt(f),
AttachToIndexErrorKind::IndexedAttributeMissingException(_inner) => _inner.fmt(f),
AttachToIndexErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
AttachToIndexErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
AttachToIndexErrorKind::InvalidAttachmentException(_inner) => _inner.fmt(f),
AttachToIndexErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
AttachToIndexErrorKind::LinkNameAlreadyInUseException(_inner) => _inner.fmt(f),
AttachToIndexErrorKind::NotIndexException(_inner) => _inner.fmt(f),
AttachToIndexErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
AttachToIndexErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
AttachToIndexErrorKind::ValidationException(_inner) => _inner.fmt(f),
AttachToIndexErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for AttachToIndexError {
fn code(&self) -> Option<&str> {
AttachToIndexError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl AttachToIndexError {
/// Creates a new `AttachToIndexError`.
pub fn new(kind: AttachToIndexErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `AttachToIndexError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: AttachToIndexErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `AttachToIndexError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: AttachToIndexErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `AttachToIndexErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(&self.kind, AttachToIndexErrorKind::AccessDeniedException(_))
}
/// Returns `true` if the error kind is `AttachToIndexErrorKind::DirectoryNotEnabledException`.
pub fn is_directory_not_enabled_exception(&self) -> bool {
matches!(
&self.kind,
AttachToIndexErrorKind::DirectoryNotEnabledException(_)
)
}
/// Returns `true` if the error kind is `AttachToIndexErrorKind::IndexedAttributeMissingException`.
pub fn is_indexed_attribute_missing_exception(&self) -> bool {
matches!(
&self.kind,
AttachToIndexErrorKind::IndexedAttributeMissingException(_)
)
}
/// Returns `true` if the error kind is `AttachToIndexErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
AttachToIndexErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `AttachToIndexErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(&self.kind, AttachToIndexErrorKind::InvalidArnException(_))
}
/// Returns `true` if the error kind is `AttachToIndexErrorKind::InvalidAttachmentException`.
pub fn is_invalid_attachment_exception(&self) -> bool {
matches!(
&self.kind,
AttachToIndexErrorKind::InvalidAttachmentException(_)
)
}
/// Returns `true` if the error kind is `AttachToIndexErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
AttachToIndexErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `AttachToIndexErrorKind::LinkNameAlreadyInUseException`.
pub fn is_link_name_already_in_use_exception(&self) -> bool {
matches!(
&self.kind,
AttachToIndexErrorKind::LinkNameAlreadyInUseException(_)
)
}
/// Returns `true` if the error kind is `AttachToIndexErrorKind::NotIndexException`.
pub fn is_not_index_exception(&self) -> bool {
matches!(&self.kind, AttachToIndexErrorKind::NotIndexException(_))
}
/// Returns `true` if the error kind is `AttachToIndexErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
AttachToIndexErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `AttachToIndexErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
AttachToIndexErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `AttachToIndexErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, AttachToIndexErrorKind::ValidationException(_))
}
}
impl std::error::Error for AttachToIndexError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
AttachToIndexErrorKind::AccessDeniedException(_inner) => Some(_inner),
AttachToIndexErrorKind::DirectoryNotEnabledException(_inner) => Some(_inner),
AttachToIndexErrorKind::IndexedAttributeMissingException(_inner) => Some(_inner),
AttachToIndexErrorKind::InternalServiceException(_inner) => Some(_inner),
AttachToIndexErrorKind::InvalidArnException(_inner) => Some(_inner),
AttachToIndexErrorKind::InvalidAttachmentException(_inner) => Some(_inner),
AttachToIndexErrorKind::LimitExceededException(_inner) => Some(_inner),
AttachToIndexErrorKind::LinkNameAlreadyInUseException(_inner) => Some(_inner),
AttachToIndexErrorKind::NotIndexException(_inner) => Some(_inner),
AttachToIndexErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
AttachToIndexErrorKind::RetryableConflictException(_inner) => Some(_inner),
AttachToIndexErrorKind::ValidationException(_inner) => Some(_inner),
AttachToIndexErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `AttachTypedLink` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct AttachTypedLinkError {
/// Kind of error that occurred.
pub kind: AttachTypedLinkErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `AttachTypedLink` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum AttachTypedLinkErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Operations are only permitted on enabled directories.</p>
DirectoryNotEnabledException(crate::error::DirectoryNotEnabledException),
/// <p>The <a>Facet</a> that you provided was not well formed or could not be
/// validated with the schema.</p>
FacetValidationException(crate::error::FacetValidationException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that an attempt to make an attachment was invalid. For example, attaching two nodes
/// with a link type that is not applicable to the nodes or attempting to apply a schema to a directory a second time.</p>
InvalidAttachmentException(crate::error::InvalidAttachmentException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for AttachTypedLinkError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
AttachTypedLinkErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
AttachTypedLinkErrorKind::DirectoryNotEnabledException(_inner) => _inner.fmt(f),
AttachTypedLinkErrorKind::FacetValidationException(_inner) => _inner.fmt(f),
AttachTypedLinkErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
AttachTypedLinkErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
AttachTypedLinkErrorKind::InvalidAttachmentException(_inner) => _inner.fmt(f),
AttachTypedLinkErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
AttachTypedLinkErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
AttachTypedLinkErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
AttachTypedLinkErrorKind::ValidationException(_inner) => _inner.fmt(f),
AttachTypedLinkErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for AttachTypedLinkError {
fn code(&self) -> Option<&str> {
AttachTypedLinkError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl AttachTypedLinkError {
/// Creates a new `AttachTypedLinkError`.
pub fn new(kind: AttachTypedLinkErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `AttachTypedLinkError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: AttachTypedLinkErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `AttachTypedLinkError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: AttachTypedLinkErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `AttachTypedLinkErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
AttachTypedLinkErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `AttachTypedLinkErrorKind::DirectoryNotEnabledException`.
pub fn is_directory_not_enabled_exception(&self) -> bool {
matches!(
&self.kind,
AttachTypedLinkErrorKind::DirectoryNotEnabledException(_)
)
}
/// Returns `true` if the error kind is `AttachTypedLinkErrorKind::FacetValidationException`.
pub fn is_facet_validation_exception(&self) -> bool {
matches!(
&self.kind,
AttachTypedLinkErrorKind::FacetValidationException(_)
)
}
/// Returns `true` if the error kind is `AttachTypedLinkErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
AttachTypedLinkErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `AttachTypedLinkErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(&self.kind, AttachTypedLinkErrorKind::InvalidArnException(_))
}
/// Returns `true` if the error kind is `AttachTypedLinkErrorKind::InvalidAttachmentException`.
pub fn is_invalid_attachment_exception(&self) -> bool {
matches!(
&self.kind,
AttachTypedLinkErrorKind::InvalidAttachmentException(_)
)
}
/// Returns `true` if the error kind is `AttachTypedLinkErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
AttachTypedLinkErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `AttachTypedLinkErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
AttachTypedLinkErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `AttachTypedLinkErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
AttachTypedLinkErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `AttachTypedLinkErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, AttachTypedLinkErrorKind::ValidationException(_))
}
}
impl std::error::Error for AttachTypedLinkError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
AttachTypedLinkErrorKind::AccessDeniedException(_inner) => Some(_inner),
AttachTypedLinkErrorKind::DirectoryNotEnabledException(_inner) => Some(_inner),
AttachTypedLinkErrorKind::FacetValidationException(_inner) => Some(_inner),
AttachTypedLinkErrorKind::InternalServiceException(_inner) => Some(_inner),
AttachTypedLinkErrorKind::InvalidArnException(_inner) => Some(_inner),
AttachTypedLinkErrorKind::InvalidAttachmentException(_inner) => Some(_inner),
AttachTypedLinkErrorKind::LimitExceededException(_inner) => Some(_inner),
AttachTypedLinkErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
AttachTypedLinkErrorKind::RetryableConflictException(_inner) => Some(_inner),
AttachTypedLinkErrorKind::ValidationException(_inner) => Some(_inner),
AttachTypedLinkErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `BatchRead` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct BatchReadError {
/// Kind of error that occurred.
pub kind: BatchReadErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `BatchRead` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum BatchReadErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Operations are only permitted on enabled directories.</p>
DirectoryNotEnabledException(crate::error::DirectoryNotEnabledException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for BatchReadError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
BatchReadErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
BatchReadErrorKind::DirectoryNotEnabledException(_inner) => _inner.fmt(f),
BatchReadErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
BatchReadErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
BatchReadErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
BatchReadErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
BatchReadErrorKind::ValidationException(_inner) => _inner.fmt(f),
BatchReadErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for BatchReadError {
fn code(&self) -> Option<&str> {
BatchReadError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl BatchReadError {
/// Creates a new `BatchReadError`.
pub fn new(kind: BatchReadErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `BatchReadError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: BatchReadErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `BatchReadError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: BatchReadErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `BatchReadErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(&self.kind, BatchReadErrorKind::AccessDeniedException(_))
}
/// Returns `true` if the error kind is `BatchReadErrorKind::DirectoryNotEnabledException`.
pub fn is_directory_not_enabled_exception(&self) -> bool {
matches!(
&self.kind,
BatchReadErrorKind::DirectoryNotEnabledException(_)
)
}
/// Returns `true` if the error kind is `BatchReadErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(&self.kind, BatchReadErrorKind::InternalServiceException(_))
}
/// Returns `true` if the error kind is `BatchReadErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(&self.kind, BatchReadErrorKind::InvalidArnException(_))
}
/// Returns `true` if the error kind is `BatchReadErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(&self.kind, BatchReadErrorKind::LimitExceededException(_))
}
/// Returns `true` if the error kind is `BatchReadErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
BatchReadErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `BatchReadErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, BatchReadErrorKind::ValidationException(_))
}
}
impl std::error::Error for BatchReadError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
BatchReadErrorKind::AccessDeniedException(_inner) => Some(_inner),
BatchReadErrorKind::DirectoryNotEnabledException(_inner) => Some(_inner),
BatchReadErrorKind::InternalServiceException(_inner) => Some(_inner),
BatchReadErrorKind::InvalidArnException(_inner) => Some(_inner),
BatchReadErrorKind::LimitExceededException(_inner) => Some(_inner),
BatchReadErrorKind::RetryableConflictException(_inner) => Some(_inner),
BatchReadErrorKind::ValidationException(_inner) => Some(_inner),
BatchReadErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `BatchWrite` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct BatchWriteError {
/// Kind of error that occurred.
pub kind: BatchWriteErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `BatchWrite` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum BatchWriteErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>A <code>BatchWrite</code> exception has occurred.</p>
BatchWriteException(crate::error::BatchWriteException),
/// <p>Operations are only permitted on enabled directories.</p>
DirectoryNotEnabledException(crate::error::DirectoryNotEnabledException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for BatchWriteError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
BatchWriteErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
BatchWriteErrorKind::BatchWriteException(_inner) => _inner.fmt(f),
BatchWriteErrorKind::DirectoryNotEnabledException(_inner) => _inner.fmt(f),
BatchWriteErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
BatchWriteErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
BatchWriteErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
BatchWriteErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
BatchWriteErrorKind::ValidationException(_inner) => _inner.fmt(f),
BatchWriteErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for BatchWriteError {
fn code(&self) -> Option<&str> {
BatchWriteError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl BatchWriteError {
/// Creates a new `BatchWriteError`.
pub fn new(kind: BatchWriteErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `BatchWriteError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: BatchWriteErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `BatchWriteError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: BatchWriteErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `BatchWriteErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(&self.kind, BatchWriteErrorKind::AccessDeniedException(_))
}
/// Returns `true` if the error kind is `BatchWriteErrorKind::BatchWriteException`.
pub fn is_batch_write_exception(&self) -> bool {
matches!(&self.kind, BatchWriteErrorKind::BatchWriteException(_))
}
/// Returns `true` if the error kind is `BatchWriteErrorKind::DirectoryNotEnabledException`.
pub fn is_directory_not_enabled_exception(&self) -> bool {
matches!(
&self.kind,
BatchWriteErrorKind::DirectoryNotEnabledException(_)
)
}
/// Returns `true` if the error kind is `BatchWriteErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(&self.kind, BatchWriteErrorKind::InternalServiceException(_))
}
/// Returns `true` if the error kind is `BatchWriteErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(&self.kind, BatchWriteErrorKind::InvalidArnException(_))
}
/// Returns `true` if the error kind is `BatchWriteErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(&self.kind, BatchWriteErrorKind::LimitExceededException(_))
}
/// Returns `true` if the error kind is `BatchWriteErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
BatchWriteErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `BatchWriteErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, BatchWriteErrorKind::ValidationException(_))
}
}
impl std::error::Error for BatchWriteError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
BatchWriteErrorKind::AccessDeniedException(_inner) => Some(_inner),
BatchWriteErrorKind::BatchWriteException(_inner) => Some(_inner),
BatchWriteErrorKind::DirectoryNotEnabledException(_inner) => Some(_inner),
BatchWriteErrorKind::InternalServiceException(_inner) => Some(_inner),
BatchWriteErrorKind::InvalidArnException(_inner) => Some(_inner),
BatchWriteErrorKind::LimitExceededException(_inner) => Some(_inner),
BatchWriteErrorKind::RetryableConflictException(_inner) => Some(_inner),
BatchWriteErrorKind::ValidationException(_inner) => Some(_inner),
BatchWriteErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `CreateDirectory` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct CreateDirectoryError {
/// Kind of error that occurred.
pub kind: CreateDirectoryErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `CreateDirectory` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum CreateDirectoryErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Indicates that a <a>Directory</a> could not be created due to a naming
/// conflict. Choose a different name and try again.</p>
DirectoryAlreadyExistsException(crate::error::DirectoryAlreadyExistsException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for CreateDirectoryError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
CreateDirectoryErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
CreateDirectoryErrorKind::DirectoryAlreadyExistsException(_inner) => _inner.fmt(f),
CreateDirectoryErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
CreateDirectoryErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
CreateDirectoryErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
CreateDirectoryErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
CreateDirectoryErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
CreateDirectoryErrorKind::ValidationException(_inner) => _inner.fmt(f),
CreateDirectoryErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for CreateDirectoryError {
fn code(&self) -> Option<&str> {
CreateDirectoryError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl CreateDirectoryError {
/// Creates a new `CreateDirectoryError`.
pub fn new(kind: CreateDirectoryErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `CreateDirectoryError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: CreateDirectoryErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `CreateDirectoryError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: CreateDirectoryErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `CreateDirectoryErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
CreateDirectoryErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `CreateDirectoryErrorKind::DirectoryAlreadyExistsException`.
pub fn is_directory_already_exists_exception(&self) -> bool {
matches!(
&self.kind,
CreateDirectoryErrorKind::DirectoryAlreadyExistsException(_)
)
}
/// Returns `true` if the error kind is `CreateDirectoryErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
CreateDirectoryErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `CreateDirectoryErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(&self.kind, CreateDirectoryErrorKind::InvalidArnException(_))
}
/// Returns `true` if the error kind is `CreateDirectoryErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
CreateDirectoryErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `CreateDirectoryErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
CreateDirectoryErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `CreateDirectoryErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
CreateDirectoryErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `CreateDirectoryErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, CreateDirectoryErrorKind::ValidationException(_))
}
}
impl std::error::Error for CreateDirectoryError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
CreateDirectoryErrorKind::AccessDeniedException(_inner) => Some(_inner),
CreateDirectoryErrorKind::DirectoryAlreadyExistsException(_inner) => Some(_inner),
CreateDirectoryErrorKind::InternalServiceException(_inner) => Some(_inner),
CreateDirectoryErrorKind::InvalidArnException(_inner) => Some(_inner),
CreateDirectoryErrorKind::LimitExceededException(_inner) => Some(_inner),
CreateDirectoryErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
CreateDirectoryErrorKind::RetryableConflictException(_inner) => Some(_inner),
CreateDirectoryErrorKind::ValidationException(_inner) => Some(_inner),
CreateDirectoryErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `CreateFacet` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct CreateFacetError {
/// Kind of error that occurred.
pub kind: CreateFacetErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `CreateFacet` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum CreateFacetErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>A facet with the same name already exists.</p>
FacetAlreadyExistsException(crate::error::FacetAlreadyExistsException),
/// <p>The <a>Facet</a> that you provided was not well formed or could not be
/// validated with the schema.</p>
FacetValidationException(crate::error::FacetValidationException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Occurs when any of the rule parameter keys or values are invalid.</p>
InvalidRuleException(crate::error::InvalidRuleException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for CreateFacetError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
CreateFacetErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
CreateFacetErrorKind::FacetAlreadyExistsException(_inner) => _inner.fmt(f),
CreateFacetErrorKind::FacetValidationException(_inner) => _inner.fmt(f),
CreateFacetErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
CreateFacetErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
CreateFacetErrorKind::InvalidRuleException(_inner) => _inner.fmt(f),
CreateFacetErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
CreateFacetErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
CreateFacetErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
CreateFacetErrorKind::ValidationException(_inner) => _inner.fmt(f),
CreateFacetErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for CreateFacetError {
fn code(&self) -> Option<&str> {
CreateFacetError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl CreateFacetError {
/// Creates a new `CreateFacetError`.
pub fn new(kind: CreateFacetErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `CreateFacetError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: CreateFacetErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `CreateFacetError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: CreateFacetErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `CreateFacetErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(&self.kind, CreateFacetErrorKind::AccessDeniedException(_))
}
/// Returns `true` if the error kind is `CreateFacetErrorKind::FacetAlreadyExistsException`.
pub fn is_facet_already_exists_exception(&self) -> bool {
matches!(
&self.kind,
CreateFacetErrorKind::FacetAlreadyExistsException(_)
)
}
/// Returns `true` if the error kind is `CreateFacetErrorKind::FacetValidationException`.
pub fn is_facet_validation_exception(&self) -> bool {
matches!(
&self.kind,
CreateFacetErrorKind::FacetValidationException(_)
)
}
/// Returns `true` if the error kind is `CreateFacetErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
CreateFacetErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `CreateFacetErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(&self.kind, CreateFacetErrorKind::InvalidArnException(_))
}
/// Returns `true` if the error kind is `CreateFacetErrorKind::InvalidRuleException`.
pub fn is_invalid_rule_exception(&self) -> bool {
matches!(&self.kind, CreateFacetErrorKind::InvalidRuleException(_))
}
/// Returns `true` if the error kind is `CreateFacetErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(&self.kind, CreateFacetErrorKind::LimitExceededException(_))
}
/// Returns `true` if the error kind is `CreateFacetErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
CreateFacetErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `CreateFacetErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
CreateFacetErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `CreateFacetErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, CreateFacetErrorKind::ValidationException(_))
}
}
impl std::error::Error for CreateFacetError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
CreateFacetErrorKind::AccessDeniedException(_inner) => Some(_inner),
CreateFacetErrorKind::FacetAlreadyExistsException(_inner) => Some(_inner),
CreateFacetErrorKind::FacetValidationException(_inner) => Some(_inner),
CreateFacetErrorKind::InternalServiceException(_inner) => Some(_inner),
CreateFacetErrorKind::InvalidArnException(_inner) => Some(_inner),
CreateFacetErrorKind::InvalidRuleException(_inner) => Some(_inner),
CreateFacetErrorKind::LimitExceededException(_inner) => Some(_inner),
CreateFacetErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
CreateFacetErrorKind::RetryableConflictException(_inner) => Some(_inner),
CreateFacetErrorKind::ValidationException(_inner) => Some(_inner),
CreateFacetErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `CreateIndex` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct CreateIndexError {
/// Kind of error that occurred.
pub kind: CreateIndexErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `CreateIndex` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum CreateIndexErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Operations are only permitted on enabled directories.</p>
DirectoryNotEnabledException(crate::error::DirectoryNotEnabledException),
/// <p>The <a>Facet</a> that you provided was not well formed or could not be
/// validated with the schema.</p>
FacetValidationException(crate::error::FacetValidationException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>Indicates that a link could not be created due to a naming conflict. Choose a different
/// name and then try again.</p>
LinkNameAlreadyInUseException(crate::error::LinkNameAlreadyInUseException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that the requested index type is not supported.</p>
UnsupportedIndexTypeException(crate::error::UnsupportedIndexTypeException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for CreateIndexError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
CreateIndexErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
CreateIndexErrorKind::DirectoryNotEnabledException(_inner) => _inner.fmt(f),
CreateIndexErrorKind::FacetValidationException(_inner) => _inner.fmt(f),
CreateIndexErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
CreateIndexErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
CreateIndexErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
CreateIndexErrorKind::LinkNameAlreadyInUseException(_inner) => _inner.fmt(f),
CreateIndexErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
CreateIndexErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
CreateIndexErrorKind::UnsupportedIndexTypeException(_inner) => _inner.fmt(f),
CreateIndexErrorKind::ValidationException(_inner) => _inner.fmt(f),
CreateIndexErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for CreateIndexError {
fn code(&self) -> Option<&str> {
CreateIndexError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl CreateIndexError {
/// Creates a new `CreateIndexError`.
pub fn new(kind: CreateIndexErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `CreateIndexError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: CreateIndexErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `CreateIndexError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: CreateIndexErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `CreateIndexErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(&self.kind, CreateIndexErrorKind::AccessDeniedException(_))
}
/// Returns `true` if the error kind is `CreateIndexErrorKind::DirectoryNotEnabledException`.
pub fn is_directory_not_enabled_exception(&self) -> bool {
matches!(
&self.kind,
CreateIndexErrorKind::DirectoryNotEnabledException(_)
)
}
/// Returns `true` if the error kind is `CreateIndexErrorKind::FacetValidationException`.
pub fn is_facet_validation_exception(&self) -> bool {
matches!(
&self.kind,
CreateIndexErrorKind::FacetValidationException(_)
)
}
/// Returns `true` if the error kind is `CreateIndexErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
CreateIndexErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `CreateIndexErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(&self.kind, CreateIndexErrorKind::InvalidArnException(_))
}
/// Returns `true` if the error kind is `CreateIndexErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(&self.kind, CreateIndexErrorKind::LimitExceededException(_))
}
/// Returns `true` if the error kind is `CreateIndexErrorKind::LinkNameAlreadyInUseException`.
pub fn is_link_name_already_in_use_exception(&self) -> bool {
matches!(
&self.kind,
CreateIndexErrorKind::LinkNameAlreadyInUseException(_)
)
}
/// Returns `true` if the error kind is `CreateIndexErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
CreateIndexErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `CreateIndexErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
CreateIndexErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `CreateIndexErrorKind::UnsupportedIndexTypeException`.
pub fn is_unsupported_index_type_exception(&self) -> bool {
matches!(
&self.kind,
CreateIndexErrorKind::UnsupportedIndexTypeException(_)
)
}
/// Returns `true` if the error kind is `CreateIndexErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, CreateIndexErrorKind::ValidationException(_))
}
}
impl std::error::Error for CreateIndexError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
CreateIndexErrorKind::AccessDeniedException(_inner) => Some(_inner),
CreateIndexErrorKind::DirectoryNotEnabledException(_inner) => Some(_inner),
CreateIndexErrorKind::FacetValidationException(_inner) => Some(_inner),
CreateIndexErrorKind::InternalServiceException(_inner) => Some(_inner),
CreateIndexErrorKind::InvalidArnException(_inner) => Some(_inner),
CreateIndexErrorKind::LimitExceededException(_inner) => Some(_inner),
CreateIndexErrorKind::LinkNameAlreadyInUseException(_inner) => Some(_inner),
CreateIndexErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
CreateIndexErrorKind::RetryableConflictException(_inner) => Some(_inner),
CreateIndexErrorKind::UnsupportedIndexTypeException(_inner) => Some(_inner),
CreateIndexErrorKind::ValidationException(_inner) => Some(_inner),
CreateIndexErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `CreateObject` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct CreateObjectError {
/// Kind of error that occurred.
pub kind: CreateObjectErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `CreateObject` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum CreateObjectErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Operations are only permitted on enabled directories.</p>
DirectoryNotEnabledException(crate::error::DirectoryNotEnabledException),
/// <p>The <a>Facet</a> that you provided was not well formed or could not be
/// validated with the schema.</p>
FacetValidationException(crate::error::FacetValidationException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>Indicates that a link could not be created due to a naming conflict. Choose a different
/// name and then try again.</p>
LinkNameAlreadyInUseException(crate::error::LinkNameAlreadyInUseException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that the requested index type is not supported.</p>
UnsupportedIndexTypeException(crate::error::UnsupportedIndexTypeException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for CreateObjectError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
CreateObjectErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
CreateObjectErrorKind::DirectoryNotEnabledException(_inner) => _inner.fmt(f),
CreateObjectErrorKind::FacetValidationException(_inner) => _inner.fmt(f),
CreateObjectErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
CreateObjectErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
CreateObjectErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
CreateObjectErrorKind::LinkNameAlreadyInUseException(_inner) => _inner.fmt(f),
CreateObjectErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
CreateObjectErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
CreateObjectErrorKind::UnsupportedIndexTypeException(_inner) => _inner.fmt(f),
CreateObjectErrorKind::ValidationException(_inner) => _inner.fmt(f),
CreateObjectErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for CreateObjectError {
fn code(&self) -> Option<&str> {
CreateObjectError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl CreateObjectError {
/// Creates a new `CreateObjectError`.
pub fn new(kind: CreateObjectErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `CreateObjectError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: CreateObjectErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `CreateObjectError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: CreateObjectErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `CreateObjectErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(&self.kind, CreateObjectErrorKind::AccessDeniedException(_))
}
/// Returns `true` if the error kind is `CreateObjectErrorKind::DirectoryNotEnabledException`.
pub fn is_directory_not_enabled_exception(&self) -> bool {
matches!(
&self.kind,
CreateObjectErrorKind::DirectoryNotEnabledException(_)
)
}
/// Returns `true` if the error kind is `CreateObjectErrorKind::FacetValidationException`.
pub fn is_facet_validation_exception(&self) -> bool {
matches!(
&self.kind,
CreateObjectErrorKind::FacetValidationException(_)
)
}
/// Returns `true` if the error kind is `CreateObjectErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
CreateObjectErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `CreateObjectErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(&self.kind, CreateObjectErrorKind::InvalidArnException(_))
}
/// Returns `true` if the error kind is `CreateObjectErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(&self.kind, CreateObjectErrorKind::LimitExceededException(_))
}
/// Returns `true` if the error kind is `CreateObjectErrorKind::LinkNameAlreadyInUseException`.
pub fn is_link_name_already_in_use_exception(&self) -> bool {
matches!(
&self.kind,
CreateObjectErrorKind::LinkNameAlreadyInUseException(_)
)
}
/// Returns `true` if the error kind is `CreateObjectErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
CreateObjectErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `CreateObjectErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
CreateObjectErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `CreateObjectErrorKind::UnsupportedIndexTypeException`.
pub fn is_unsupported_index_type_exception(&self) -> bool {
matches!(
&self.kind,
CreateObjectErrorKind::UnsupportedIndexTypeException(_)
)
}
/// Returns `true` if the error kind is `CreateObjectErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, CreateObjectErrorKind::ValidationException(_))
}
}
impl std::error::Error for CreateObjectError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
CreateObjectErrorKind::AccessDeniedException(_inner) => Some(_inner),
CreateObjectErrorKind::DirectoryNotEnabledException(_inner) => Some(_inner),
CreateObjectErrorKind::FacetValidationException(_inner) => Some(_inner),
CreateObjectErrorKind::InternalServiceException(_inner) => Some(_inner),
CreateObjectErrorKind::InvalidArnException(_inner) => Some(_inner),
CreateObjectErrorKind::LimitExceededException(_inner) => Some(_inner),
CreateObjectErrorKind::LinkNameAlreadyInUseException(_inner) => Some(_inner),
CreateObjectErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
CreateObjectErrorKind::RetryableConflictException(_inner) => Some(_inner),
CreateObjectErrorKind::UnsupportedIndexTypeException(_inner) => Some(_inner),
CreateObjectErrorKind::ValidationException(_inner) => Some(_inner),
CreateObjectErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `CreateSchema` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct CreateSchemaError {
/// Kind of error that occurred.
pub kind: CreateSchemaErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `CreateSchema` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum CreateSchemaErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that a schema could not be created due to a naming conflict. Please select a
/// different name and then try again.</p>
SchemaAlreadyExistsException(crate::error::SchemaAlreadyExistsException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for CreateSchemaError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
CreateSchemaErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
CreateSchemaErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
CreateSchemaErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
CreateSchemaErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
CreateSchemaErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
CreateSchemaErrorKind::SchemaAlreadyExistsException(_inner) => _inner.fmt(f),
CreateSchemaErrorKind::ValidationException(_inner) => _inner.fmt(f),
CreateSchemaErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for CreateSchemaError {
fn code(&self) -> Option<&str> {
CreateSchemaError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl CreateSchemaError {
/// Creates a new `CreateSchemaError`.
pub fn new(kind: CreateSchemaErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `CreateSchemaError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: CreateSchemaErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `CreateSchemaError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: CreateSchemaErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `CreateSchemaErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(&self.kind, CreateSchemaErrorKind::AccessDeniedException(_))
}
/// Returns `true` if the error kind is `CreateSchemaErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
CreateSchemaErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `CreateSchemaErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(&self.kind, CreateSchemaErrorKind::InvalidArnException(_))
}
/// Returns `true` if the error kind is `CreateSchemaErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(&self.kind, CreateSchemaErrorKind::LimitExceededException(_))
}
/// Returns `true` if the error kind is `CreateSchemaErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
CreateSchemaErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `CreateSchemaErrorKind::SchemaAlreadyExistsException`.
pub fn is_schema_already_exists_exception(&self) -> bool {
matches!(
&self.kind,
CreateSchemaErrorKind::SchemaAlreadyExistsException(_)
)
}
/// Returns `true` if the error kind is `CreateSchemaErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, CreateSchemaErrorKind::ValidationException(_))
}
}
impl std::error::Error for CreateSchemaError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
CreateSchemaErrorKind::AccessDeniedException(_inner) => Some(_inner),
CreateSchemaErrorKind::InternalServiceException(_inner) => Some(_inner),
CreateSchemaErrorKind::InvalidArnException(_inner) => Some(_inner),
CreateSchemaErrorKind::LimitExceededException(_inner) => Some(_inner),
CreateSchemaErrorKind::RetryableConflictException(_inner) => Some(_inner),
CreateSchemaErrorKind::SchemaAlreadyExistsException(_inner) => Some(_inner),
CreateSchemaErrorKind::ValidationException(_inner) => Some(_inner),
CreateSchemaErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `CreateTypedLinkFacet` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct CreateTypedLinkFacetError {
/// Kind of error that occurred.
pub kind: CreateTypedLinkFacetErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `CreateTypedLinkFacet` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum CreateTypedLinkFacetErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>A facet with the same name already exists.</p>
FacetAlreadyExistsException(crate::error::FacetAlreadyExistsException),
/// <p>The <a>Facet</a> that you provided was not well formed or could not be
/// validated with the schema.</p>
FacetValidationException(crate::error::FacetValidationException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Occurs when any of the rule parameter keys or values are invalid.</p>
InvalidRuleException(crate::error::InvalidRuleException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for CreateTypedLinkFacetError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
CreateTypedLinkFacetErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
CreateTypedLinkFacetErrorKind::FacetAlreadyExistsException(_inner) => _inner.fmt(f),
CreateTypedLinkFacetErrorKind::FacetValidationException(_inner) => _inner.fmt(f),
CreateTypedLinkFacetErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
CreateTypedLinkFacetErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
CreateTypedLinkFacetErrorKind::InvalidRuleException(_inner) => _inner.fmt(f),
CreateTypedLinkFacetErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
CreateTypedLinkFacetErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
CreateTypedLinkFacetErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
CreateTypedLinkFacetErrorKind::ValidationException(_inner) => _inner.fmt(f),
CreateTypedLinkFacetErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for CreateTypedLinkFacetError {
fn code(&self) -> Option<&str> {
CreateTypedLinkFacetError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl CreateTypedLinkFacetError {
/// Creates a new `CreateTypedLinkFacetError`.
pub fn new(kind: CreateTypedLinkFacetErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `CreateTypedLinkFacetError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: CreateTypedLinkFacetErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `CreateTypedLinkFacetError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: CreateTypedLinkFacetErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `CreateTypedLinkFacetErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
CreateTypedLinkFacetErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `CreateTypedLinkFacetErrorKind::FacetAlreadyExistsException`.
pub fn is_facet_already_exists_exception(&self) -> bool {
matches!(
&self.kind,
CreateTypedLinkFacetErrorKind::FacetAlreadyExistsException(_)
)
}
/// Returns `true` if the error kind is `CreateTypedLinkFacetErrorKind::FacetValidationException`.
pub fn is_facet_validation_exception(&self) -> bool {
matches!(
&self.kind,
CreateTypedLinkFacetErrorKind::FacetValidationException(_)
)
}
/// Returns `true` if the error kind is `CreateTypedLinkFacetErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
CreateTypedLinkFacetErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `CreateTypedLinkFacetErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(
&self.kind,
CreateTypedLinkFacetErrorKind::InvalidArnException(_)
)
}
/// Returns `true` if the error kind is `CreateTypedLinkFacetErrorKind::InvalidRuleException`.
pub fn is_invalid_rule_exception(&self) -> bool {
matches!(
&self.kind,
CreateTypedLinkFacetErrorKind::InvalidRuleException(_)
)
}
/// Returns `true` if the error kind is `CreateTypedLinkFacetErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
CreateTypedLinkFacetErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `CreateTypedLinkFacetErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
CreateTypedLinkFacetErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `CreateTypedLinkFacetErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
CreateTypedLinkFacetErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `CreateTypedLinkFacetErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
CreateTypedLinkFacetErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for CreateTypedLinkFacetError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
CreateTypedLinkFacetErrorKind::AccessDeniedException(_inner) => Some(_inner),
CreateTypedLinkFacetErrorKind::FacetAlreadyExistsException(_inner) => Some(_inner),
CreateTypedLinkFacetErrorKind::FacetValidationException(_inner) => Some(_inner),
CreateTypedLinkFacetErrorKind::InternalServiceException(_inner) => Some(_inner),
CreateTypedLinkFacetErrorKind::InvalidArnException(_inner) => Some(_inner),
CreateTypedLinkFacetErrorKind::InvalidRuleException(_inner) => Some(_inner),
CreateTypedLinkFacetErrorKind::LimitExceededException(_inner) => Some(_inner),
CreateTypedLinkFacetErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
CreateTypedLinkFacetErrorKind::RetryableConflictException(_inner) => Some(_inner),
CreateTypedLinkFacetErrorKind::ValidationException(_inner) => Some(_inner),
CreateTypedLinkFacetErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `DeleteDirectory` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct DeleteDirectoryError {
/// Kind of error that occurred.
pub kind: DeleteDirectoryErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `DeleteDirectory` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum DeleteDirectoryErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>A directory that has been deleted and to which access has been attempted. Note: The
/// requested resource will eventually cease to exist.</p>
DirectoryDeletedException(crate::error::DirectoryDeletedException),
/// <p>An operation can only operate on a disabled directory.</p>
DirectoryNotDisabledException(crate::error::DirectoryNotDisabledException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for DeleteDirectoryError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
DeleteDirectoryErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
DeleteDirectoryErrorKind::DirectoryDeletedException(_inner) => _inner.fmt(f),
DeleteDirectoryErrorKind::DirectoryNotDisabledException(_inner) => _inner.fmt(f),
DeleteDirectoryErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
DeleteDirectoryErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
DeleteDirectoryErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
DeleteDirectoryErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
DeleteDirectoryErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
DeleteDirectoryErrorKind::ValidationException(_inner) => _inner.fmt(f),
DeleteDirectoryErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for DeleteDirectoryError {
fn code(&self) -> Option<&str> {
DeleteDirectoryError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl DeleteDirectoryError {
/// Creates a new `DeleteDirectoryError`.
pub fn new(kind: DeleteDirectoryErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `DeleteDirectoryError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: DeleteDirectoryErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `DeleteDirectoryError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: DeleteDirectoryErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `DeleteDirectoryErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
DeleteDirectoryErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `DeleteDirectoryErrorKind::DirectoryDeletedException`.
pub fn is_directory_deleted_exception(&self) -> bool {
matches!(
&self.kind,
DeleteDirectoryErrorKind::DirectoryDeletedException(_)
)
}
/// Returns `true` if the error kind is `DeleteDirectoryErrorKind::DirectoryNotDisabledException`.
pub fn is_directory_not_disabled_exception(&self) -> bool {
matches!(
&self.kind,
DeleteDirectoryErrorKind::DirectoryNotDisabledException(_)
)
}
/// Returns `true` if the error kind is `DeleteDirectoryErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
DeleteDirectoryErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `DeleteDirectoryErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(&self.kind, DeleteDirectoryErrorKind::InvalidArnException(_))
}
/// Returns `true` if the error kind is `DeleteDirectoryErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
DeleteDirectoryErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `DeleteDirectoryErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
DeleteDirectoryErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `DeleteDirectoryErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
DeleteDirectoryErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `DeleteDirectoryErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, DeleteDirectoryErrorKind::ValidationException(_))
}
}
impl std::error::Error for DeleteDirectoryError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
DeleteDirectoryErrorKind::AccessDeniedException(_inner) => Some(_inner),
DeleteDirectoryErrorKind::DirectoryDeletedException(_inner) => Some(_inner),
DeleteDirectoryErrorKind::DirectoryNotDisabledException(_inner) => Some(_inner),
DeleteDirectoryErrorKind::InternalServiceException(_inner) => Some(_inner),
DeleteDirectoryErrorKind::InvalidArnException(_inner) => Some(_inner),
DeleteDirectoryErrorKind::LimitExceededException(_inner) => Some(_inner),
DeleteDirectoryErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
DeleteDirectoryErrorKind::RetryableConflictException(_inner) => Some(_inner),
DeleteDirectoryErrorKind::ValidationException(_inner) => Some(_inner),
DeleteDirectoryErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `DeleteFacet` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct DeleteFacetError {
/// Kind of error that occurred.
pub kind: DeleteFacetErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `DeleteFacet` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum DeleteFacetErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Occurs when deleting a facet that contains an attribute that is a target to an
/// attribute reference in a different facet.</p>
FacetInUseException(crate::error::FacetInUseException),
/// <p>The specified <a>Facet</a> could not be found.</p>
FacetNotFoundException(crate::error::FacetNotFoundException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for DeleteFacetError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
DeleteFacetErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
DeleteFacetErrorKind::FacetInUseException(_inner) => _inner.fmt(f),
DeleteFacetErrorKind::FacetNotFoundException(_inner) => _inner.fmt(f),
DeleteFacetErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
DeleteFacetErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
DeleteFacetErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
DeleteFacetErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
DeleteFacetErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
DeleteFacetErrorKind::ValidationException(_inner) => _inner.fmt(f),
DeleteFacetErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for DeleteFacetError {
fn code(&self) -> Option<&str> {
DeleteFacetError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl DeleteFacetError {
/// Creates a new `DeleteFacetError`.
pub fn new(kind: DeleteFacetErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `DeleteFacetError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: DeleteFacetErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `DeleteFacetError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: DeleteFacetErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `DeleteFacetErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(&self.kind, DeleteFacetErrorKind::AccessDeniedException(_))
}
/// Returns `true` if the error kind is `DeleteFacetErrorKind::FacetInUseException`.
pub fn is_facet_in_use_exception(&self) -> bool {
matches!(&self.kind, DeleteFacetErrorKind::FacetInUseException(_))
}
/// Returns `true` if the error kind is `DeleteFacetErrorKind::FacetNotFoundException`.
pub fn is_facet_not_found_exception(&self) -> bool {
matches!(&self.kind, DeleteFacetErrorKind::FacetNotFoundException(_))
}
/// Returns `true` if the error kind is `DeleteFacetErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
DeleteFacetErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `DeleteFacetErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(&self.kind, DeleteFacetErrorKind::InvalidArnException(_))
}
/// Returns `true` if the error kind is `DeleteFacetErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(&self.kind, DeleteFacetErrorKind::LimitExceededException(_))
}
/// Returns `true` if the error kind is `DeleteFacetErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
DeleteFacetErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `DeleteFacetErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
DeleteFacetErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `DeleteFacetErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, DeleteFacetErrorKind::ValidationException(_))
}
}
impl std::error::Error for DeleteFacetError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
DeleteFacetErrorKind::AccessDeniedException(_inner) => Some(_inner),
DeleteFacetErrorKind::FacetInUseException(_inner) => Some(_inner),
DeleteFacetErrorKind::FacetNotFoundException(_inner) => Some(_inner),
DeleteFacetErrorKind::InternalServiceException(_inner) => Some(_inner),
DeleteFacetErrorKind::InvalidArnException(_inner) => Some(_inner),
DeleteFacetErrorKind::LimitExceededException(_inner) => Some(_inner),
DeleteFacetErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
DeleteFacetErrorKind::RetryableConflictException(_inner) => Some(_inner),
DeleteFacetErrorKind::ValidationException(_inner) => Some(_inner),
DeleteFacetErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `DeleteObject` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct DeleteObjectError {
/// Kind of error that occurred.
pub kind: DeleteObjectErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `DeleteObject` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum DeleteObjectErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Operations are only permitted on enabled directories.</p>
DirectoryNotEnabledException(crate::error::DirectoryNotEnabledException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>Indicates that the requested operation cannot be completed because the object has not
/// been detached from the tree.</p>
ObjectNotDetachedException(crate::error::ObjectNotDetachedException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for DeleteObjectError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
DeleteObjectErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
DeleteObjectErrorKind::DirectoryNotEnabledException(_inner) => _inner.fmt(f),
DeleteObjectErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
DeleteObjectErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
DeleteObjectErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
DeleteObjectErrorKind::ObjectNotDetachedException(_inner) => _inner.fmt(f),
DeleteObjectErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
DeleteObjectErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
DeleteObjectErrorKind::ValidationException(_inner) => _inner.fmt(f),
DeleteObjectErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for DeleteObjectError {
fn code(&self) -> Option<&str> {
DeleteObjectError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl DeleteObjectError {
/// Creates a new `DeleteObjectError`.
pub fn new(kind: DeleteObjectErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `DeleteObjectError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: DeleteObjectErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `DeleteObjectError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: DeleteObjectErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `DeleteObjectErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(&self.kind, DeleteObjectErrorKind::AccessDeniedException(_))
}
/// Returns `true` if the error kind is `DeleteObjectErrorKind::DirectoryNotEnabledException`.
pub fn is_directory_not_enabled_exception(&self) -> bool {
matches!(
&self.kind,
DeleteObjectErrorKind::DirectoryNotEnabledException(_)
)
}
/// Returns `true` if the error kind is `DeleteObjectErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
DeleteObjectErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `DeleteObjectErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(&self.kind, DeleteObjectErrorKind::InvalidArnException(_))
}
/// Returns `true` if the error kind is `DeleteObjectErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(&self.kind, DeleteObjectErrorKind::LimitExceededException(_))
}
/// Returns `true` if the error kind is `DeleteObjectErrorKind::ObjectNotDetachedException`.
pub fn is_object_not_detached_exception(&self) -> bool {
matches!(
&self.kind,
DeleteObjectErrorKind::ObjectNotDetachedException(_)
)
}
/// Returns `true` if the error kind is `DeleteObjectErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
DeleteObjectErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `DeleteObjectErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
DeleteObjectErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `DeleteObjectErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, DeleteObjectErrorKind::ValidationException(_))
}
}
impl std::error::Error for DeleteObjectError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
DeleteObjectErrorKind::AccessDeniedException(_inner) => Some(_inner),
DeleteObjectErrorKind::DirectoryNotEnabledException(_inner) => Some(_inner),
DeleteObjectErrorKind::InternalServiceException(_inner) => Some(_inner),
DeleteObjectErrorKind::InvalidArnException(_inner) => Some(_inner),
DeleteObjectErrorKind::LimitExceededException(_inner) => Some(_inner),
DeleteObjectErrorKind::ObjectNotDetachedException(_inner) => Some(_inner),
DeleteObjectErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
DeleteObjectErrorKind::RetryableConflictException(_inner) => Some(_inner),
DeleteObjectErrorKind::ValidationException(_inner) => Some(_inner),
DeleteObjectErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `DeleteSchema` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct DeleteSchemaError {
/// Kind of error that occurred.
pub kind: DeleteSchemaErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `DeleteSchema` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum DeleteSchemaErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>The object could not be deleted because links still exist. Remove the links and then
/// try the operation again.</p>
StillContainsLinksException(crate::error::StillContainsLinksException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for DeleteSchemaError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
DeleteSchemaErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
DeleteSchemaErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
DeleteSchemaErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
DeleteSchemaErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
DeleteSchemaErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
DeleteSchemaErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
DeleteSchemaErrorKind::StillContainsLinksException(_inner) => _inner.fmt(f),
DeleteSchemaErrorKind::ValidationException(_inner) => _inner.fmt(f),
DeleteSchemaErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for DeleteSchemaError {
fn code(&self) -> Option<&str> {
DeleteSchemaError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl DeleteSchemaError {
/// Creates a new `DeleteSchemaError`.
pub fn new(kind: DeleteSchemaErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `DeleteSchemaError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: DeleteSchemaErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `DeleteSchemaError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: DeleteSchemaErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `DeleteSchemaErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(&self.kind, DeleteSchemaErrorKind::AccessDeniedException(_))
}
/// Returns `true` if the error kind is `DeleteSchemaErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
DeleteSchemaErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `DeleteSchemaErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(&self.kind, DeleteSchemaErrorKind::InvalidArnException(_))
}
/// Returns `true` if the error kind is `DeleteSchemaErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(&self.kind, DeleteSchemaErrorKind::LimitExceededException(_))
}
/// Returns `true` if the error kind is `DeleteSchemaErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
DeleteSchemaErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `DeleteSchemaErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
DeleteSchemaErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `DeleteSchemaErrorKind::StillContainsLinksException`.
pub fn is_still_contains_links_exception(&self) -> bool {
matches!(
&self.kind,
DeleteSchemaErrorKind::StillContainsLinksException(_)
)
}
/// Returns `true` if the error kind is `DeleteSchemaErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, DeleteSchemaErrorKind::ValidationException(_))
}
}
impl std::error::Error for DeleteSchemaError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
DeleteSchemaErrorKind::AccessDeniedException(_inner) => Some(_inner),
DeleteSchemaErrorKind::InternalServiceException(_inner) => Some(_inner),
DeleteSchemaErrorKind::InvalidArnException(_inner) => Some(_inner),
DeleteSchemaErrorKind::LimitExceededException(_inner) => Some(_inner),
DeleteSchemaErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
DeleteSchemaErrorKind::RetryableConflictException(_inner) => Some(_inner),
DeleteSchemaErrorKind::StillContainsLinksException(_inner) => Some(_inner),
DeleteSchemaErrorKind::ValidationException(_inner) => Some(_inner),
DeleteSchemaErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `DeleteTypedLinkFacet` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct DeleteTypedLinkFacetError {
/// Kind of error that occurred.
pub kind: DeleteTypedLinkFacetErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `DeleteTypedLinkFacet` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum DeleteTypedLinkFacetErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>The specified <a>Facet</a> could not be found.</p>
FacetNotFoundException(crate::error::FacetNotFoundException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for DeleteTypedLinkFacetError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
DeleteTypedLinkFacetErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
DeleteTypedLinkFacetErrorKind::FacetNotFoundException(_inner) => _inner.fmt(f),
DeleteTypedLinkFacetErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
DeleteTypedLinkFacetErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
DeleteTypedLinkFacetErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
DeleteTypedLinkFacetErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
DeleteTypedLinkFacetErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
DeleteTypedLinkFacetErrorKind::ValidationException(_inner) => _inner.fmt(f),
DeleteTypedLinkFacetErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for DeleteTypedLinkFacetError {
fn code(&self) -> Option<&str> {
DeleteTypedLinkFacetError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl DeleteTypedLinkFacetError {
/// Creates a new `DeleteTypedLinkFacetError`.
pub fn new(kind: DeleteTypedLinkFacetErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `DeleteTypedLinkFacetError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: DeleteTypedLinkFacetErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `DeleteTypedLinkFacetError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: DeleteTypedLinkFacetErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `DeleteTypedLinkFacetErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
DeleteTypedLinkFacetErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `DeleteTypedLinkFacetErrorKind::FacetNotFoundException`.
pub fn is_facet_not_found_exception(&self) -> bool {
matches!(
&self.kind,
DeleteTypedLinkFacetErrorKind::FacetNotFoundException(_)
)
}
/// Returns `true` if the error kind is `DeleteTypedLinkFacetErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
DeleteTypedLinkFacetErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `DeleteTypedLinkFacetErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(
&self.kind,
DeleteTypedLinkFacetErrorKind::InvalidArnException(_)
)
}
/// Returns `true` if the error kind is `DeleteTypedLinkFacetErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
DeleteTypedLinkFacetErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `DeleteTypedLinkFacetErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
DeleteTypedLinkFacetErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `DeleteTypedLinkFacetErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
DeleteTypedLinkFacetErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `DeleteTypedLinkFacetErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
DeleteTypedLinkFacetErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for DeleteTypedLinkFacetError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
DeleteTypedLinkFacetErrorKind::AccessDeniedException(_inner) => Some(_inner),
DeleteTypedLinkFacetErrorKind::FacetNotFoundException(_inner) => Some(_inner),
DeleteTypedLinkFacetErrorKind::InternalServiceException(_inner) => Some(_inner),
DeleteTypedLinkFacetErrorKind::InvalidArnException(_inner) => Some(_inner),
DeleteTypedLinkFacetErrorKind::LimitExceededException(_inner) => Some(_inner),
DeleteTypedLinkFacetErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
DeleteTypedLinkFacetErrorKind::RetryableConflictException(_inner) => Some(_inner),
DeleteTypedLinkFacetErrorKind::ValidationException(_inner) => Some(_inner),
DeleteTypedLinkFacetErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `DetachFromIndex` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct DetachFromIndexError {
/// Kind of error that occurred.
pub kind: DetachFromIndexErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `DetachFromIndex` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum DetachFromIndexErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Operations are only permitted on enabled directories.</p>
DirectoryNotEnabledException(crate::error::DirectoryNotEnabledException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>Indicates that the requested operation can only operate on index objects.</p>
NotIndexException(crate::error::NotIndexException),
/// <p>Indicates that the object is not attached to the index.</p>
ObjectAlreadyDetachedException(crate::error::ObjectAlreadyDetachedException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for DetachFromIndexError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
DetachFromIndexErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
DetachFromIndexErrorKind::DirectoryNotEnabledException(_inner) => _inner.fmt(f),
DetachFromIndexErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
DetachFromIndexErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
DetachFromIndexErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
DetachFromIndexErrorKind::NotIndexException(_inner) => _inner.fmt(f),
DetachFromIndexErrorKind::ObjectAlreadyDetachedException(_inner) => _inner.fmt(f),
DetachFromIndexErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
DetachFromIndexErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
DetachFromIndexErrorKind::ValidationException(_inner) => _inner.fmt(f),
DetachFromIndexErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for DetachFromIndexError {
fn code(&self) -> Option<&str> {
DetachFromIndexError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl DetachFromIndexError {
/// Creates a new `DetachFromIndexError`.
pub fn new(kind: DetachFromIndexErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `DetachFromIndexError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: DetachFromIndexErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `DetachFromIndexError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: DetachFromIndexErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `DetachFromIndexErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
DetachFromIndexErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `DetachFromIndexErrorKind::DirectoryNotEnabledException`.
pub fn is_directory_not_enabled_exception(&self) -> bool {
matches!(
&self.kind,
DetachFromIndexErrorKind::DirectoryNotEnabledException(_)
)
}
/// Returns `true` if the error kind is `DetachFromIndexErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
DetachFromIndexErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `DetachFromIndexErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(&self.kind, DetachFromIndexErrorKind::InvalidArnException(_))
}
/// Returns `true` if the error kind is `DetachFromIndexErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
DetachFromIndexErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `DetachFromIndexErrorKind::NotIndexException`.
pub fn is_not_index_exception(&self) -> bool {
matches!(&self.kind, DetachFromIndexErrorKind::NotIndexException(_))
}
/// Returns `true` if the error kind is `DetachFromIndexErrorKind::ObjectAlreadyDetachedException`.
pub fn is_object_already_detached_exception(&self) -> bool {
matches!(
&self.kind,
DetachFromIndexErrorKind::ObjectAlreadyDetachedException(_)
)
}
/// Returns `true` if the error kind is `DetachFromIndexErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
DetachFromIndexErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `DetachFromIndexErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
DetachFromIndexErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `DetachFromIndexErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, DetachFromIndexErrorKind::ValidationException(_))
}
}
impl std::error::Error for DetachFromIndexError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
DetachFromIndexErrorKind::AccessDeniedException(_inner) => Some(_inner),
DetachFromIndexErrorKind::DirectoryNotEnabledException(_inner) => Some(_inner),
DetachFromIndexErrorKind::InternalServiceException(_inner) => Some(_inner),
DetachFromIndexErrorKind::InvalidArnException(_inner) => Some(_inner),
DetachFromIndexErrorKind::LimitExceededException(_inner) => Some(_inner),
DetachFromIndexErrorKind::NotIndexException(_inner) => Some(_inner),
DetachFromIndexErrorKind::ObjectAlreadyDetachedException(_inner) => Some(_inner),
DetachFromIndexErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
DetachFromIndexErrorKind::RetryableConflictException(_inner) => Some(_inner),
DetachFromIndexErrorKind::ValidationException(_inner) => Some(_inner),
DetachFromIndexErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `DetachObject` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct DetachObjectError {
/// Kind of error that occurred.
pub kind: DetachObjectErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `DetachObject` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum DetachObjectErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Operations are only permitted on enabled directories.</p>
DirectoryNotEnabledException(crate::error::DirectoryNotEnabledException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>Occurs when any invalid operations are performed on an object that is not a node, such
/// as calling <code>ListObjectChildren</code> for a leaf node object.</p>
NotNodeException(crate::error::NotNodeException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for DetachObjectError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
DetachObjectErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
DetachObjectErrorKind::DirectoryNotEnabledException(_inner) => _inner.fmt(f),
DetachObjectErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
DetachObjectErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
DetachObjectErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
DetachObjectErrorKind::NotNodeException(_inner) => _inner.fmt(f),
DetachObjectErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
DetachObjectErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
DetachObjectErrorKind::ValidationException(_inner) => _inner.fmt(f),
DetachObjectErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for DetachObjectError {
fn code(&self) -> Option<&str> {
DetachObjectError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl DetachObjectError {
/// Creates a new `DetachObjectError`.
pub fn new(kind: DetachObjectErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `DetachObjectError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: DetachObjectErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `DetachObjectError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: DetachObjectErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `DetachObjectErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(&self.kind, DetachObjectErrorKind::AccessDeniedException(_))
}
/// Returns `true` if the error kind is `DetachObjectErrorKind::DirectoryNotEnabledException`.
pub fn is_directory_not_enabled_exception(&self) -> bool {
matches!(
&self.kind,
DetachObjectErrorKind::DirectoryNotEnabledException(_)
)
}
/// Returns `true` if the error kind is `DetachObjectErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
DetachObjectErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `DetachObjectErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(&self.kind, DetachObjectErrorKind::InvalidArnException(_))
}
/// Returns `true` if the error kind is `DetachObjectErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(&self.kind, DetachObjectErrorKind::LimitExceededException(_))
}
/// Returns `true` if the error kind is `DetachObjectErrorKind::NotNodeException`.
pub fn is_not_node_exception(&self) -> bool {
matches!(&self.kind, DetachObjectErrorKind::NotNodeException(_))
}
/// Returns `true` if the error kind is `DetachObjectErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
DetachObjectErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `DetachObjectErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
DetachObjectErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `DetachObjectErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, DetachObjectErrorKind::ValidationException(_))
}
}
impl std::error::Error for DetachObjectError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
DetachObjectErrorKind::AccessDeniedException(_inner) => Some(_inner),
DetachObjectErrorKind::DirectoryNotEnabledException(_inner) => Some(_inner),
DetachObjectErrorKind::InternalServiceException(_inner) => Some(_inner),
DetachObjectErrorKind::InvalidArnException(_inner) => Some(_inner),
DetachObjectErrorKind::LimitExceededException(_inner) => Some(_inner),
DetachObjectErrorKind::NotNodeException(_inner) => Some(_inner),
DetachObjectErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
DetachObjectErrorKind::RetryableConflictException(_inner) => Some(_inner),
DetachObjectErrorKind::ValidationException(_inner) => Some(_inner),
DetachObjectErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `DetachPolicy` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct DetachPolicyError {
/// Kind of error that occurred.
pub kind: DetachPolicyErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `DetachPolicy` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum DetachPolicyErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Operations are only permitted on enabled directories.</p>
DirectoryNotEnabledException(crate::error::DirectoryNotEnabledException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>Indicates that the requested operation can only operate on policy objects.</p>
NotPolicyException(crate::error::NotPolicyException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for DetachPolicyError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
DetachPolicyErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
DetachPolicyErrorKind::DirectoryNotEnabledException(_inner) => _inner.fmt(f),
DetachPolicyErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
DetachPolicyErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
DetachPolicyErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
DetachPolicyErrorKind::NotPolicyException(_inner) => _inner.fmt(f),
DetachPolicyErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
DetachPolicyErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
DetachPolicyErrorKind::ValidationException(_inner) => _inner.fmt(f),
DetachPolicyErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for DetachPolicyError {
fn code(&self) -> Option<&str> {
DetachPolicyError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl DetachPolicyError {
/// Creates a new `DetachPolicyError`.
pub fn new(kind: DetachPolicyErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `DetachPolicyError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: DetachPolicyErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `DetachPolicyError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: DetachPolicyErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `DetachPolicyErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(&self.kind, DetachPolicyErrorKind::AccessDeniedException(_))
}
/// Returns `true` if the error kind is `DetachPolicyErrorKind::DirectoryNotEnabledException`.
pub fn is_directory_not_enabled_exception(&self) -> bool {
matches!(
&self.kind,
DetachPolicyErrorKind::DirectoryNotEnabledException(_)
)
}
/// Returns `true` if the error kind is `DetachPolicyErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
DetachPolicyErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `DetachPolicyErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(&self.kind, DetachPolicyErrorKind::InvalidArnException(_))
}
/// Returns `true` if the error kind is `DetachPolicyErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(&self.kind, DetachPolicyErrorKind::LimitExceededException(_))
}
/// Returns `true` if the error kind is `DetachPolicyErrorKind::NotPolicyException`.
pub fn is_not_policy_exception(&self) -> bool {
matches!(&self.kind, DetachPolicyErrorKind::NotPolicyException(_))
}
/// Returns `true` if the error kind is `DetachPolicyErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
DetachPolicyErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `DetachPolicyErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
DetachPolicyErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `DetachPolicyErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, DetachPolicyErrorKind::ValidationException(_))
}
}
impl std::error::Error for DetachPolicyError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
DetachPolicyErrorKind::AccessDeniedException(_inner) => Some(_inner),
DetachPolicyErrorKind::DirectoryNotEnabledException(_inner) => Some(_inner),
DetachPolicyErrorKind::InternalServiceException(_inner) => Some(_inner),
DetachPolicyErrorKind::InvalidArnException(_inner) => Some(_inner),
DetachPolicyErrorKind::LimitExceededException(_inner) => Some(_inner),
DetachPolicyErrorKind::NotPolicyException(_inner) => Some(_inner),
DetachPolicyErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
DetachPolicyErrorKind::RetryableConflictException(_inner) => Some(_inner),
DetachPolicyErrorKind::ValidationException(_inner) => Some(_inner),
DetachPolicyErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `DetachTypedLink` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct DetachTypedLinkError {
/// Kind of error that occurred.
pub kind: DetachTypedLinkErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `DetachTypedLink` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum DetachTypedLinkErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Operations are only permitted on enabled directories.</p>
DirectoryNotEnabledException(crate::error::DirectoryNotEnabledException),
/// <p>The <a>Facet</a> that you provided was not well formed or could not be
/// validated with the schema.</p>
FacetValidationException(crate::error::FacetValidationException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for DetachTypedLinkError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
DetachTypedLinkErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
DetachTypedLinkErrorKind::DirectoryNotEnabledException(_inner) => _inner.fmt(f),
DetachTypedLinkErrorKind::FacetValidationException(_inner) => _inner.fmt(f),
DetachTypedLinkErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
DetachTypedLinkErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
DetachTypedLinkErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
DetachTypedLinkErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
DetachTypedLinkErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
DetachTypedLinkErrorKind::ValidationException(_inner) => _inner.fmt(f),
DetachTypedLinkErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for DetachTypedLinkError {
fn code(&self) -> Option<&str> {
DetachTypedLinkError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl DetachTypedLinkError {
/// Creates a new `DetachTypedLinkError`.
pub fn new(kind: DetachTypedLinkErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `DetachTypedLinkError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: DetachTypedLinkErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `DetachTypedLinkError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: DetachTypedLinkErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `DetachTypedLinkErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
DetachTypedLinkErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `DetachTypedLinkErrorKind::DirectoryNotEnabledException`.
pub fn is_directory_not_enabled_exception(&self) -> bool {
matches!(
&self.kind,
DetachTypedLinkErrorKind::DirectoryNotEnabledException(_)
)
}
/// Returns `true` if the error kind is `DetachTypedLinkErrorKind::FacetValidationException`.
pub fn is_facet_validation_exception(&self) -> bool {
matches!(
&self.kind,
DetachTypedLinkErrorKind::FacetValidationException(_)
)
}
/// Returns `true` if the error kind is `DetachTypedLinkErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
DetachTypedLinkErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `DetachTypedLinkErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(&self.kind, DetachTypedLinkErrorKind::InvalidArnException(_))
}
/// Returns `true` if the error kind is `DetachTypedLinkErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
DetachTypedLinkErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `DetachTypedLinkErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
DetachTypedLinkErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `DetachTypedLinkErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
DetachTypedLinkErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `DetachTypedLinkErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, DetachTypedLinkErrorKind::ValidationException(_))
}
}
impl std::error::Error for DetachTypedLinkError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
DetachTypedLinkErrorKind::AccessDeniedException(_inner) => Some(_inner),
DetachTypedLinkErrorKind::DirectoryNotEnabledException(_inner) => Some(_inner),
DetachTypedLinkErrorKind::FacetValidationException(_inner) => Some(_inner),
DetachTypedLinkErrorKind::InternalServiceException(_inner) => Some(_inner),
DetachTypedLinkErrorKind::InvalidArnException(_inner) => Some(_inner),
DetachTypedLinkErrorKind::LimitExceededException(_inner) => Some(_inner),
DetachTypedLinkErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
DetachTypedLinkErrorKind::RetryableConflictException(_inner) => Some(_inner),
DetachTypedLinkErrorKind::ValidationException(_inner) => Some(_inner),
DetachTypedLinkErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `DisableDirectory` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct DisableDirectoryError {
/// Kind of error that occurred.
pub kind: DisableDirectoryErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `DisableDirectory` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum DisableDirectoryErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>A directory that has been deleted and to which access has been attempted. Note: The
/// requested resource will eventually cease to exist.</p>
DirectoryDeletedException(crate::error::DirectoryDeletedException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for DisableDirectoryError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
DisableDirectoryErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
DisableDirectoryErrorKind::DirectoryDeletedException(_inner) => _inner.fmt(f),
DisableDirectoryErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
DisableDirectoryErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
DisableDirectoryErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
DisableDirectoryErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
DisableDirectoryErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
DisableDirectoryErrorKind::ValidationException(_inner) => _inner.fmt(f),
DisableDirectoryErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for DisableDirectoryError {
fn code(&self) -> Option<&str> {
DisableDirectoryError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl DisableDirectoryError {
/// Creates a new `DisableDirectoryError`.
pub fn new(kind: DisableDirectoryErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `DisableDirectoryError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: DisableDirectoryErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `DisableDirectoryError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: DisableDirectoryErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `DisableDirectoryErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
DisableDirectoryErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `DisableDirectoryErrorKind::DirectoryDeletedException`.
pub fn is_directory_deleted_exception(&self) -> bool {
matches!(
&self.kind,
DisableDirectoryErrorKind::DirectoryDeletedException(_)
)
}
/// Returns `true` if the error kind is `DisableDirectoryErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
DisableDirectoryErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `DisableDirectoryErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(
&self.kind,
DisableDirectoryErrorKind::InvalidArnException(_)
)
}
/// Returns `true` if the error kind is `DisableDirectoryErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
DisableDirectoryErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `DisableDirectoryErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
DisableDirectoryErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `DisableDirectoryErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
DisableDirectoryErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `DisableDirectoryErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
DisableDirectoryErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for DisableDirectoryError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
DisableDirectoryErrorKind::AccessDeniedException(_inner) => Some(_inner),
DisableDirectoryErrorKind::DirectoryDeletedException(_inner) => Some(_inner),
DisableDirectoryErrorKind::InternalServiceException(_inner) => Some(_inner),
DisableDirectoryErrorKind::InvalidArnException(_inner) => Some(_inner),
DisableDirectoryErrorKind::LimitExceededException(_inner) => Some(_inner),
DisableDirectoryErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
DisableDirectoryErrorKind::RetryableConflictException(_inner) => Some(_inner),
DisableDirectoryErrorKind::ValidationException(_inner) => Some(_inner),
DisableDirectoryErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `EnableDirectory` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct EnableDirectoryError {
/// Kind of error that occurred.
pub kind: EnableDirectoryErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `EnableDirectory` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum EnableDirectoryErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>A directory that has been deleted and to which access has been attempted. Note: The
/// requested resource will eventually cease to exist.</p>
DirectoryDeletedException(crate::error::DirectoryDeletedException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for EnableDirectoryError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
EnableDirectoryErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
EnableDirectoryErrorKind::DirectoryDeletedException(_inner) => _inner.fmt(f),
EnableDirectoryErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
EnableDirectoryErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
EnableDirectoryErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
EnableDirectoryErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
EnableDirectoryErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
EnableDirectoryErrorKind::ValidationException(_inner) => _inner.fmt(f),
EnableDirectoryErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for EnableDirectoryError {
fn code(&self) -> Option<&str> {
EnableDirectoryError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl EnableDirectoryError {
/// Creates a new `EnableDirectoryError`.
pub fn new(kind: EnableDirectoryErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `EnableDirectoryError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: EnableDirectoryErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `EnableDirectoryError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: EnableDirectoryErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `EnableDirectoryErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
EnableDirectoryErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `EnableDirectoryErrorKind::DirectoryDeletedException`.
pub fn is_directory_deleted_exception(&self) -> bool {
matches!(
&self.kind,
EnableDirectoryErrorKind::DirectoryDeletedException(_)
)
}
/// Returns `true` if the error kind is `EnableDirectoryErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
EnableDirectoryErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `EnableDirectoryErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(&self.kind, EnableDirectoryErrorKind::InvalidArnException(_))
}
/// Returns `true` if the error kind is `EnableDirectoryErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
EnableDirectoryErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `EnableDirectoryErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
EnableDirectoryErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `EnableDirectoryErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
EnableDirectoryErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `EnableDirectoryErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, EnableDirectoryErrorKind::ValidationException(_))
}
}
impl std::error::Error for EnableDirectoryError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
EnableDirectoryErrorKind::AccessDeniedException(_inner) => Some(_inner),
EnableDirectoryErrorKind::DirectoryDeletedException(_inner) => Some(_inner),
EnableDirectoryErrorKind::InternalServiceException(_inner) => Some(_inner),
EnableDirectoryErrorKind::InvalidArnException(_inner) => Some(_inner),
EnableDirectoryErrorKind::LimitExceededException(_inner) => Some(_inner),
EnableDirectoryErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
EnableDirectoryErrorKind::RetryableConflictException(_inner) => Some(_inner),
EnableDirectoryErrorKind::ValidationException(_inner) => Some(_inner),
EnableDirectoryErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `GetAppliedSchemaVersion` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct GetAppliedSchemaVersionError {
/// Kind of error that occurred.
pub kind: GetAppliedSchemaVersionErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `GetAppliedSchemaVersion` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum GetAppliedSchemaVersionErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for GetAppliedSchemaVersionError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
GetAppliedSchemaVersionErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
GetAppliedSchemaVersionErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
GetAppliedSchemaVersionErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
GetAppliedSchemaVersionErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
GetAppliedSchemaVersionErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
GetAppliedSchemaVersionErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
GetAppliedSchemaVersionErrorKind::ValidationException(_inner) => _inner.fmt(f),
GetAppliedSchemaVersionErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for GetAppliedSchemaVersionError {
fn code(&self) -> Option<&str> {
GetAppliedSchemaVersionError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl GetAppliedSchemaVersionError {
/// Creates a new `GetAppliedSchemaVersionError`.
pub fn new(kind: GetAppliedSchemaVersionErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `GetAppliedSchemaVersionError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: GetAppliedSchemaVersionErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `GetAppliedSchemaVersionError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: GetAppliedSchemaVersionErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `GetAppliedSchemaVersionErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
GetAppliedSchemaVersionErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `GetAppliedSchemaVersionErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
GetAppliedSchemaVersionErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `GetAppliedSchemaVersionErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(
&self.kind,
GetAppliedSchemaVersionErrorKind::InvalidArnException(_)
)
}
/// Returns `true` if the error kind is `GetAppliedSchemaVersionErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
GetAppliedSchemaVersionErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `GetAppliedSchemaVersionErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
GetAppliedSchemaVersionErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `GetAppliedSchemaVersionErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
GetAppliedSchemaVersionErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `GetAppliedSchemaVersionErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
GetAppliedSchemaVersionErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for GetAppliedSchemaVersionError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
GetAppliedSchemaVersionErrorKind::AccessDeniedException(_inner) => Some(_inner),
GetAppliedSchemaVersionErrorKind::InternalServiceException(_inner) => Some(_inner),
GetAppliedSchemaVersionErrorKind::InvalidArnException(_inner) => Some(_inner),
GetAppliedSchemaVersionErrorKind::LimitExceededException(_inner) => Some(_inner),
GetAppliedSchemaVersionErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
GetAppliedSchemaVersionErrorKind::RetryableConflictException(_inner) => Some(_inner),
GetAppliedSchemaVersionErrorKind::ValidationException(_inner) => Some(_inner),
GetAppliedSchemaVersionErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `GetDirectory` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct GetDirectoryError {
/// Kind of error that occurred.
pub kind: GetDirectoryErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `GetDirectory` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum GetDirectoryErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for GetDirectoryError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
GetDirectoryErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
GetDirectoryErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
GetDirectoryErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
GetDirectoryErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
GetDirectoryErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
GetDirectoryErrorKind::ValidationException(_inner) => _inner.fmt(f),
GetDirectoryErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for GetDirectoryError {
fn code(&self) -> Option<&str> {
GetDirectoryError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl GetDirectoryError {
/// Creates a new `GetDirectoryError`.
pub fn new(kind: GetDirectoryErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `GetDirectoryError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: GetDirectoryErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `GetDirectoryError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: GetDirectoryErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `GetDirectoryErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(&self.kind, GetDirectoryErrorKind::AccessDeniedException(_))
}
/// Returns `true` if the error kind is `GetDirectoryErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
GetDirectoryErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `GetDirectoryErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(&self.kind, GetDirectoryErrorKind::InvalidArnException(_))
}
/// Returns `true` if the error kind is `GetDirectoryErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(&self.kind, GetDirectoryErrorKind::LimitExceededException(_))
}
/// Returns `true` if the error kind is `GetDirectoryErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
GetDirectoryErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `GetDirectoryErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, GetDirectoryErrorKind::ValidationException(_))
}
}
impl std::error::Error for GetDirectoryError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
GetDirectoryErrorKind::AccessDeniedException(_inner) => Some(_inner),
GetDirectoryErrorKind::InternalServiceException(_inner) => Some(_inner),
GetDirectoryErrorKind::InvalidArnException(_inner) => Some(_inner),
GetDirectoryErrorKind::LimitExceededException(_inner) => Some(_inner),
GetDirectoryErrorKind::RetryableConflictException(_inner) => Some(_inner),
GetDirectoryErrorKind::ValidationException(_inner) => Some(_inner),
GetDirectoryErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `GetFacet` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct GetFacetError {
/// Kind of error that occurred.
pub kind: GetFacetErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `GetFacet` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum GetFacetErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>The specified <a>Facet</a> could not be found.</p>
FacetNotFoundException(crate::error::FacetNotFoundException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for GetFacetError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
GetFacetErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
GetFacetErrorKind::FacetNotFoundException(_inner) => _inner.fmt(f),
GetFacetErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
GetFacetErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
GetFacetErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
GetFacetErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
GetFacetErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
GetFacetErrorKind::ValidationException(_inner) => _inner.fmt(f),
GetFacetErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for GetFacetError {
fn code(&self) -> Option<&str> {
GetFacetError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl GetFacetError {
/// Creates a new `GetFacetError`.
pub fn new(kind: GetFacetErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `GetFacetError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: GetFacetErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `GetFacetError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: GetFacetErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `GetFacetErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(&self.kind, GetFacetErrorKind::AccessDeniedException(_))
}
/// Returns `true` if the error kind is `GetFacetErrorKind::FacetNotFoundException`.
pub fn is_facet_not_found_exception(&self) -> bool {
matches!(&self.kind, GetFacetErrorKind::FacetNotFoundException(_))
}
/// Returns `true` if the error kind is `GetFacetErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(&self.kind, GetFacetErrorKind::InternalServiceException(_))
}
/// Returns `true` if the error kind is `GetFacetErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(&self.kind, GetFacetErrorKind::InvalidArnException(_))
}
/// Returns `true` if the error kind is `GetFacetErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(&self.kind, GetFacetErrorKind::LimitExceededException(_))
}
/// Returns `true` if the error kind is `GetFacetErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(&self.kind, GetFacetErrorKind::ResourceNotFoundException(_))
}
/// Returns `true` if the error kind is `GetFacetErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(&self.kind, GetFacetErrorKind::RetryableConflictException(_))
}
/// Returns `true` if the error kind is `GetFacetErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, GetFacetErrorKind::ValidationException(_))
}
}
impl std::error::Error for GetFacetError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
GetFacetErrorKind::AccessDeniedException(_inner) => Some(_inner),
GetFacetErrorKind::FacetNotFoundException(_inner) => Some(_inner),
GetFacetErrorKind::InternalServiceException(_inner) => Some(_inner),
GetFacetErrorKind::InvalidArnException(_inner) => Some(_inner),
GetFacetErrorKind::LimitExceededException(_inner) => Some(_inner),
GetFacetErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
GetFacetErrorKind::RetryableConflictException(_inner) => Some(_inner),
GetFacetErrorKind::ValidationException(_inner) => Some(_inner),
GetFacetErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `GetLinkAttributes` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct GetLinkAttributesError {
/// Kind of error that occurred.
pub kind: GetLinkAttributesErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `GetLinkAttributes` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum GetLinkAttributesErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Operations are only permitted on enabled directories.</p>
DirectoryNotEnabledException(crate::error::DirectoryNotEnabledException),
/// <p>The <a>Facet</a> that you provided was not well formed or could not be
/// validated with the schema.</p>
FacetValidationException(crate::error::FacetValidationException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for GetLinkAttributesError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
GetLinkAttributesErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
GetLinkAttributesErrorKind::DirectoryNotEnabledException(_inner) => _inner.fmt(f),
GetLinkAttributesErrorKind::FacetValidationException(_inner) => _inner.fmt(f),
GetLinkAttributesErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
GetLinkAttributesErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
GetLinkAttributesErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
GetLinkAttributesErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
GetLinkAttributesErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
GetLinkAttributesErrorKind::ValidationException(_inner) => _inner.fmt(f),
GetLinkAttributesErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for GetLinkAttributesError {
fn code(&self) -> Option<&str> {
GetLinkAttributesError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl GetLinkAttributesError {
/// Creates a new `GetLinkAttributesError`.
pub fn new(kind: GetLinkAttributesErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `GetLinkAttributesError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: GetLinkAttributesErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `GetLinkAttributesError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: GetLinkAttributesErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `GetLinkAttributesErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
GetLinkAttributesErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `GetLinkAttributesErrorKind::DirectoryNotEnabledException`.
pub fn is_directory_not_enabled_exception(&self) -> bool {
matches!(
&self.kind,
GetLinkAttributesErrorKind::DirectoryNotEnabledException(_)
)
}
/// Returns `true` if the error kind is `GetLinkAttributesErrorKind::FacetValidationException`.
pub fn is_facet_validation_exception(&self) -> bool {
matches!(
&self.kind,
GetLinkAttributesErrorKind::FacetValidationException(_)
)
}
/// Returns `true` if the error kind is `GetLinkAttributesErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
GetLinkAttributesErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `GetLinkAttributesErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(
&self.kind,
GetLinkAttributesErrorKind::InvalidArnException(_)
)
}
/// Returns `true` if the error kind is `GetLinkAttributesErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
GetLinkAttributesErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `GetLinkAttributesErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
GetLinkAttributesErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `GetLinkAttributesErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
GetLinkAttributesErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `GetLinkAttributesErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
GetLinkAttributesErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for GetLinkAttributesError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
GetLinkAttributesErrorKind::AccessDeniedException(_inner) => Some(_inner),
GetLinkAttributesErrorKind::DirectoryNotEnabledException(_inner) => Some(_inner),
GetLinkAttributesErrorKind::FacetValidationException(_inner) => Some(_inner),
GetLinkAttributesErrorKind::InternalServiceException(_inner) => Some(_inner),
GetLinkAttributesErrorKind::InvalidArnException(_inner) => Some(_inner),
GetLinkAttributesErrorKind::LimitExceededException(_inner) => Some(_inner),
GetLinkAttributesErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
GetLinkAttributesErrorKind::RetryableConflictException(_inner) => Some(_inner),
GetLinkAttributesErrorKind::ValidationException(_inner) => Some(_inner),
GetLinkAttributesErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `GetObjectAttributes` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct GetObjectAttributesError {
/// Kind of error that occurred.
pub kind: GetObjectAttributesErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `GetObjectAttributes` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum GetObjectAttributesErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Operations are only permitted on enabled directories.</p>
DirectoryNotEnabledException(crate::error::DirectoryNotEnabledException),
/// <p>The <a>Facet</a> that you provided was not well formed or could not be
/// validated with the schema.</p>
FacetValidationException(crate::error::FacetValidationException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for GetObjectAttributesError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
GetObjectAttributesErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
GetObjectAttributesErrorKind::DirectoryNotEnabledException(_inner) => _inner.fmt(f),
GetObjectAttributesErrorKind::FacetValidationException(_inner) => _inner.fmt(f),
GetObjectAttributesErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
GetObjectAttributesErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
GetObjectAttributesErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
GetObjectAttributesErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
GetObjectAttributesErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
GetObjectAttributesErrorKind::ValidationException(_inner) => _inner.fmt(f),
GetObjectAttributesErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for GetObjectAttributesError {
fn code(&self) -> Option<&str> {
GetObjectAttributesError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl GetObjectAttributesError {
/// Creates a new `GetObjectAttributesError`.
pub fn new(kind: GetObjectAttributesErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `GetObjectAttributesError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: GetObjectAttributesErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `GetObjectAttributesError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: GetObjectAttributesErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `GetObjectAttributesErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
GetObjectAttributesErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `GetObjectAttributesErrorKind::DirectoryNotEnabledException`.
pub fn is_directory_not_enabled_exception(&self) -> bool {
matches!(
&self.kind,
GetObjectAttributesErrorKind::DirectoryNotEnabledException(_)
)
}
/// Returns `true` if the error kind is `GetObjectAttributesErrorKind::FacetValidationException`.
pub fn is_facet_validation_exception(&self) -> bool {
matches!(
&self.kind,
GetObjectAttributesErrorKind::FacetValidationException(_)
)
}
/// Returns `true` if the error kind is `GetObjectAttributesErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
GetObjectAttributesErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `GetObjectAttributesErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(
&self.kind,
GetObjectAttributesErrorKind::InvalidArnException(_)
)
}
/// Returns `true` if the error kind is `GetObjectAttributesErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
GetObjectAttributesErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `GetObjectAttributesErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
GetObjectAttributesErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `GetObjectAttributesErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
GetObjectAttributesErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `GetObjectAttributesErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
GetObjectAttributesErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for GetObjectAttributesError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
GetObjectAttributesErrorKind::AccessDeniedException(_inner) => Some(_inner),
GetObjectAttributesErrorKind::DirectoryNotEnabledException(_inner) => Some(_inner),
GetObjectAttributesErrorKind::FacetValidationException(_inner) => Some(_inner),
GetObjectAttributesErrorKind::InternalServiceException(_inner) => Some(_inner),
GetObjectAttributesErrorKind::InvalidArnException(_inner) => Some(_inner),
GetObjectAttributesErrorKind::LimitExceededException(_inner) => Some(_inner),
GetObjectAttributesErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
GetObjectAttributesErrorKind::RetryableConflictException(_inner) => Some(_inner),
GetObjectAttributesErrorKind::ValidationException(_inner) => Some(_inner),
GetObjectAttributesErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `GetObjectInformation` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct GetObjectInformationError {
/// Kind of error that occurred.
pub kind: GetObjectInformationErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `GetObjectInformation` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum GetObjectInformationErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Operations are only permitted on enabled directories.</p>
DirectoryNotEnabledException(crate::error::DirectoryNotEnabledException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for GetObjectInformationError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
GetObjectInformationErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
GetObjectInformationErrorKind::DirectoryNotEnabledException(_inner) => _inner.fmt(f),
GetObjectInformationErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
GetObjectInformationErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
GetObjectInformationErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
GetObjectInformationErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
GetObjectInformationErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
GetObjectInformationErrorKind::ValidationException(_inner) => _inner.fmt(f),
GetObjectInformationErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for GetObjectInformationError {
fn code(&self) -> Option<&str> {
GetObjectInformationError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl GetObjectInformationError {
/// Creates a new `GetObjectInformationError`.
pub fn new(kind: GetObjectInformationErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `GetObjectInformationError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: GetObjectInformationErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `GetObjectInformationError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: GetObjectInformationErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `GetObjectInformationErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
GetObjectInformationErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `GetObjectInformationErrorKind::DirectoryNotEnabledException`.
pub fn is_directory_not_enabled_exception(&self) -> bool {
matches!(
&self.kind,
GetObjectInformationErrorKind::DirectoryNotEnabledException(_)
)
}
/// Returns `true` if the error kind is `GetObjectInformationErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
GetObjectInformationErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `GetObjectInformationErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(
&self.kind,
GetObjectInformationErrorKind::InvalidArnException(_)
)
}
/// Returns `true` if the error kind is `GetObjectInformationErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
GetObjectInformationErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `GetObjectInformationErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
GetObjectInformationErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `GetObjectInformationErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
GetObjectInformationErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `GetObjectInformationErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
GetObjectInformationErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for GetObjectInformationError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
GetObjectInformationErrorKind::AccessDeniedException(_inner) => Some(_inner),
GetObjectInformationErrorKind::DirectoryNotEnabledException(_inner) => Some(_inner),
GetObjectInformationErrorKind::InternalServiceException(_inner) => Some(_inner),
GetObjectInformationErrorKind::InvalidArnException(_inner) => Some(_inner),
GetObjectInformationErrorKind::LimitExceededException(_inner) => Some(_inner),
GetObjectInformationErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
GetObjectInformationErrorKind::RetryableConflictException(_inner) => Some(_inner),
GetObjectInformationErrorKind::ValidationException(_inner) => Some(_inner),
GetObjectInformationErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `GetSchemaAsJson` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct GetSchemaAsJsonError {
/// Kind of error that occurred.
pub kind: GetSchemaAsJsonErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `GetSchemaAsJson` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum GetSchemaAsJsonErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for GetSchemaAsJsonError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
GetSchemaAsJsonErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
GetSchemaAsJsonErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
GetSchemaAsJsonErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
GetSchemaAsJsonErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
GetSchemaAsJsonErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
GetSchemaAsJsonErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
GetSchemaAsJsonErrorKind::ValidationException(_inner) => _inner.fmt(f),
GetSchemaAsJsonErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for GetSchemaAsJsonError {
fn code(&self) -> Option<&str> {
GetSchemaAsJsonError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl GetSchemaAsJsonError {
/// Creates a new `GetSchemaAsJsonError`.
pub fn new(kind: GetSchemaAsJsonErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `GetSchemaAsJsonError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: GetSchemaAsJsonErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `GetSchemaAsJsonError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: GetSchemaAsJsonErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `GetSchemaAsJsonErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
GetSchemaAsJsonErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `GetSchemaAsJsonErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
GetSchemaAsJsonErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `GetSchemaAsJsonErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(&self.kind, GetSchemaAsJsonErrorKind::InvalidArnException(_))
}
/// Returns `true` if the error kind is `GetSchemaAsJsonErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
GetSchemaAsJsonErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `GetSchemaAsJsonErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
GetSchemaAsJsonErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `GetSchemaAsJsonErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
GetSchemaAsJsonErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `GetSchemaAsJsonErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, GetSchemaAsJsonErrorKind::ValidationException(_))
}
}
impl std::error::Error for GetSchemaAsJsonError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
GetSchemaAsJsonErrorKind::AccessDeniedException(_inner) => Some(_inner),
GetSchemaAsJsonErrorKind::InternalServiceException(_inner) => Some(_inner),
GetSchemaAsJsonErrorKind::InvalidArnException(_inner) => Some(_inner),
GetSchemaAsJsonErrorKind::LimitExceededException(_inner) => Some(_inner),
GetSchemaAsJsonErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
GetSchemaAsJsonErrorKind::RetryableConflictException(_inner) => Some(_inner),
GetSchemaAsJsonErrorKind::ValidationException(_inner) => Some(_inner),
GetSchemaAsJsonErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `GetTypedLinkFacetInformation` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct GetTypedLinkFacetInformationError {
/// Kind of error that occurred.
pub kind: GetTypedLinkFacetInformationErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `GetTypedLinkFacetInformation` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum GetTypedLinkFacetInformationErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>The specified <a>Facet</a> could not be found.</p>
FacetNotFoundException(crate::error::FacetNotFoundException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that the <code>NextToken</code> value is not valid.</p>
InvalidNextTokenException(crate::error::InvalidNextTokenException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for GetTypedLinkFacetInformationError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
GetTypedLinkFacetInformationErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
GetTypedLinkFacetInformationErrorKind::FacetNotFoundException(_inner) => _inner.fmt(f),
GetTypedLinkFacetInformationErrorKind::InternalServiceException(_inner) => {
_inner.fmt(f)
}
GetTypedLinkFacetInformationErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
GetTypedLinkFacetInformationErrorKind::InvalidNextTokenException(_inner) => {
_inner.fmt(f)
}
GetTypedLinkFacetInformationErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
GetTypedLinkFacetInformationErrorKind::ResourceNotFoundException(_inner) => {
_inner.fmt(f)
}
GetTypedLinkFacetInformationErrorKind::RetryableConflictException(_inner) => {
_inner.fmt(f)
}
GetTypedLinkFacetInformationErrorKind::ValidationException(_inner) => _inner.fmt(f),
GetTypedLinkFacetInformationErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for GetTypedLinkFacetInformationError {
fn code(&self) -> Option<&str> {
GetTypedLinkFacetInformationError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl GetTypedLinkFacetInformationError {
/// Creates a new `GetTypedLinkFacetInformationError`.
pub fn new(kind: GetTypedLinkFacetInformationErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `GetTypedLinkFacetInformationError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: GetTypedLinkFacetInformationErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `GetTypedLinkFacetInformationError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: GetTypedLinkFacetInformationErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `GetTypedLinkFacetInformationErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
GetTypedLinkFacetInformationErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `GetTypedLinkFacetInformationErrorKind::FacetNotFoundException`.
pub fn is_facet_not_found_exception(&self) -> bool {
matches!(
&self.kind,
GetTypedLinkFacetInformationErrorKind::FacetNotFoundException(_)
)
}
/// Returns `true` if the error kind is `GetTypedLinkFacetInformationErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
GetTypedLinkFacetInformationErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `GetTypedLinkFacetInformationErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(
&self.kind,
GetTypedLinkFacetInformationErrorKind::InvalidArnException(_)
)
}
/// Returns `true` if the error kind is `GetTypedLinkFacetInformationErrorKind::InvalidNextTokenException`.
pub fn is_invalid_next_token_exception(&self) -> bool {
matches!(
&self.kind,
GetTypedLinkFacetInformationErrorKind::InvalidNextTokenException(_)
)
}
/// Returns `true` if the error kind is `GetTypedLinkFacetInformationErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
GetTypedLinkFacetInformationErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `GetTypedLinkFacetInformationErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
GetTypedLinkFacetInformationErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `GetTypedLinkFacetInformationErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
GetTypedLinkFacetInformationErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `GetTypedLinkFacetInformationErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
GetTypedLinkFacetInformationErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for GetTypedLinkFacetInformationError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
GetTypedLinkFacetInformationErrorKind::AccessDeniedException(_inner) => Some(_inner),
GetTypedLinkFacetInformationErrorKind::FacetNotFoundException(_inner) => Some(_inner),
GetTypedLinkFacetInformationErrorKind::InternalServiceException(_inner) => Some(_inner),
GetTypedLinkFacetInformationErrorKind::InvalidArnException(_inner) => Some(_inner),
GetTypedLinkFacetInformationErrorKind::InvalidNextTokenException(_inner) => {
Some(_inner)
}
GetTypedLinkFacetInformationErrorKind::LimitExceededException(_inner) => Some(_inner),
GetTypedLinkFacetInformationErrorKind::ResourceNotFoundException(_inner) => {
Some(_inner)
}
GetTypedLinkFacetInformationErrorKind::RetryableConflictException(_inner) => {
Some(_inner)
}
GetTypedLinkFacetInformationErrorKind::ValidationException(_inner) => Some(_inner),
GetTypedLinkFacetInformationErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `ListAppliedSchemaArns` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ListAppliedSchemaArnsError {
/// Kind of error that occurred.
pub kind: ListAppliedSchemaArnsErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `ListAppliedSchemaArns` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ListAppliedSchemaArnsErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that the <code>NextToken</code> value is not valid.</p>
InvalidNextTokenException(crate::error::InvalidNextTokenException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for ListAppliedSchemaArnsError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ListAppliedSchemaArnsErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
ListAppliedSchemaArnsErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
ListAppliedSchemaArnsErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
ListAppliedSchemaArnsErrorKind::InvalidNextTokenException(_inner) => _inner.fmt(f),
ListAppliedSchemaArnsErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
ListAppliedSchemaArnsErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
ListAppliedSchemaArnsErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
ListAppliedSchemaArnsErrorKind::ValidationException(_inner) => _inner.fmt(f),
ListAppliedSchemaArnsErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ListAppliedSchemaArnsError {
fn code(&self) -> Option<&str> {
ListAppliedSchemaArnsError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl ListAppliedSchemaArnsError {
/// Creates a new `ListAppliedSchemaArnsError`.
pub fn new(kind: ListAppliedSchemaArnsErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `ListAppliedSchemaArnsError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: ListAppliedSchemaArnsErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `ListAppliedSchemaArnsError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ListAppliedSchemaArnsErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `ListAppliedSchemaArnsErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
ListAppliedSchemaArnsErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `ListAppliedSchemaArnsErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
ListAppliedSchemaArnsErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `ListAppliedSchemaArnsErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(
&self.kind,
ListAppliedSchemaArnsErrorKind::InvalidArnException(_)
)
}
/// Returns `true` if the error kind is `ListAppliedSchemaArnsErrorKind::InvalidNextTokenException`.
pub fn is_invalid_next_token_exception(&self) -> bool {
matches!(
&self.kind,
ListAppliedSchemaArnsErrorKind::InvalidNextTokenException(_)
)
}
/// Returns `true` if the error kind is `ListAppliedSchemaArnsErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
ListAppliedSchemaArnsErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `ListAppliedSchemaArnsErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
ListAppliedSchemaArnsErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `ListAppliedSchemaArnsErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
ListAppliedSchemaArnsErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `ListAppliedSchemaArnsErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
ListAppliedSchemaArnsErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for ListAppliedSchemaArnsError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ListAppliedSchemaArnsErrorKind::AccessDeniedException(_inner) => Some(_inner),
ListAppliedSchemaArnsErrorKind::InternalServiceException(_inner) => Some(_inner),
ListAppliedSchemaArnsErrorKind::InvalidArnException(_inner) => Some(_inner),
ListAppliedSchemaArnsErrorKind::InvalidNextTokenException(_inner) => Some(_inner),
ListAppliedSchemaArnsErrorKind::LimitExceededException(_inner) => Some(_inner),
ListAppliedSchemaArnsErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
ListAppliedSchemaArnsErrorKind::RetryableConflictException(_inner) => Some(_inner),
ListAppliedSchemaArnsErrorKind::ValidationException(_inner) => Some(_inner),
ListAppliedSchemaArnsErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `ListAttachedIndices` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ListAttachedIndicesError {
/// Kind of error that occurred.
pub kind: ListAttachedIndicesErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `ListAttachedIndices` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ListAttachedIndicesErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Operations are only permitted on enabled directories.</p>
DirectoryNotEnabledException(crate::error::DirectoryNotEnabledException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for ListAttachedIndicesError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ListAttachedIndicesErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
ListAttachedIndicesErrorKind::DirectoryNotEnabledException(_inner) => _inner.fmt(f),
ListAttachedIndicesErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
ListAttachedIndicesErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
ListAttachedIndicesErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
ListAttachedIndicesErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
ListAttachedIndicesErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
ListAttachedIndicesErrorKind::ValidationException(_inner) => _inner.fmt(f),
ListAttachedIndicesErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ListAttachedIndicesError {
fn code(&self) -> Option<&str> {
ListAttachedIndicesError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl ListAttachedIndicesError {
/// Creates a new `ListAttachedIndicesError`.
pub fn new(kind: ListAttachedIndicesErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `ListAttachedIndicesError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: ListAttachedIndicesErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `ListAttachedIndicesError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ListAttachedIndicesErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `ListAttachedIndicesErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
ListAttachedIndicesErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `ListAttachedIndicesErrorKind::DirectoryNotEnabledException`.
pub fn is_directory_not_enabled_exception(&self) -> bool {
matches!(
&self.kind,
ListAttachedIndicesErrorKind::DirectoryNotEnabledException(_)
)
}
/// Returns `true` if the error kind is `ListAttachedIndicesErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
ListAttachedIndicesErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `ListAttachedIndicesErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(
&self.kind,
ListAttachedIndicesErrorKind::InvalidArnException(_)
)
}
/// Returns `true` if the error kind is `ListAttachedIndicesErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
ListAttachedIndicesErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `ListAttachedIndicesErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
ListAttachedIndicesErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `ListAttachedIndicesErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
ListAttachedIndicesErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `ListAttachedIndicesErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
ListAttachedIndicesErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for ListAttachedIndicesError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ListAttachedIndicesErrorKind::AccessDeniedException(_inner) => Some(_inner),
ListAttachedIndicesErrorKind::DirectoryNotEnabledException(_inner) => Some(_inner),
ListAttachedIndicesErrorKind::InternalServiceException(_inner) => Some(_inner),
ListAttachedIndicesErrorKind::InvalidArnException(_inner) => Some(_inner),
ListAttachedIndicesErrorKind::LimitExceededException(_inner) => Some(_inner),
ListAttachedIndicesErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
ListAttachedIndicesErrorKind::RetryableConflictException(_inner) => Some(_inner),
ListAttachedIndicesErrorKind::ValidationException(_inner) => Some(_inner),
ListAttachedIndicesErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `ListDevelopmentSchemaArns` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ListDevelopmentSchemaArnsError {
/// Kind of error that occurred.
pub kind: ListDevelopmentSchemaArnsErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `ListDevelopmentSchemaArns` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ListDevelopmentSchemaArnsErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that the <code>NextToken</code> value is not valid.</p>
InvalidNextTokenException(crate::error::InvalidNextTokenException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for ListDevelopmentSchemaArnsError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ListDevelopmentSchemaArnsErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
ListDevelopmentSchemaArnsErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
ListDevelopmentSchemaArnsErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
ListDevelopmentSchemaArnsErrorKind::InvalidNextTokenException(_inner) => _inner.fmt(f),
ListDevelopmentSchemaArnsErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
ListDevelopmentSchemaArnsErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
ListDevelopmentSchemaArnsErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
ListDevelopmentSchemaArnsErrorKind::ValidationException(_inner) => _inner.fmt(f),
ListDevelopmentSchemaArnsErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ListDevelopmentSchemaArnsError {
fn code(&self) -> Option<&str> {
ListDevelopmentSchemaArnsError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl ListDevelopmentSchemaArnsError {
/// Creates a new `ListDevelopmentSchemaArnsError`.
pub fn new(kind: ListDevelopmentSchemaArnsErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `ListDevelopmentSchemaArnsError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: ListDevelopmentSchemaArnsErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `ListDevelopmentSchemaArnsError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ListDevelopmentSchemaArnsErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `ListDevelopmentSchemaArnsErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
ListDevelopmentSchemaArnsErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `ListDevelopmentSchemaArnsErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
ListDevelopmentSchemaArnsErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `ListDevelopmentSchemaArnsErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(
&self.kind,
ListDevelopmentSchemaArnsErrorKind::InvalidArnException(_)
)
}
/// Returns `true` if the error kind is `ListDevelopmentSchemaArnsErrorKind::InvalidNextTokenException`.
pub fn is_invalid_next_token_exception(&self) -> bool {
matches!(
&self.kind,
ListDevelopmentSchemaArnsErrorKind::InvalidNextTokenException(_)
)
}
/// Returns `true` if the error kind is `ListDevelopmentSchemaArnsErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
ListDevelopmentSchemaArnsErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `ListDevelopmentSchemaArnsErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
ListDevelopmentSchemaArnsErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `ListDevelopmentSchemaArnsErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
ListDevelopmentSchemaArnsErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `ListDevelopmentSchemaArnsErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
ListDevelopmentSchemaArnsErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for ListDevelopmentSchemaArnsError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ListDevelopmentSchemaArnsErrorKind::AccessDeniedException(_inner) => Some(_inner),
ListDevelopmentSchemaArnsErrorKind::InternalServiceException(_inner) => Some(_inner),
ListDevelopmentSchemaArnsErrorKind::InvalidArnException(_inner) => Some(_inner),
ListDevelopmentSchemaArnsErrorKind::InvalidNextTokenException(_inner) => Some(_inner),
ListDevelopmentSchemaArnsErrorKind::LimitExceededException(_inner) => Some(_inner),
ListDevelopmentSchemaArnsErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
ListDevelopmentSchemaArnsErrorKind::RetryableConflictException(_inner) => Some(_inner),
ListDevelopmentSchemaArnsErrorKind::ValidationException(_inner) => Some(_inner),
ListDevelopmentSchemaArnsErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `ListDirectories` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ListDirectoriesError {
/// Kind of error that occurred.
pub kind: ListDirectoriesErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `ListDirectories` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ListDirectoriesErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that the <code>NextToken</code> value is not valid.</p>
InvalidNextTokenException(crate::error::InvalidNextTokenException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for ListDirectoriesError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ListDirectoriesErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
ListDirectoriesErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
ListDirectoriesErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
ListDirectoriesErrorKind::InvalidNextTokenException(_inner) => _inner.fmt(f),
ListDirectoriesErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
ListDirectoriesErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
ListDirectoriesErrorKind::ValidationException(_inner) => _inner.fmt(f),
ListDirectoriesErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ListDirectoriesError {
fn code(&self) -> Option<&str> {
ListDirectoriesError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl ListDirectoriesError {
/// Creates a new `ListDirectoriesError`.
pub fn new(kind: ListDirectoriesErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `ListDirectoriesError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: ListDirectoriesErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `ListDirectoriesError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ListDirectoriesErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `ListDirectoriesErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
ListDirectoriesErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `ListDirectoriesErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
ListDirectoriesErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `ListDirectoriesErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(&self.kind, ListDirectoriesErrorKind::InvalidArnException(_))
}
/// Returns `true` if the error kind is `ListDirectoriesErrorKind::InvalidNextTokenException`.
pub fn is_invalid_next_token_exception(&self) -> bool {
matches!(
&self.kind,
ListDirectoriesErrorKind::InvalidNextTokenException(_)
)
}
/// Returns `true` if the error kind is `ListDirectoriesErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
ListDirectoriesErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `ListDirectoriesErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
ListDirectoriesErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `ListDirectoriesErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, ListDirectoriesErrorKind::ValidationException(_))
}
}
impl std::error::Error for ListDirectoriesError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ListDirectoriesErrorKind::AccessDeniedException(_inner) => Some(_inner),
ListDirectoriesErrorKind::InternalServiceException(_inner) => Some(_inner),
ListDirectoriesErrorKind::InvalidArnException(_inner) => Some(_inner),
ListDirectoriesErrorKind::InvalidNextTokenException(_inner) => Some(_inner),
ListDirectoriesErrorKind::LimitExceededException(_inner) => Some(_inner),
ListDirectoriesErrorKind::RetryableConflictException(_inner) => Some(_inner),
ListDirectoriesErrorKind::ValidationException(_inner) => Some(_inner),
ListDirectoriesErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `ListFacetAttributes` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ListFacetAttributesError {
/// Kind of error that occurred.
pub kind: ListFacetAttributesErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `ListFacetAttributes` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ListFacetAttributesErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>The specified <a>Facet</a> could not be found.</p>
FacetNotFoundException(crate::error::FacetNotFoundException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that the <code>NextToken</code> value is not valid.</p>
InvalidNextTokenException(crate::error::InvalidNextTokenException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for ListFacetAttributesError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ListFacetAttributesErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
ListFacetAttributesErrorKind::FacetNotFoundException(_inner) => _inner.fmt(f),
ListFacetAttributesErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
ListFacetAttributesErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
ListFacetAttributesErrorKind::InvalidNextTokenException(_inner) => _inner.fmt(f),
ListFacetAttributesErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
ListFacetAttributesErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
ListFacetAttributesErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
ListFacetAttributesErrorKind::ValidationException(_inner) => _inner.fmt(f),
ListFacetAttributesErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ListFacetAttributesError {
fn code(&self) -> Option<&str> {
ListFacetAttributesError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl ListFacetAttributesError {
/// Creates a new `ListFacetAttributesError`.
pub fn new(kind: ListFacetAttributesErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `ListFacetAttributesError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: ListFacetAttributesErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `ListFacetAttributesError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ListFacetAttributesErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `ListFacetAttributesErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
ListFacetAttributesErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `ListFacetAttributesErrorKind::FacetNotFoundException`.
pub fn is_facet_not_found_exception(&self) -> bool {
matches!(
&self.kind,
ListFacetAttributesErrorKind::FacetNotFoundException(_)
)
}
/// Returns `true` if the error kind is `ListFacetAttributesErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
ListFacetAttributesErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `ListFacetAttributesErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(
&self.kind,
ListFacetAttributesErrorKind::InvalidArnException(_)
)
}
/// Returns `true` if the error kind is `ListFacetAttributesErrorKind::InvalidNextTokenException`.
pub fn is_invalid_next_token_exception(&self) -> bool {
matches!(
&self.kind,
ListFacetAttributesErrorKind::InvalidNextTokenException(_)
)
}
/// Returns `true` if the error kind is `ListFacetAttributesErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
ListFacetAttributesErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `ListFacetAttributesErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
ListFacetAttributesErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `ListFacetAttributesErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
ListFacetAttributesErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `ListFacetAttributesErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
ListFacetAttributesErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for ListFacetAttributesError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ListFacetAttributesErrorKind::AccessDeniedException(_inner) => Some(_inner),
ListFacetAttributesErrorKind::FacetNotFoundException(_inner) => Some(_inner),
ListFacetAttributesErrorKind::InternalServiceException(_inner) => Some(_inner),
ListFacetAttributesErrorKind::InvalidArnException(_inner) => Some(_inner),
ListFacetAttributesErrorKind::InvalidNextTokenException(_inner) => Some(_inner),
ListFacetAttributesErrorKind::LimitExceededException(_inner) => Some(_inner),
ListFacetAttributesErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
ListFacetAttributesErrorKind::RetryableConflictException(_inner) => Some(_inner),
ListFacetAttributesErrorKind::ValidationException(_inner) => Some(_inner),
ListFacetAttributesErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `ListFacetNames` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ListFacetNamesError {
/// Kind of error that occurred.
pub kind: ListFacetNamesErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `ListFacetNames` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ListFacetNamesErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that the <code>NextToken</code> value is not valid.</p>
InvalidNextTokenException(crate::error::InvalidNextTokenException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for ListFacetNamesError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ListFacetNamesErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
ListFacetNamesErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
ListFacetNamesErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
ListFacetNamesErrorKind::InvalidNextTokenException(_inner) => _inner.fmt(f),
ListFacetNamesErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
ListFacetNamesErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
ListFacetNamesErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
ListFacetNamesErrorKind::ValidationException(_inner) => _inner.fmt(f),
ListFacetNamesErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ListFacetNamesError {
fn code(&self) -> Option<&str> {
ListFacetNamesError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl ListFacetNamesError {
/// Creates a new `ListFacetNamesError`.
pub fn new(kind: ListFacetNamesErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `ListFacetNamesError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: ListFacetNamesErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `ListFacetNamesError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ListFacetNamesErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `ListFacetNamesErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
ListFacetNamesErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `ListFacetNamesErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
ListFacetNamesErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `ListFacetNamesErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(&self.kind, ListFacetNamesErrorKind::InvalidArnException(_))
}
/// Returns `true` if the error kind is `ListFacetNamesErrorKind::InvalidNextTokenException`.
pub fn is_invalid_next_token_exception(&self) -> bool {
matches!(
&self.kind,
ListFacetNamesErrorKind::InvalidNextTokenException(_)
)
}
/// Returns `true` if the error kind is `ListFacetNamesErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
ListFacetNamesErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `ListFacetNamesErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
ListFacetNamesErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `ListFacetNamesErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
ListFacetNamesErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `ListFacetNamesErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, ListFacetNamesErrorKind::ValidationException(_))
}
}
impl std::error::Error for ListFacetNamesError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ListFacetNamesErrorKind::AccessDeniedException(_inner) => Some(_inner),
ListFacetNamesErrorKind::InternalServiceException(_inner) => Some(_inner),
ListFacetNamesErrorKind::InvalidArnException(_inner) => Some(_inner),
ListFacetNamesErrorKind::InvalidNextTokenException(_inner) => Some(_inner),
ListFacetNamesErrorKind::LimitExceededException(_inner) => Some(_inner),
ListFacetNamesErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
ListFacetNamesErrorKind::RetryableConflictException(_inner) => Some(_inner),
ListFacetNamesErrorKind::ValidationException(_inner) => Some(_inner),
ListFacetNamesErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `ListIncomingTypedLinks` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ListIncomingTypedLinksError {
/// Kind of error that occurred.
pub kind: ListIncomingTypedLinksErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `ListIncomingTypedLinks` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ListIncomingTypedLinksErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Operations are only permitted on enabled directories.</p>
DirectoryNotEnabledException(crate::error::DirectoryNotEnabledException),
/// <p>The <a>Facet</a> that you provided was not well formed or could not be
/// validated with the schema.</p>
FacetValidationException(crate::error::FacetValidationException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that the <code>NextToken</code> value is not valid.</p>
InvalidNextTokenException(crate::error::InvalidNextTokenException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for ListIncomingTypedLinksError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ListIncomingTypedLinksErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
ListIncomingTypedLinksErrorKind::DirectoryNotEnabledException(_inner) => _inner.fmt(f),
ListIncomingTypedLinksErrorKind::FacetValidationException(_inner) => _inner.fmt(f),
ListIncomingTypedLinksErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
ListIncomingTypedLinksErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
ListIncomingTypedLinksErrorKind::InvalidNextTokenException(_inner) => _inner.fmt(f),
ListIncomingTypedLinksErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
ListIncomingTypedLinksErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
ListIncomingTypedLinksErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
ListIncomingTypedLinksErrorKind::ValidationException(_inner) => _inner.fmt(f),
ListIncomingTypedLinksErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ListIncomingTypedLinksError {
fn code(&self) -> Option<&str> {
ListIncomingTypedLinksError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl ListIncomingTypedLinksError {
/// Creates a new `ListIncomingTypedLinksError`.
pub fn new(kind: ListIncomingTypedLinksErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `ListIncomingTypedLinksError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: ListIncomingTypedLinksErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `ListIncomingTypedLinksError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ListIncomingTypedLinksErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `ListIncomingTypedLinksErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
ListIncomingTypedLinksErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `ListIncomingTypedLinksErrorKind::DirectoryNotEnabledException`.
pub fn is_directory_not_enabled_exception(&self) -> bool {
matches!(
&self.kind,
ListIncomingTypedLinksErrorKind::DirectoryNotEnabledException(_)
)
}
/// Returns `true` if the error kind is `ListIncomingTypedLinksErrorKind::FacetValidationException`.
pub fn is_facet_validation_exception(&self) -> bool {
matches!(
&self.kind,
ListIncomingTypedLinksErrorKind::FacetValidationException(_)
)
}
/// Returns `true` if the error kind is `ListIncomingTypedLinksErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
ListIncomingTypedLinksErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `ListIncomingTypedLinksErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(
&self.kind,
ListIncomingTypedLinksErrorKind::InvalidArnException(_)
)
}
/// Returns `true` if the error kind is `ListIncomingTypedLinksErrorKind::InvalidNextTokenException`.
pub fn is_invalid_next_token_exception(&self) -> bool {
matches!(
&self.kind,
ListIncomingTypedLinksErrorKind::InvalidNextTokenException(_)
)
}
/// Returns `true` if the error kind is `ListIncomingTypedLinksErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
ListIncomingTypedLinksErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `ListIncomingTypedLinksErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
ListIncomingTypedLinksErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `ListIncomingTypedLinksErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
ListIncomingTypedLinksErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `ListIncomingTypedLinksErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
ListIncomingTypedLinksErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for ListIncomingTypedLinksError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ListIncomingTypedLinksErrorKind::AccessDeniedException(_inner) => Some(_inner),
ListIncomingTypedLinksErrorKind::DirectoryNotEnabledException(_inner) => Some(_inner),
ListIncomingTypedLinksErrorKind::FacetValidationException(_inner) => Some(_inner),
ListIncomingTypedLinksErrorKind::InternalServiceException(_inner) => Some(_inner),
ListIncomingTypedLinksErrorKind::InvalidArnException(_inner) => Some(_inner),
ListIncomingTypedLinksErrorKind::InvalidNextTokenException(_inner) => Some(_inner),
ListIncomingTypedLinksErrorKind::LimitExceededException(_inner) => Some(_inner),
ListIncomingTypedLinksErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
ListIncomingTypedLinksErrorKind::RetryableConflictException(_inner) => Some(_inner),
ListIncomingTypedLinksErrorKind::ValidationException(_inner) => Some(_inner),
ListIncomingTypedLinksErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `ListIndex` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ListIndexError {
/// Kind of error that occurred.
pub kind: ListIndexErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `ListIndex` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ListIndexErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Operations are only permitted on enabled directories.</p>
DirectoryNotEnabledException(crate::error::DirectoryNotEnabledException),
/// <p>The <a>Facet</a> that you provided was not well formed or could not be
/// validated with the schema.</p>
FacetValidationException(crate::error::FacetValidationException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that the <code>NextToken</code> value is not valid.</p>
InvalidNextTokenException(crate::error::InvalidNextTokenException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>Indicates that the requested operation can only operate on index objects.</p>
NotIndexException(crate::error::NotIndexException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for ListIndexError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ListIndexErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
ListIndexErrorKind::DirectoryNotEnabledException(_inner) => _inner.fmt(f),
ListIndexErrorKind::FacetValidationException(_inner) => _inner.fmt(f),
ListIndexErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
ListIndexErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
ListIndexErrorKind::InvalidNextTokenException(_inner) => _inner.fmt(f),
ListIndexErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
ListIndexErrorKind::NotIndexException(_inner) => _inner.fmt(f),
ListIndexErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
ListIndexErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
ListIndexErrorKind::ValidationException(_inner) => _inner.fmt(f),
ListIndexErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ListIndexError {
fn code(&self) -> Option<&str> {
ListIndexError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl ListIndexError {
/// Creates a new `ListIndexError`.
pub fn new(kind: ListIndexErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `ListIndexError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: ListIndexErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `ListIndexError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ListIndexErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `ListIndexErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(&self.kind, ListIndexErrorKind::AccessDeniedException(_))
}
/// Returns `true` if the error kind is `ListIndexErrorKind::DirectoryNotEnabledException`.
pub fn is_directory_not_enabled_exception(&self) -> bool {
matches!(
&self.kind,
ListIndexErrorKind::DirectoryNotEnabledException(_)
)
}
/// Returns `true` if the error kind is `ListIndexErrorKind::FacetValidationException`.
pub fn is_facet_validation_exception(&self) -> bool {
matches!(&self.kind, ListIndexErrorKind::FacetValidationException(_))
}
/// Returns `true` if the error kind is `ListIndexErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(&self.kind, ListIndexErrorKind::InternalServiceException(_))
}
/// Returns `true` if the error kind is `ListIndexErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(&self.kind, ListIndexErrorKind::InvalidArnException(_))
}
/// Returns `true` if the error kind is `ListIndexErrorKind::InvalidNextTokenException`.
pub fn is_invalid_next_token_exception(&self) -> bool {
matches!(&self.kind, ListIndexErrorKind::InvalidNextTokenException(_))
}
/// Returns `true` if the error kind is `ListIndexErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(&self.kind, ListIndexErrorKind::LimitExceededException(_))
}
/// Returns `true` if the error kind is `ListIndexErrorKind::NotIndexException`.
pub fn is_not_index_exception(&self) -> bool {
matches!(&self.kind, ListIndexErrorKind::NotIndexException(_))
}
/// Returns `true` if the error kind is `ListIndexErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(&self.kind, ListIndexErrorKind::ResourceNotFoundException(_))
}
/// Returns `true` if the error kind is `ListIndexErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
ListIndexErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `ListIndexErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, ListIndexErrorKind::ValidationException(_))
}
}
impl std::error::Error for ListIndexError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ListIndexErrorKind::AccessDeniedException(_inner) => Some(_inner),
ListIndexErrorKind::DirectoryNotEnabledException(_inner) => Some(_inner),
ListIndexErrorKind::FacetValidationException(_inner) => Some(_inner),
ListIndexErrorKind::InternalServiceException(_inner) => Some(_inner),
ListIndexErrorKind::InvalidArnException(_inner) => Some(_inner),
ListIndexErrorKind::InvalidNextTokenException(_inner) => Some(_inner),
ListIndexErrorKind::LimitExceededException(_inner) => Some(_inner),
ListIndexErrorKind::NotIndexException(_inner) => Some(_inner),
ListIndexErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
ListIndexErrorKind::RetryableConflictException(_inner) => Some(_inner),
ListIndexErrorKind::ValidationException(_inner) => Some(_inner),
ListIndexErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `ListManagedSchemaArns` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ListManagedSchemaArnsError {
/// Kind of error that occurred.
pub kind: ListManagedSchemaArnsErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `ListManagedSchemaArns` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ListManagedSchemaArnsErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that the <code>NextToken</code> value is not valid.</p>
InvalidNextTokenException(crate::error::InvalidNextTokenException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for ListManagedSchemaArnsError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ListManagedSchemaArnsErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
ListManagedSchemaArnsErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
ListManagedSchemaArnsErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
ListManagedSchemaArnsErrorKind::InvalidNextTokenException(_inner) => _inner.fmt(f),
ListManagedSchemaArnsErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
ListManagedSchemaArnsErrorKind::ValidationException(_inner) => _inner.fmt(f),
ListManagedSchemaArnsErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ListManagedSchemaArnsError {
fn code(&self) -> Option<&str> {
ListManagedSchemaArnsError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl ListManagedSchemaArnsError {
/// Creates a new `ListManagedSchemaArnsError`.
pub fn new(kind: ListManagedSchemaArnsErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `ListManagedSchemaArnsError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: ListManagedSchemaArnsErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `ListManagedSchemaArnsError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ListManagedSchemaArnsErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `ListManagedSchemaArnsErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
ListManagedSchemaArnsErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `ListManagedSchemaArnsErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
ListManagedSchemaArnsErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `ListManagedSchemaArnsErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(
&self.kind,
ListManagedSchemaArnsErrorKind::InvalidArnException(_)
)
}
/// Returns `true` if the error kind is `ListManagedSchemaArnsErrorKind::InvalidNextTokenException`.
pub fn is_invalid_next_token_exception(&self) -> bool {
matches!(
&self.kind,
ListManagedSchemaArnsErrorKind::InvalidNextTokenException(_)
)
}
/// Returns `true` if the error kind is `ListManagedSchemaArnsErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
ListManagedSchemaArnsErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `ListManagedSchemaArnsErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
ListManagedSchemaArnsErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for ListManagedSchemaArnsError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ListManagedSchemaArnsErrorKind::AccessDeniedException(_inner) => Some(_inner),
ListManagedSchemaArnsErrorKind::InternalServiceException(_inner) => Some(_inner),
ListManagedSchemaArnsErrorKind::InvalidArnException(_inner) => Some(_inner),
ListManagedSchemaArnsErrorKind::InvalidNextTokenException(_inner) => Some(_inner),
ListManagedSchemaArnsErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
ListManagedSchemaArnsErrorKind::ValidationException(_inner) => Some(_inner),
ListManagedSchemaArnsErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `ListObjectAttributes` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ListObjectAttributesError {
/// Kind of error that occurred.
pub kind: ListObjectAttributesErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `ListObjectAttributes` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ListObjectAttributesErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Operations are only permitted on enabled directories.</p>
DirectoryNotEnabledException(crate::error::DirectoryNotEnabledException),
/// <p>The <a>Facet</a> that you provided was not well formed or could not be
/// validated with the schema.</p>
FacetValidationException(crate::error::FacetValidationException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that the <code>NextToken</code> value is not valid.</p>
InvalidNextTokenException(crate::error::InvalidNextTokenException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for ListObjectAttributesError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ListObjectAttributesErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
ListObjectAttributesErrorKind::DirectoryNotEnabledException(_inner) => _inner.fmt(f),
ListObjectAttributesErrorKind::FacetValidationException(_inner) => _inner.fmt(f),
ListObjectAttributesErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
ListObjectAttributesErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
ListObjectAttributesErrorKind::InvalidNextTokenException(_inner) => _inner.fmt(f),
ListObjectAttributesErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
ListObjectAttributesErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
ListObjectAttributesErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
ListObjectAttributesErrorKind::ValidationException(_inner) => _inner.fmt(f),
ListObjectAttributesErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ListObjectAttributesError {
fn code(&self) -> Option<&str> {
ListObjectAttributesError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl ListObjectAttributesError {
/// Creates a new `ListObjectAttributesError`.
pub fn new(kind: ListObjectAttributesErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `ListObjectAttributesError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: ListObjectAttributesErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `ListObjectAttributesError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ListObjectAttributesErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `ListObjectAttributesErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectAttributesErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `ListObjectAttributesErrorKind::DirectoryNotEnabledException`.
pub fn is_directory_not_enabled_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectAttributesErrorKind::DirectoryNotEnabledException(_)
)
}
/// Returns `true` if the error kind is `ListObjectAttributesErrorKind::FacetValidationException`.
pub fn is_facet_validation_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectAttributesErrorKind::FacetValidationException(_)
)
}
/// Returns `true` if the error kind is `ListObjectAttributesErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectAttributesErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `ListObjectAttributesErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectAttributesErrorKind::InvalidArnException(_)
)
}
/// Returns `true` if the error kind is `ListObjectAttributesErrorKind::InvalidNextTokenException`.
pub fn is_invalid_next_token_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectAttributesErrorKind::InvalidNextTokenException(_)
)
}
/// Returns `true` if the error kind is `ListObjectAttributesErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectAttributesErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `ListObjectAttributesErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectAttributesErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `ListObjectAttributesErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectAttributesErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `ListObjectAttributesErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectAttributesErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for ListObjectAttributesError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ListObjectAttributesErrorKind::AccessDeniedException(_inner) => Some(_inner),
ListObjectAttributesErrorKind::DirectoryNotEnabledException(_inner) => Some(_inner),
ListObjectAttributesErrorKind::FacetValidationException(_inner) => Some(_inner),
ListObjectAttributesErrorKind::InternalServiceException(_inner) => Some(_inner),
ListObjectAttributesErrorKind::InvalidArnException(_inner) => Some(_inner),
ListObjectAttributesErrorKind::InvalidNextTokenException(_inner) => Some(_inner),
ListObjectAttributesErrorKind::LimitExceededException(_inner) => Some(_inner),
ListObjectAttributesErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
ListObjectAttributesErrorKind::RetryableConflictException(_inner) => Some(_inner),
ListObjectAttributesErrorKind::ValidationException(_inner) => Some(_inner),
ListObjectAttributesErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `ListObjectChildren` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ListObjectChildrenError {
/// Kind of error that occurred.
pub kind: ListObjectChildrenErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `ListObjectChildren` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ListObjectChildrenErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Operations are only permitted on enabled directories.</p>
DirectoryNotEnabledException(crate::error::DirectoryNotEnabledException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that the <code>NextToken</code> value is not valid.</p>
InvalidNextTokenException(crate::error::InvalidNextTokenException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>Occurs when any invalid operations are performed on an object that is not a node, such
/// as calling <code>ListObjectChildren</code> for a leaf node object.</p>
NotNodeException(crate::error::NotNodeException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for ListObjectChildrenError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ListObjectChildrenErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
ListObjectChildrenErrorKind::DirectoryNotEnabledException(_inner) => _inner.fmt(f),
ListObjectChildrenErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
ListObjectChildrenErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
ListObjectChildrenErrorKind::InvalidNextTokenException(_inner) => _inner.fmt(f),
ListObjectChildrenErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
ListObjectChildrenErrorKind::NotNodeException(_inner) => _inner.fmt(f),
ListObjectChildrenErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
ListObjectChildrenErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
ListObjectChildrenErrorKind::ValidationException(_inner) => _inner.fmt(f),
ListObjectChildrenErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ListObjectChildrenError {
fn code(&self) -> Option<&str> {
ListObjectChildrenError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl ListObjectChildrenError {
/// Creates a new `ListObjectChildrenError`.
pub fn new(kind: ListObjectChildrenErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `ListObjectChildrenError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: ListObjectChildrenErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `ListObjectChildrenError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ListObjectChildrenErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `ListObjectChildrenErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectChildrenErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `ListObjectChildrenErrorKind::DirectoryNotEnabledException`.
pub fn is_directory_not_enabled_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectChildrenErrorKind::DirectoryNotEnabledException(_)
)
}
/// Returns `true` if the error kind is `ListObjectChildrenErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectChildrenErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `ListObjectChildrenErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectChildrenErrorKind::InvalidArnException(_)
)
}
/// Returns `true` if the error kind is `ListObjectChildrenErrorKind::InvalidNextTokenException`.
pub fn is_invalid_next_token_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectChildrenErrorKind::InvalidNextTokenException(_)
)
}
/// Returns `true` if the error kind is `ListObjectChildrenErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectChildrenErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `ListObjectChildrenErrorKind::NotNodeException`.
pub fn is_not_node_exception(&self) -> bool {
matches!(&self.kind, ListObjectChildrenErrorKind::NotNodeException(_))
}
/// Returns `true` if the error kind is `ListObjectChildrenErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectChildrenErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `ListObjectChildrenErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectChildrenErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `ListObjectChildrenErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectChildrenErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for ListObjectChildrenError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ListObjectChildrenErrorKind::AccessDeniedException(_inner) => Some(_inner),
ListObjectChildrenErrorKind::DirectoryNotEnabledException(_inner) => Some(_inner),
ListObjectChildrenErrorKind::InternalServiceException(_inner) => Some(_inner),
ListObjectChildrenErrorKind::InvalidArnException(_inner) => Some(_inner),
ListObjectChildrenErrorKind::InvalidNextTokenException(_inner) => Some(_inner),
ListObjectChildrenErrorKind::LimitExceededException(_inner) => Some(_inner),
ListObjectChildrenErrorKind::NotNodeException(_inner) => Some(_inner),
ListObjectChildrenErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
ListObjectChildrenErrorKind::RetryableConflictException(_inner) => Some(_inner),
ListObjectChildrenErrorKind::ValidationException(_inner) => Some(_inner),
ListObjectChildrenErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `ListObjectParentPaths` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ListObjectParentPathsError {
/// Kind of error that occurred.
pub kind: ListObjectParentPathsErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `ListObjectParentPaths` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ListObjectParentPathsErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Operations are only permitted on enabled directories.</p>
DirectoryNotEnabledException(crate::error::DirectoryNotEnabledException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that the <code>NextToken</code> value is not valid.</p>
InvalidNextTokenException(crate::error::InvalidNextTokenException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for ListObjectParentPathsError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ListObjectParentPathsErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
ListObjectParentPathsErrorKind::DirectoryNotEnabledException(_inner) => _inner.fmt(f),
ListObjectParentPathsErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
ListObjectParentPathsErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
ListObjectParentPathsErrorKind::InvalidNextTokenException(_inner) => _inner.fmt(f),
ListObjectParentPathsErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
ListObjectParentPathsErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
ListObjectParentPathsErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
ListObjectParentPathsErrorKind::ValidationException(_inner) => _inner.fmt(f),
ListObjectParentPathsErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ListObjectParentPathsError {
fn code(&self) -> Option<&str> {
ListObjectParentPathsError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl ListObjectParentPathsError {
/// Creates a new `ListObjectParentPathsError`.
pub fn new(kind: ListObjectParentPathsErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `ListObjectParentPathsError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: ListObjectParentPathsErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `ListObjectParentPathsError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ListObjectParentPathsErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `ListObjectParentPathsErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectParentPathsErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `ListObjectParentPathsErrorKind::DirectoryNotEnabledException`.
pub fn is_directory_not_enabled_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectParentPathsErrorKind::DirectoryNotEnabledException(_)
)
}
/// Returns `true` if the error kind is `ListObjectParentPathsErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectParentPathsErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `ListObjectParentPathsErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectParentPathsErrorKind::InvalidArnException(_)
)
}
/// Returns `true` if the error kind is `ListObjectParentPathsErrorKind::InvalidNextTokenException`.
pub fn is_invalid_next_token_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectParentPathsErrorKind::InvalidNextTokenException(_)
)
}
/// Returns `true` if the error kind is `ListObjectParentPathsErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectParentPathsErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `ListObjectParentPathsErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectParentPathsErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `ListObjectParentPathsErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectParentPathsErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `ListObjectParentPathsErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectParentPathsErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for ListObjectParentPathsError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ListObjectParentPathsErrorKind::AccessDeniedException(_inner) => Some(_inner),
ListObjectParentPathsErrorKind::DirectoryNotEnabledException(_inner) => Some(_inner),
ListObjectParentPathsErrorKind::InternalServiceException(_inner) => Some(_inner),
ListObjectParentPathsErrorKind::InvalidArnException(_inner) => Some(_inner),
ListObjectParentPathsErrorKind::InvalidNextTokenException(_inner) => Some(_inner),
ListObjectParentPathsErrorKind::LimitExceededException(_inner) => Some(_inner),
ListObjectParentPathsErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
ListObjectParentPathsErrorKind::RetryableConflictException(_inner) => Some(_inner),
ListObjectParentPathsErrorKind::ValidationException(_inner) => Some(_inner),
ListObjectParentPathsErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `ListObjectParents` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ListObjectParentsError {
/// Kind of error that occurred.
pub kind: ListObjectParentsErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `ListObjectParents` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ListObjectParentsErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Cannot list the parents of a <a>Directory</a> root.</p>
CannotListParentOfRootException(crate::error::CannotListParentOfRootException),
/// <p>Operations are only permitted on enabled directories.</p>
DirectoryNotEnabledException(crate::error::DirectoryNotEnabledException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that the <code>NextToken</code> value is not valid.</p>
InvalidNextTokenException(crate::error::InvalidNextTokenException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for ListObjectParentsError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ListObjectParentsErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
ListObjectParentsErrorKind::CannotListParentOfRootException(_inner) => _inner.fmt(f),
ListObjectParentsErrorKind::DirectoryNotEnabledException(_inner) => _inner.fmt(f),
ListObjectParentsErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
ListObjectParentsErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
ListObjectParentsErrorKind::InvalidNextTokenException(_inner) => _inner.fmt(f),
ListObjectParentsErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
ListObjectParentsErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
ListObjectParentsErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
ListObjectParentsErrorKind::ValidationException(_inner) => _inner.fmt(f),
ListObjectParentsErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ListObjectParentsError {
fn code(&self) -> Option<&str> {
ListObjectParentsError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl ListObjectParentsError {
/// Creates a new `ListObjectParentsError`.
pub fn new(kind: ListObjectParentsErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `ListObjectParentsError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: ListObjectParentsErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `ListObjectParentsError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ListObjectParentsErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `ListObjectParentsErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectParentsErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `ListObjectParentsErrorKind::CannotListParentOfRootException`.
pub fn is_cannot_list_parent_of_root_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectParentsErrorKind::CannotListParentOfRootException(_)
)
}
/// Returns `true` if the error kind is `ListObjectParentsErrorKind::DirectoryNotEnabledException`.
pub fn is_directory_not_enabled_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectParentsErrorKind::DirectoryNotEnabledException(_)
)
}
/// Returns `true` if the error kind is `ListObjectParentsErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectParentsErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `ListObjectParentsErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectParentsErrorKind::InvalidArnException(_)
)
}
/// Returns `true` if the error kind is `ListObjectParentsErrorKind::InvalidNextTokenException`.
pub fn is_invalid_next_token_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectParentsErrorKind::InvalidNextTokenException(_)
)
}
/// Returns `true` if the error kind is `ListObjectParentsErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectParentsErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `ListObjectParentsErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectParentsErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `ListObjectParentsErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectParentsErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `ListObjectParentsErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectParentsErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for ListObjectParentsError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ListObjectParentsErrorKind::AccessDeniedException(_inner) => Some(_inner),
ListObjectParentsErrorKind::CannotListParentOfRootException(_inner) => Some(_inner),
ListObjectParentsErrorKind::DirectoryNotEnabledException(_inner) => Some(_inner),
ListObjectParentsErrorKind::InternalServiceException(_inner) => Some(_inner),
ListObjectParentsErrorKind::InvalidArnException(_inner) => Some(_inner),
ListObjectParentsErrorKind::InvalidNextTokenException(_inner) => Some(_inner),
ListObjectParentsErrorKind::LimitExceededException(_inner) => Some(_inner),
ListObjectParentsErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
ListObjectParentsErrorKind::RetryableConflictException(_inner) => Some(_inner),
ListObjectParentsErrorKind::ValidationException(_inner) => Some(_inner),
ListObjectParentsErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `ListObjectPolicies` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ListObjectPoliciesError {
/// Kind of error that occurred.
pub kind: ListObjectPoliciesErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `ListObjectPolicies` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ListObjectPoliciesErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Operations are only permitted on enabled directories.</p>
DirectoryNotEnabledException(crate::error::DirectoryNotEnabledException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that the <code>NextToken</code> value is not valid.</p>
InvalidNextTokenException(crate::error::InvalidNextTokenException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for ListObjectPoliciesError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ListObjectPoliciesErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
ListObjectPoliciesErrorKind::DirectoryNotEnabledException(_inner) => _inner.fmt(f),
ListObjectPoliciesErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
ListObjectPoliciesErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
ListObjectPoliciesErrorKind::InvalidNextTokenException(_inner) => _inner.fmt(f),
ListObjectPoliciesErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
ListObjectPoliciesErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
ListObjectPoliciesErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
ListObjectPoliciesErrorKind::ValidationException(_inner) => _inner.fmt(f),
ListObjectPoliciesErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ListObjectPoliciesError {
fn code(&self) -> Option<&str> {
ListObjectPoliciesError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl ListObjectPoliciesError {
/// Creates a new `ListObjectPoliciesError`.
pub fn new(kind: ListObjectPoliciesErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `ListObjectPoliciesError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: ListObjectPoliciesErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `ListObjectPoliciesError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ListObjectPoliciesErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `ListObjectPoliciesErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectPoliciesErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `ListObjectPoliciesErrorKind::DirectoryNotEnabledException`.
pub fn is_directory_not_enabled_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectPoliciesErrorKind::DirectoryNotEnabledException(_)
)
}
/// Returns `true` if the error kind is `ListObjectPoliciesErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectPoliciesErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `ListObjectPoliciesErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectPoliciesErrorKind::InvalidArnException(_)
)
}
/// Returns `true` if the error kind is `ListObjectPoliciesErrorKind::InvalidNextTokenException`.
pub fn is_invalid_next_token_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectPoliciesErrorKind::InvalidNextTokenException(_)
)
}
/// Returns `true` if the error kind is `ListObjectPoliciesErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectPoliciesErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `ListObjectPoliciesErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectPoliciesErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `ListObjectPoliciesErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectPoliciesErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `ListObjectPoliciesErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
ListObjectPoliciesErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for ListObjectPoliciesError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ListObjectPoliciesErrorKind::AccessDeniedException(_inner) => Some(_inner),
ListObjectPoliciesErrorKind::DirectoryNotEnabledException(_inner) => Some(_inner),
ListObjectPoliciesErrorKind::InternalServiceException(_inner) => Some(_inner),
ListObjectPoliciesErrorKind::InvalidArnException(_inner) => Some(_inner),
ListObjectPoliciesErrorKind::InvalidNextTokenException(_inner) => Some(_inner),
ListObjectPoliciesErrorKind::LimitExceededException(_inner) => Some(_inner),
ListObjectPoliciesErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
ListObjectPoliciesErrorKind::RetryableConflictException(_inner) => Some(_inner),
ListObjectPoliciesErrorKind::ValidationException(_inner) => Some(_inner),
ListObjectPoliciesErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `ListOutgoingTypedLinks` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ListOutgoingTypedLinksError {
/// Kind of error that occurred.
pub kind: ListOutgoingTypedLinksErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `ListOutgoingTypedLinks` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ListOutgoingTypedLinksErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Operations are only permitted on enabled directories.</p>
DirectoryNotEnabledException(crate::error::DirectoryNotEnabledException),
/// <p>The <a>Facet</a> that you provided was not well formed or could not be
/// validated with the schema.</p>
FacetValidationException(crate::error::FacetValidationException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that the <code>NextToken</code> value is not valid.</p>
InvalidNextTokenException(crate::error::InvalidNextTokenException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for ListOutgoingTypedLinksError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ListOutgoingTypedLinksErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
ListOutgoingTypedLinksErrorKind::DirectoryNotEnabledException(_inner) => _inner.fmt(f),
ListOutgoingTypedLinksErrorKind::FacetValidationException(_inner) => _inner.fmt(f),
ListOutgoingTypedLinksErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
ListOutgoingTypedLinksErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
ListOutgoingTypedLinksErrorKind::InvalidNextTokenException(_inner) => _inner.fmt(f),
ListOutgoingTypedLinksErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
ListOutgoingTypedLinksErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
ListOutgoingTypedLinksErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
ListOutgoingTypedLinksErrorKind::ValidationException(_inner) => _inner.fmt(f),
ListOutgoingTypedLinksErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ListOutgoingTypedLinksError {
fn code(&self) -> Option<&str> {
ListOutgoingTypedLinksError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl ListOutgoingTypedLinksError {
/// Creates a new `ListOutgoingTypedLinksError`.
pub fn new(kind: ListOutgoingTypedLinksErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `ListOutgoingTypedLinksError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: ListOutgoingTypedLinksErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `ListOutgoingTypedLinksError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ListOutgoingTypedLinksErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `ListOutgoingTypedLinksErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
ListOutgoingTypedLinksErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `ListOutgoingTypedLinksErrorKind::DirectoryNotEnabledException`.
pub fn is_directory_not_enabled_exception(&self) -> bool {
matches!(
&self.kind,
ListOutgoingTypedLinksErrorKind::DirectoryNotEnabledException(_)
)
}
/// Returns `true` if the error kind is `ListOutgoingTypedLinksErrorKind::FacetValidationException`.
pub fn is_facet_validation_exception(&self) -> bool {
matches!(
&self.kind,
ListOutgoingTypedLinksErrorKind::FacetValidationException(_)
)
}
/// Returns `true` if the error kind is `ListOutgoingTypedLinksErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
ListOutgoingTypedLinksErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `ListOutgoingTypedLinksErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(
&self.kind,
ListOutgoingTypedLinksErrorKind::InvalidArnException(_)
)
}
/// Returns `true` if the error kind is `ListOutgoingTypedLinksErrorKind::InvalidNextTokenException`.
pub fn is_invalid_next_token_exception(&self) -> bool {
matches!(
&self.kind,
ListOutgoingTypedLinksErrorKind::InvalidNextTokenException(_)
)
}
/// Returns `true` if the error kind is `ListOutgoingTypedLinksErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
ListOutgoingTypedLinksErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `ListOutgoingTypedLinksErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
ListOutgoingTypedLinksErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `ListOutgoingTypedLinksErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
ListOutgoingTypedLinksErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `ListOutgoingTypedLinksErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
ListOutgoingTypedLinksErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for ListOutgoingTypedLinksError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ListOutgoingTypedLinksErrorKind::AccessDeniedException(_inner) => Some(_inner),
ListOutgoingTypedLinksErrorKind::DirectoryNotEnabledException(_inner) => Some(_inner),
ListOutgoingTypedLinksErrorKind::FacetValidationException(_inner) => Some(_inner),
ListOutgoingTypedLinksErrorKind::InternalServiceException(_inner) => Some(_inner),
ListOutgoingTypedLinksErrorKind::InvalidArnException(_inner) => Some(_inner),
ListOutgoingTypedLinksErrorKind::InvalidNextTokenException(_inner) => Some(_inner),
ListOutgoingTypedLinksErrorKind::LimitExceededException(_inner) => Some(_inner),
ListOutgoingTypedLinksErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
ListOutgoingTypedLinksErrorKind::RetryableConflictException(_inner) => Some(_inner),
ListOutgoingTypedLinksErrorKind::ValidationException(_inner) => Some(_inner),
ListOutgoingTypedLinksErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `ListPolicyAttachments` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ListPolicyAttachmentsError {
/// Kind of error that occurred.
pub kind: ListPolicyAttachmentsErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `ListPolicyAttachments` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ListPolicyAttachmentsErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Operations are only permitted on enabled directories.</p>
DirectoryNotEnabledException(crate::error::DirectoryNotEnabledException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that the <code>NextToken</code> value is not valid.</p>
InvalidNextTokenException(crate::error::InvalidNextTokenException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>Indicates that the requested operation can only operate on policy objects.</p>
NotPolicyException(crate::error::NotPolicyException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for ListPolicyAttachmentsError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ListPolicyAttachmentsErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
ListPolicyAttachmentsErrorKind::DirectoryNotEnabledException(_inner) => _inner.fmt(f),
ListPolicyAttachmentsErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
ListPolicyAttachmentsErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
ListPolicyAttachmentsErrorKind::InvalidNextTokenException(_inner) => _inner.fmt(f),
ListPolicyAttachmentsErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
ListPolicyAttachmentsErrorKind::NotPolicyException(_inner) => _inner.fmt(f),
ListPolicyAttachmentsErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
ListPolicyAttachmentsErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
ListPolicyAttachmentsErrorKind::ValidationException(_inner) => _inner.fmt(f),
ListPolicyAttachmentsErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ListPolicyAttachmentsError {
fn code(&self) -> Option<&str> {
ListPolicyAttachmentsError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl ListPolicyAttachmentsError {
/// Creates a new `ListPolicyAttachmentsError`.
pub fn new(kind: ListPolicyAttachmentsErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `ListPolicyAttachmentsError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: ListPolicyAttachmentsErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `ListPolicyAttachmentsError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ListPolicyAttachmentsErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `ListPolicyAttachmentsErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
ListPolicyAttachmentsErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `ListPolicyAttachmentsErrorKind::DirectoryNotEnabledException`.
pub fn is_directory_not_enabled_exception(&self) -> bool {
matches!(
&self.kind,
ListPolicyAttachmentsErrorKind::DirectoryNotEnabledException(_)
)
}
/// Returns `true` if the error kind is `ListPolicyAttachmentsErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
ListPolicyAttachmentsErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `ListPolicyAttachmentsErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(
&self.kind,
ListPolicyAttachmentsErrorKind::InvalidArnException(_)
)
}
/// Returns `true` if the error kind is `ListPolicyAttachmentsErrorKind::InvalidNextTokenException`.
pub fn is_invalid_next_token_exception(&self) -> bool {
matches!(
&self.kind,
ListPolicyAttachmentsErrorKind::InvalidNextTokenException(_)
)
}
/// Returns `true` if the error kind is `ListPolicyAttachmentsErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
ListPolicyAttachmentsErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `ListPolicyAttachmentsErrorKind::NotPolicyException`.
pub fn is_not_policy_exception(&self) -> bool {
matches!(
&self.kind,
ListPolicyAttachmentsErrorKind::NotPolicyException(_)
)
}
/// Returns `true` if the error kind is `ListPolicyAttachmentsErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
ListPolicyAttachmentsErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `ListPolicyAttachmentsErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
ListPolicyAttachmentsErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `ListPolicyAttachmentsErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
ListPolicyAttachmentsErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for ListPolicyAttachmentsError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ListPolicyAttachmentsErrorKind::AccessDeniedException(_inner) => Some(_inner),
ListPolicyAttachmentsErrorKind::DirectoryNotEnabledException(_inner) => Some(_inner),
ListPolicyAttachmentsErrorKind::InternalServiceException(_inner) => Some(_inner),
ListPolicyAttachmentsErrorKind::InvalidArnException(_inner) => Some(_inner),
ListPolicyAttachmentsErrorKind::InvalidNextTokenException(_inner) => Some(_inner),
ListPolicyAttachmentsErrorKind::LimitExceededException(_inner) => Some(_inner),
ListPolicyAttachmentsErrorKind::NotPolicyException(_inner) => Some(_inner),
ListPolicyAttachmentsErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
ListPolicyAttachmentsErrorKind::RetryableConflictException(_inner) => Some(_inner),
ListPolicyAttachmentsErrorKind::ValidationException(_inner) => Some(_inner),
ListPolicyAttachmentsErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `ListPublishedSchemaArns` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ListPublishedSchemaArnsError {
/// Kind of error that occurred.
pub kind: ListPublishedSchemaArnsErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `ListPublishedSchemaArns` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ListPublishedSchemaArnsErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that the <code>NextToken</code> value is not valid.</p>
InvalidNextTokenException(crate::error::InvalidNextTokenException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for ListPublishedSchemaArnsError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ListPublishedSchemaArnsErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
ListPublishedSchemaArnsErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
ListPublishedSchemaArnsErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
ListPublishedSchemaArnsErrorKind::InvalidNextTokenException(_inner) => _inner.fmt(f),
ListPublishedSchemaArnsErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
ListPublishedSchemaArnsErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
ListPublishedSchemaArnsErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
ListPublishedSchemaArnsErrorKind::ValidationException(_inner) => _inner.fmt(f),
ListPublishedSchemaArnsErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ListPublishedSchemaArnsError {
fn code(&self) -> Option<&str> {
ListPublishedSchemaArnsError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl ListPublishedSchemaArnsError {
/// Creates a new `ListPublishedSchemaArnsError`.
pub fn new(kind: ListPublishedSchemaArnsErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `ListPublishedSchemaArnsError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: ListPublishedSchemaArnsErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `ListPublishedSchemaArnsError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ListPublishedSchemaArnsErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `ListPublishedSchemaArnsErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
ListPublishedSchemaArnsErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `ListPublishedSchemaArnsErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
ListPublishedSchemaArnsErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `ListPublishedSchemaArnsErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(
&self.kind,
ListPublishedSchemaArnsErrorKind::InvalidArnException(_)
)
}
/// Returns `true` if the error kind is `ListPublishedSchemaArnsErrorKind::InvalidNextTokenException`.
pub fn is_invalid_next_token_exception(&self) -> bool {
matches!(
&self.kind,
ListPublishedSchemaArnsErrorKind::InvalidNextTokenException(_)
)
}
/// Returns `true` if the error kind is `ListPublishedSchemaArnsErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
ListPublishedSchemaArnsErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `ListPublishedSchemaArnsErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
ListPublishedSchemaArnsErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `ListPublishedSchemaArnsErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
ListPublishedSchemaArnsErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `ListPublishedSchemaArnsErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
ListPublishedSchemaArnsErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for ListPublishedSchemaArnsError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ListPublishedSchemaArnsErrorKind::AccessDeniedException(_inner) => Some(_inner),
ListPublishedSchemaArnsErrorKind::InternalServiceException(_inner) => Some(_inner),
ListPublishedSchemaArnsErrorKind::InvalidArnException(_inner) => Some(_inner),
ListPublishedSchemaArnsErrorKind::InvalidNextTokenException(_inner) => Some(_inner),
ListPublishedSchemaArnsErrorKind::LimitExceededException(_inner) => Some(_inner),
ListPublishedSchemaArnsErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
ListPublishedSchemaArnsErrorKind::RetryableConflictException(_inner) => Some(_inner),
ListPublishedSchemaArnsErrorKind::ValidationException(_inner) => Some(_inner),
ListPublishedSchemaArnsErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `ListTagsForResource` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ListTagsForResourceError {
/// Kind of error that occurred.
pub kind: ListTagsForResourceErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `ListTagsForResource` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ListTagsForResourceErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Can occur for multiple reasons such as when you tag a resource that doesn’t exist or if you specify a higher number of tags for a resource than the allowed limit. Allowed limit is 50 tags per resource.</p>
InvalidTaggingRequestException(crate::error::InvalidTaggingRequestException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for ListTagsForResourceError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ListTagsForResourceErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
ListTagsForResourceErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
ListTagsForResourceErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
ListTagsForResourceErrorKind::InvalidTaggingRequestException(_inner) => _inner.fmt(f),
ListTagsForResourceErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
ListTagsForResourceErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
ListTagsForResourceErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
ListTagsForResourceErrorKind::ValidationException(_inner) => _inner.fmt(f),
ListTagsForResourceErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ListTagsForResourceError {
fn code(&self) -> Option<&str> {
ListTagsForResourceError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl ListTagsForResourceError {
/// Creates a new `ListTagsForResourceError`.
pub fn new(kind: ListTagsForResourceErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `ListTagsForResourceError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: ListTagsForResourceErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `ListTagsForResourceError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ListTagsForResourceErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `ListTagsForResourceErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
ListTagsForResourceErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `ListTagsForResourceErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
ListTagsForResourceErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `ListTagsForResourceErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(
&self.kind,
ListTagsForResourceErrorKind::InvalidArnException(_)
)
}
/// Returns `true` if the error kind is `ListTagsForResourceErrorKind::InvalidTaggingRequestException`.
pub fn is_invalid_tagging_request_exception(&self) -> bool {
matches!(
&self.kind,
ListTagsForResourceErrorKind::InvalidTaggingRequestException(_)
)
}
/// Returns `true` if the error kind is `ListTagsForResourceErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
ListTagsForResourceErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `ListTagsForResourceErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
ListTagsForResourceErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `ListTagsForResourceErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
ListTagsForResourceErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `ListTagsForResourceErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
ListTagsForResourceErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for ListTagsForResourceError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ListTagsForResourceErrorKind::AccessDeniedException(_inner) => Some(_inner),
ListTagsForResourceErrorKind::InternalServiceException(_inner) => Some(_inner),
ListTagsForResourceErrorKind::InvalidArnException(_inner) => Some(_inner),
ListTagsForResourceErrorKind::InvalidTaggingRequestException(_inner) => Some(_inner),
ListTagsForResourceErrorKind::LimitExceededException(_inner) => Some(_inner),
ListTagsForResourceErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
ListTagsForResourceErrorKind::RetryableConflictException(_inner) => Some(_inner),
ListTagsForResourceErrorKind::ValidationException(_inner) => Some(_inner),
ListTagsForResourceErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `ListTypedLinkFacetAttributes` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ListTypedLinkFacetAttributesError {
/// Kind of error that occurred.
pub kind: ListTypedLinkFacetAttributesErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `ListTypedLinkFacetAttributes` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ListTypedLinkFacetAttributesErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>The specified <a>Facet</a> could not be found.</p>
FacetNotFoundException(crate::error::FacetNotFoundException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that the <code>NextToken</code> value is not valid.</p>
InvalidNextTokenException(crate::error::InvalidNextTokenException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for ListTypedLinkFacetAttributesError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ListTypedLinkFacetAttributesErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
ListTypedLinkFacetAttributesErrorKind::FacetNotFoundException(_inner) => _inner.fmt(f),
ListTypedLinkFacetAttributesErrorKind::InternalServiceException(_inner) => {
_inner.fmt(f)
}
ListTypedLinkFacetAttributesErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
ListTypedLinkFacetAttributesErrorKind::InvalidNextTokenException(_inner) => {
_inner.fmt(f)
}
ListTypedLinkFacetAttributesErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
ListTypedLinkFacetAttributesErrorKind::ResourceNotFoundException(_inner) => {
_inner.fmt(f)
}
ListTypedLinkFacetAttributesErrorKind::RetryableConflictException(_inner) => {
_inner.fmt(f)
}
ListTypedLinkFacetAttributesErrorKind::ValidationException(_inner) => _inner.fmt(f),
ListTypedLinkFacetAttributesErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ListTypedLinkFacetAttributesError {
fn code(&self) -> Option<&str> {
ListTypedLinkFacetAttributesError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl ListTypedLinkFacetAttributesError {
/// Creates a new `ListTypedLinkFacetAttributesError`.
pub fn new(kind: ListTypedLinkFacetAttributesErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `ListTypedLinkFacetAttributesError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: ListTypedLinkFacetAttributesErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `ListTypedLinkFacetAttributesError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ListTypedLinkFacetAttributesErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `ListTypedLinkFacetAttributesErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
ListTypedLinkFacetAttributesErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `ListTypedLinkFacetAttributesErrorKind::FacetNotFoundException`.
pub fn is_facet_not_found_exception(&self) -> bool {
matches!(
&self.kind,
ListTypedLinkFacetAttributesErrorKind::FacetNotFoundException(_)
)
}
/// Returns `true` if the error kind is `ListTypedLinkFacetAttributesErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
ListTypedLinkFacetAttributesErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `ListTypedLinkFacetAttributesErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(
&self.kind,
ListTypedLinkFacetAttributesErrorKind::InvalidArnException(_)
)
}
/// Returns `true` if the error kind is `ListTypedLinkFacetAttributesErrorKind::InvalidNextTokenException`.
pub fn is_invalid_next_token_exception(&self) -> bool {
matches!(
&self.kind,
ListTypedLinkFacetAttributesErrorKind::InvalidNextTokenException(_)
)
}
/// Returns `true` if the error kind is `ListTypedLinkFacetAttributesErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
ListTypedLinkFacetAttributesErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `ListTypedLinkFacetAttributesErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
ListTypedLinkFacetAttributesErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `ListTypedLinkFacetAttributesErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
ListTypedLinkFacetAttributesErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `ListTypedLinkFacetAttributesErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
ListTypedLinkFacetAttributesErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for ListTypedLinkFacetAttributesError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ListTypedLinkFacetAttributesErrorKind::AccessDeniedException(_inner) => Some(_inner),
ListTypedLinkFacetAttributesErrorKind::FacetNotFoundException(_inner) => Some(_inner),
ListTypedLinkFacetAttributesErrorKind::InternalServiceException(_inner) => Some(_inner),
ListTypedLinkFacetAttributesErrorKind::InvalidArnException(_inner) => Some(_inner),
ListTypedLinkFacetAttributesErrorKind::InvalidNextTokenException(_inner) => {
Some(_inner)
}
ListTypedLinkFacetAttributesErrorKind::LimitExceededException(_inner) => Some(_inner),
ListTypedLinkFacetAttributesErrorKind::ResourceNotFoundException(_inner) => {
Some(_inner)
}
ListTypedLinkFacetAttributesErrorKind::RetryableConflictException(_inner) => {
Some(_inner)
}
ListTypedLinkFacetAttributesErrorKind::ValidationException(_inner) => Some(_inner),
ListTypedLinkFacetAttributesErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `ListTypedLinkFacetNames` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct ListTypedLinkFacetNamesError {
/// Kind of error that occurred.
pub kind: ListTypedLinkFacetNamesErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `ListTypedLinkFacetNames` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum ListTypedLinkFacetNamesErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that the <code>NextToken</code> value is not valid.</p>
InvalidNextTokenException(crate::error::InvalidNextTokenException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for ListTypedLinkFacetNamesError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
ListTypedLinkFacetNamesErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
ListTypedLinkFacetNamesErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
ListTypedLinkFacetNamesErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
ListTypedLinkFacetNamesErrorKind::InvalidNextTokenException(_inner) => _inner.fmt(f),
ListTypedLinkFacetNamesErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
ListTypedLinkFacetNamesErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
ListTypedLinkFacetNamesErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
ListTypedLinkFacetNamesErrorKind::ValidationException(_inner) => _inner.fmt(f),
ListTypedLinkFacetNamesErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for ListTypedLinkFacetNamesError {
fn code(&self) -> Option<&str> {
ListTypedLinkFacetNamesError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl ListTypedLinkFacetNamesError {
/// Creates a new `ListTypedLinkFacetNamesError`.
pub fn new(kind: ListTypedLinkFacetNamesErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `ListTypedLinkFacetNamesError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: ListTypedLinkFacetNamesErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `ListTypedLinkFacetNamesError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: ListTypedLinkFacetNamesErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `ListTypedLinkFacetNamesErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
ListTypedLinkFacetNamesErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `ListTypedLinkFacetNamesErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
ListTypedLinkFacetNamesErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `ListTypedLinkFacetNamesErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(
&self.kind,
ListTypedLinkFacetNamesErrorKind::InvalidArnException(_)
)
}
/// Returns `true` if the error kind is `ListTypedLinkFacetNamesErrorKind::InvalidNextTokenException`.
pub fn is_invalid_next_token_exception(&self) -> bool {
matches!(
&self.kind,
ListTypedLinkFacetNamesErrorKind::InvalidNextTokenException(_)
)
}
/// Returns `true` if the error kind is `ListTypedLinkFacetNamesErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
ListTypedLinkFacetNamesErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `ListTypedLinkFacetNamesErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
ListTypedLinkFacetNamesErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `ListTypedLinkFacetNamesErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
ListTypedLinkFacetNamesErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `ListTypedLinkFacetNamesErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
ListTypedLinkFacetNamesErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for ListTypedLinkFacetNamesError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
ListTypedLinkFacetNamesErrorKind::AccessDeniedException(_inner) => Some(_inner),
ListTypedLinkFacetNamesErrorKind::InternalServiceException(_inner) => Some(_inner),
ListTypedLinkFacetNamesErrorKind::InvalidArnException(_inner) => Some(_inner),
ListTypedLinkFacetNamesErrorKind::InvalidNextTokenException(_inner) => Some(_inner),
ListTypedLinkFacetNamesErrorKind::LimitExceededException(_inner) => Some(_inner),
ListTypedLinkFacetNamesErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
ListTypedLinkFacetNamesErrorKind::RetryableConflictException(_inner) => Some(_inner),
ListTypedLinkFacetNamesErrorKind::ValidationException(_inner) => Some(_inner),
ListTypedLinkFacetNamesErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `LookupPolicy` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct LookupPolicyError {
/// Kind of error that occurred.
pub kind: LookupPolicyErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `LookupPolicy` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum LookupPolicyErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Operations are only permitted on enabled directories.</p>
DirectoryNotEnabledException(crate::error::DirectoryNotEnabledException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that the <code>NextToken</code> value is not valid.</p>
InvalidNextTokenException(crate::error::InvalidNextTokenException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for LookupPolicyError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
LookupPolicyErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
LookupPolicyErrorKind::DirectoryNotEnabledException(_inner) => _inner.fmt(f),
LookupPolicyErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
LookupPolicyErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
LookupPolicyErrorKind::InvalidNextTokenException(_inner) => _inner.fmt(f),
LookupPolicyErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
LookupPolicyErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
LookupPolicyErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
LookupPolicyErrorKind::ValidationException(_inner) => _inner.fmt(f),
LookupPolicyErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for LookupPolicyError {
fn code(&self) -> Option<&str> {
LookupPolicyError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl LookupPolicyError {
/// Creates a new `LookupPolicyError`.
pub fn new(kind: LookupPolicyErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `LookupPolicyError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: LookupPolicyErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `LookupPolicyError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: LookupPolicyErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `LookupPolicyErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(&self.kind, LookupPolicyErrorKind::AccessDeniedException(_))
}
/// Returns `true` if the error kind is `LookupPolicyErrorKind::DirectoryNotEnabledException`.
pub fn is_directory_not_enabled_exception(&self) -> bool {
matches!(
&self.kind,
LookupPolicyErrorKind::DirectoryNotEnabledException(_)
)
}
/// Returns `true` if the error kind is `LookupPolicyErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
LookupPolicyErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `LookupPolicyErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(&self.kind, LookupPolicyErrorKind::InvalidArnException(_))
}
/// Returns `true` if the error kind is `LookupPolicyErrorKind::InvalidNextTokenException`.
pub fn is_invalid_next_token_exception(&self) -> bool {
matches!(
&self.kind,
LookupPolicyErrorKind::InvalidNextTokenException(_)
)
}
/// Returns `true` if the error kind is `LookupPolicyErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(&self.kind, LookupPolicyErrorKind::LimitExceededException(_))
}
/// Returns `true` if the error kind is `LookupPolicyErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
LookupPolicyErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `LookupPolicyErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
LookupPolicyErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `LookupPolicyErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, LookupPolicyErrorKind::ValidationException(_))
}
}
impl std::error::Error for LookupPolicyError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
LookupPolicyErrorKind::AccessDeniedException(_inner) => Some(_inner),
LookupPolicyErrorKind::DirectoryNotEnabledException(_inner) => Some(_inner),
LookupPolicyErrorKind::InternalServiceException(_inner) => Some(_inner),
LookupPolicyErrorKind::InvalidArnException(_inner) => Some(_inner),
LookupPolicyErrorKind::InvalidNextTokenException(_inner) => Some(_inner),
LookupPolicyErrorKind::LimitExceededException(_inner) => Some(_inner),
LookupPolicyErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
LookupPolicyErrorKind::RetryableConflictException(_inner) => Some(_inner),
LookupPolicyErrorKind::ValidationException(_inner) => Some(_inner),
LookupPolicyErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `PublishSchema` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct PublishSchemaError {
/// Kind of error that occurred.
pub kind: PublishSchemaErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `PublishSchema` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum PublishSchemaErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that a schema is already published.</p>
SchemaAlreadyPublishedException(crate::error::SchemaAlreadyPublishedException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for PublishSchemaError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
PublishSchemaErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
PublishSchemaErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
PublishSchemaErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
PublishSchemaErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
PublishSchemaErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
PublishSchemaErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
PublishSchemaErrorKind::SchemaAlreadyPublishedException(_inner) => _inner.fmt(f),
PublishSchemaErrorKind::ValidationException(_inner) => _inner.fmt(f),
PublishSchemaErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for PublishSchemaError {
fn code(&self) -> Option<&str> {
PublishSchemaError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl PublishSchemaError {
/// Creates a new `PublishSchemaError`.
pub fn new(kind: PublishSchemaErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `PublishSchemaError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: PublishSchemaErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `PublishSchemaError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: PublishSchemaErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `PublishSchemaErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(&self.kind, PublishSchemaErrorKind::AccessDeniedException(_))
}
/// Returns `true` if the error kind is `PublishSchemaErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
PublishSchemaErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `PublishSchemaErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(&self.kind, PublishSchemaErrorKind::InvalidArnException(_))
}
/// Returns `true` if the error kind is `PublishSchemaErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
PublishSchemaErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `PublishSchemaErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
PublishSchemaErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `PublishSchemaErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
PublishSchemaErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `PublishSchemaErrorKind::SchemaAlreadyPublishedException`.
pub fn is_schema_already_published_exception(&self) -> bool {
matches!(
&self.kind,
PublishSchemaErrorKind::SchemaAlreadyPublishedException(_)
)
}
/// Returns `true` if the error kind is `PublishSchemaErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, PublishSchemaErrorKind::ValidationException(_))
}
}
impl std::error::Error for PublishSchemaError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
PublishSchemaErrorKind::AccessDeniedException(_inner) => Some(_inner),
PublishSchemaErrorKind::InternalServiceException(_inner) => Some(_inner),
PublishSchemaErrorKind::InvalidArnException(_inner) => Some(_inner),
PublishSchemaErrorKind::LimitExceededException(_inner) => Some(_inner),
PublishSchemaErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
PublishSchemaErrorKind::RetryableConflictException(_inner) => Some(_inner),
PublishSchemaErrorKind::SchemaAlreadyPublishedException(_inner) => Some(_inner),
PublishSchemaErrorKind::ValidationException(_inner) => Some(_inner),
PublishSchemaErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `PutSchemaFromJson` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct PutSchemaFromJsonError {
/// Kind of error that occurred.
pub kind: PutSchemaFromJsonErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `PutSchemaFromJson` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum PutSchemaFromJsonErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Occurs when any of the rule parameter keys or values are invalid.</p>
InvalidRuleException(crate::error::InvalidRuleException),
/// <p>Indicates that the provided <code>SchemaDoc</code> value is not valid.</p>
InvalidSchemaDocException(crate::error::InvalidSchemaDocException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for PutSchemaFromJsonError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
PutSchemaFromJsonErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
PutSchemaFromJsonErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
PutSchemaFromJsonErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
PutSchemaFromJsonErrorKind::InvalidRuleException(_inner) => _inner.fmt(f),
PutSchemaFromJsonErrorKind::InvalidSchemaDocException(_inner) => _inner.fmt(f),
PutSchemaFromJsonErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
PutSchemaFromJsonErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
PutSchemaFromJsonErrorKind::ValidationException(_inner) => _inner.fmt(f),
PutSchemaFromJsonErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for PutSchemaFromJsonError {
fn code(&self) -> Option<&str> {
PutSchemaFromJsonError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl PutSchemaFromJsonError {
/// Creates a new `PutSchemaFromJsonError`.
pub fn new(kind: PutSchemaFromJsonErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `PutSchemaFromJsonError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: PutSchemaFromJsonErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `PutSchemaFromJsonError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: PutSchemaFromJsonErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `PutSchemaFromJsonErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
PutSchemaFromJsonErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `PutSchemaFromJsonErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
PutSchemaFromJsonErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `PutSchemaFromJsonErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(
&self.kind,
PutSchemaFromJsonErrorKind::InvalidArnException(_)
)
}
/// Returns `true` if the error kind is `PutSchemaFromJsonErrorKind::InvalidRuleException`.
pub fn is_invalid_rule_exception(&self) -> bool {
matches!(
&self.kind,
PutSchemaFromJsonErrorKind::InvalidRuleException(_)
)
}
/// Returns `true` if the error kind is `PutSchemaFromJsonErrorKind::InvalidSchemaDocException`.
pub fn is_invalid_schema_doc_exception(&self) -> bool {
matches!(
&self.kind,
PutSchemaFromJsonErrorKind::InvalidSchemaDocException(_)
)
}
/// Returns `true` if the error kind is `PutSchemaFromJsonErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
PutSchemaFromJsonErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `PutSchemaFromJsonErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
PutSchemaFromJsonErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `PutSchemaFromJsonErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
PutSchemaFromJsonErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for PutSchemaFromJsonError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
PutSchemaFromJsonErrorKind::AccessDeniedException(_inner) => Some(_inner),
PutSchemaFromJsonErrorKind::InternalServiceException(_inner) => Some(_inner),
PutSchemaFromJsonErrorKind::InvalidArnException(_inner) => Some(_inner),
PutSchemaFromJsonErrorKind::InvalidRuleException(_inner) => Some(_inner),
PutSchemaFromJsonErrorKind::InvalidSchemaDocException(_inner) => Some(_inner),
PutSchemaFromJsonErrorKind::LimitExceededException(_inner) => Some(_inner),
PutSchemaFromJsonErrorKind::RetryableConflictException(_inner) => Some(_inner),
PutSchemaFromJsonErrorKind::ValidationException(_inner) => Some(_inner),
PutSchemaFromJsonErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `RemoveFacetFromObject` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct RemoveFacetFromObjectError {
/// Kind of error that occurred.
pub kind: RemoveFacetFromObjectErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `RemoveFacetFromObject` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum RemoveFacetFromObjectErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Operations are only permitted on enabled directories.</p>
DirectoryNotEnabledException(crate::error::DirectoryNotEnabledException),
/// <p>The <a>Facet</a> that you provided was not well formed or could not be
/// validated with the schema.</p>
FacetValidationException(crate::error::FacetValidationException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for RemoveFacetFromObjectError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
RemoveFacetFromObjectErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
RemoveFacetFromObjectErrorKind::DirectoryNotEnabledException(_inner) => _inner.fmt(f),
RemoveFacetFromObjectErrorKind::FacetValidationException(_inner) => _inner.fmt(f),
RemoveFacetFromObjectErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
RemoveFacetFromObjectErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
RemoveFacetFromObjectErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
RemoveFacetFromObjectErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
RemoveFacetFromObjectErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
RemoveFacetFromObjectErrorKind::ValidationException(_inner) => _inner.fmt(f),
RemoveFacetFromObjectErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for RemoveFacetFromObjectError {
fn code(&self) -> Option<&str> {
RemoveFacetFromObjectError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl RemoveFacetFromObjectError {
/// Creates a new `RemoveFacetFromObjectError`.
pub fn new(kind: RemoveFacetFromObjectErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `RemoveFacetFromObjectError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: RemoveFacetFromObjectErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `RemoveFacetFromObjectError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: RemoveFacetFromObjectErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `RemoveFacetFromObjectErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
RemoveFacetFromObjectErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `RemoveFacetFromObjectErrorKind::DirectoryNotEnabledException`.
pub fn is_directory_not_enabled_exception(&self) -> bool {
matches!(
&self.kind,
RemoveFacetFromObjectErrorKind::DirectoryNotEnabledException(_)
)
}
/// Returns `true` if the error kind is `RemoveFacetFromObjectErrorKind::FacetValidationException`.
pub fn is_facet_validation_exception(&self) -> bool {
matches!(
&self.kind,
RemoveFacetFromObjectErrorKind::FacetValidationException(_)
)
}
/// Returns `true` if the error kind is `RemoveFacetFromObjectErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
RemoveFacetFromObjectErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `RemoveFacetFromObjectErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(
&self.kind,
RemoveFacetFromObjectErrorKind::InvalidArnException(_)
)
}
/// Returns `true` if the error kind is `RemoveFacetFromObjectErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
RemoveFacetFromObjectErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `RemoveFacetFromObjectErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
RemoveFacetFromObjectErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `RemoveFacetFromObjectErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
RemoveFacetFromObjectErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `RemoveFacetFromObjectErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
RemoveFacetFromObjectErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for RemoveFacetFromObjectError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
RemoveFacetFromObjectErrorKind::AccessDeniedException(_inner) => Some(_inner),
RemoveFacetFromObjectErrorKind::DirectoryNotEnabledException(_inner) => Some(_inner),
RemoveFacetFromObjectErrorKind::FacetValidationException(_inner) => Some(_inner),
RemoveFacetFromObjectErrorKind::InternalServiceException(_inner) => Some(_inner),
RemoveFacetFromObjectErrorKind::InvalidArnException(_inner) => Some(_inner),
RemoveFacetFromObjectErrorKind::LimitExceededException(_inner) => Some(_inner),
RemoveFacetFromObjectErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
RemoveFacetFromObjectErrorKind::RetryableConflictException(_inner) => Some(_inner),
RemoveFacetFromObjectErrorKind::ValidationException(_inner) => Some(_inner),
RemoveFacetFromObjectErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `TagResource` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct TagResourceError {
/// Kind of error that occurred.
pub kind: TagResourceErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `TagResource` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum TagResourceErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Can occur for multiple reasons such as when you tag a resource that doesn’t exist or if you specify a higher number of tags for a resource than the allowed limit. Allowed limit is 50 tags per resource.</p>
InvalidTaggingRequestException(crate::error::InvalidTaggingRequestException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for TagResourceError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
TagResourceErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
TagResourceErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
TagResourceErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
TagResourceErrorKind::InvalidTaggingRequestException(_inner) => _inner.fmt(f),
TagResourceErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
TagResourceErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
TagResourceErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
TagResourceErrorKind::ValidationException(_inner) => _inner.fmt(f),
TagResourceErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for TagResourceError {
fn code(&self) -> Option<&str> {
TagResourceError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl TagResourceError {
/// Creates a new `TagResourceError`.
pub fn new(kind: TagResourceErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `TagResourceError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: TagResourceErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `TagResourceError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: TagResourceErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `TagResourceErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(&self.kind, TagResourceErrorKind::AccessDeniedException(_))
}
/// Returns `true` if the error kind is `TagResourceErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
TagResourceErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `TagResourceErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(&self.kind, TagResourceErrorKind::InvalidArnException(_))
}
/// Returns `true` if the error kind is `TagResourceErrorKind::InvalidTaggingRequestException`.
pub fn is_invalid_tagging_request_exception(&self) -> bool {
matches!(
&self.kind,
TagResourceErrorKind::InvalidTaggingRequestException(_)
)
}
/// Returns `true` if the error kind is `TagResourceErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(&self.kind, TagResourceErrorKind::LimitExceededException(_))
}
/// Returns `true` if the error kind is `TagResourceErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
TagResourceErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `TagResourceErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
TagResourceErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `TagResourceErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, TagResourceErrorKind::ValidationException(_))
}
}
impl std::error::Error for TagResourceError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
TagResourceErrorKind::AccessDeniedException(_inner) => Some(_inner),
TagResourceErrorKind::InternalServiceException(_inner) => Some(_inner),
TagResourceErrorKind::InvalidArnException(_inner) => Some(_inner),
TagResourceErrorKind::InvalidTaggingRequestException(_inner) => Some(_inner),
TagResourceErrorKind::LimitExceededException(_inner) => Some(_inner),
TagResourceErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
TagResourceErrorKind::RetryableConflictException(_inner) => Some(_inner),
TagResourceErrorKind::ValidationException(_inner) => Some(_inner),
TagResourceErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `UntagResource` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct UntagResourceError {
/// Kind of error that occurred.
pub kind: UntagResourceErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `UntagResource` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum UntagResourceErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Can occur for multiple reasons such as when you tag a resource that doesn’t exist or if you specify a higher number of tags for a resource than the allowed limit. Allowed limit is 50 tags per resource.</p>
InvalidTaggingRequestException(crate::error::InvalidTaggingRequestException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for UntagResourceError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
UntagResourceErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
UntagResourceErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
UntagResourceErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
UntagResourceErrorKind::InvalidTaggingRequestException(_inner) => _inner.fmt(f),
UntagResourceErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
UntagResourceErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
UntagResourceErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
UntagResourceErrorKind::ValidationException(_inner) => _inner.fmt(f),
UntagResourceErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for UntagResourceError {
fn code(&self) -> Option<&str> {
UntagResourceError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl UntagResourceError {
/// Creates a new `UntagResourceError`.
pub fn new(kind: UntagResourceErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `UntagResourceError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: UntagResourceErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `UntagResourceError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: UntagResourceErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `UntagResourceErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(&self.kind, UntagResourceErrorKind::AccessDeniedException(_))
}
/// Returns `true` if the error kind is `UntagResourceErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
UntagResourceErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `UntagResourceErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(&self.kind, UntagResourceErrorKind::InvalidArnException(_))
}
/// Returns `true` if the error kind is `UntagResourceErrorKind::InvalidTaggingRequestException`.
pub fn is_invalid_tagging_request_exception(&self) -> bool {
matches!(
&self.kind,
UntagResourceErrorKind::InvalidTaggingRequestException(_)
)
}
/// Returns `true` if the error kind is `UntagResourceErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
UntagResourceErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `UntagResourceErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
UntagResourceErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `UntagResourceErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
UntagResourceErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `UntagResourceErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, UntagResourceErrorKind::ValidationException(_))
}
}
impl std::error::Error for UntagResourceError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
UntagResourceErrorKind::AccessDeniedException(_inner) => Some(_inner),
UntagResourceErrorKind::InternalServiceException(_inner) => Some(_inner),
UntagResourceErrorKind::InvalidArnException(_inner) => Some(_inner),
UntagResourceErrorKind::InvalidTaggingRequestException(_inner) => Some(_inner),
UntagResourceErrorKind::LimitExceededException(_inner) => Some(_inner),
UntagResourceErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
UntagResourceErrorKind::RetryableConflictException(_inner) => Some(_inner),
UntagResourceErrorKind::ValidationException(_inner) => Some(_inner),
UntagResourceErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `UpdateFacet` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct UpdateFacetError {
/// Kind of error that occurred.
pub kind: UpdateFacetErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `UpdateFacet` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum UpdateFacetErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>The specified <a>Facet</a> could not be found.</p>
FacetNotFoundException(crate::error::FacetNotFoundException),
/// <p>The <a>Facet</a> that you provided was not well formed or could not be
/// validated with the schema.</p>
FacetValidationException(crate::error::FacetValidationException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>An attempt to modify a <a>Facet</a> resulted in an invalid schema
/// exception.</p>
InvalidFacetUpdateException(crate::error::InvalidFacetUpdateException),
/// <p>Occurs when any of the rule parameter keys or values are invalid.</p>
InvalidRuleException(crate::error::InvalidRuleException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for UpdateFacetError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
UpdateFacetErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
UpdateFacetErrorKind::FacetNotFoundException(_inner) => _inner.fmt(f),
UpdateFacetErrorKind::FacetValidationException(_inner) => _inner.fmt(f),
UpdateFacetErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
UpdateFacetErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
UpdateFacetErrorKind::InvalidFacetUpdateException(_inner) => _inner.fmt(f),
UpdateFacetErrorKind::InvalidRuleException(_inner) => _inner.fmt(f),
UpdateFacetErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
UpdateFacetErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
UpdateFacetErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
UpdateFacetErrorKind::ValidationException(_inner) => _inner.fmt(f),
UpdateFacetErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for UpdateFacetError {
fn code(&self) -> Option<&str> {
UpdateFacetError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl UpdateFacetError {
/// Creates a new `UpdateFacetError`.
pub fn new(kind: UpdateFacetErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `UpdateFacetError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: UpdateFacetErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `UpdateFacetError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: UpdateFacetErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `UpdateFacetErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(&self.kind, UpdateFacetErrorKind::AccessDeniedException(_))
}
/// Returns `true` if the error kind is `UpdateFacetErrorKind::FacetNotFoundException`.
pub fn is_facet_not_found_exception(&self) -> bool {
matches!(&self.kind, UpdateFacetErrorKind::FacetNotFoundException(_))
}
/// Returns `true` if the error kind is `UpdateFacetErrorKind::FacetValidationException`.
pub fn is_facet_validation_exception(&self) -> bool {
matches!(
&self.kind,
UpdateFacetErrorKind::FacetValidationException(_)
)
}
/// Returns `true` if the error kind is `UpdateFacetErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
UpdateFacetErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `UpdateFacetErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(&self.kind, UpdateFacetErrorKind::InvalidArnException(_))
}
/// Returns `true` if the error kind is `UpdateFacetErrorKind::InvalidFacetUpdateException`.
pub fn is_invalid_facet_update_exception(&self) -> bool {
matches!(
&self.kind,
UpdateFacetErrorKind::InvalidFacetUpdateException(_)
)
}
/// Returns `true` if the error kind is `UpdateFacetErrorKind::InvalidRuleException`.
pub fn is_invalid_rule_exception(&self) -> bool {
matches!(&self.kind, UpdateFacetErrorKind::InvalidRuleException(_))
}
/// Returns `true` if the error kind is `UpdateFacetErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(&self.kind, UpdateFacetErrorKind::LimitExceededException(_))
}
/// Returns `true` if the error kind is `UpdateFacetErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
UpdateFacetErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `UpdateFacetErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
UpdateFacetErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `UpdateFacetErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, UpdateFacetErrorKind::ValidationException(_))
}
}
impl std::error::Error for UpdateFacetError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
UpdateFacetErrorKind::AccessDeniedException(_inner) => Some(_inner),
UpdateFacetErrorKind::FacetNotFoundException(_inner) => Some(_inner),
UpdateFacetErrorKind::FacetValidationException(_inner) => Some(_inner),
UpdateFacetErrorKind::InternalServiceException(_inner) => Some(_inner),
UpdateFacetErrorKind::InvalidArnException(_inner) => Some(_inner),
UpdateFacetErrorKind::InvalidFacetUpdateException(_inner) => Some(_inner),
UpdateFacetErrorKind::InvalidRuleException(_inner) => Some(_inner),
UpdateFacetErrorKind::LimitExceededException(_inner) => Some(_inner),
UpdateFacetErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
UpdateFacetErrorKind::RetryableConflictException(_inner) => Some(_inner),
UpdateFacetErrorKind::ValidationException(_inner) => Some(_inner),
UpdateFacetErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `UpdateLinkAttributes` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct UpdateLinkAttributesError {
/// Kind of error that occurred.
pub kind: UpdateLinkAttributesErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `UpdateLinkAttributes` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum UpdateLinkAttributesErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Operations are only permitted on enabled directories.</p>
DirectoryNotEnabledException(crate::error::DirectoryNotEnabledException),
/// <p>The <a>Facet</a> that you provided was not well formed or could not be
/// validated with the schema.</p>
FacetValidationException(crate::error::FacetValidationException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for UpdateLinkAttributesError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
UpdateLinkAttributesErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
UpdateLinkAttributesErrorKind::DirectoryNotEnabledException(_inner) => _inner.fmt(f),
UpdateLinkAttributesErrorKind::FacetValidationException(_inner) => _inner.fmt(f),
UpdateLinkAttributesErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
UpdateLinkAttributesErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
UpdateLinkAttributesErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
UpdateLinkAttributesErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
UpdateLinkAttributesErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
UpdateLinkAttributesErrorKind::ValidationException(_inner) => _inner.fmt(f),
UpdateLinkAttributesErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for UpdateLinkAttributesError {
fn code(&self) -> Option<&str> {
UpdateLinkAttributesError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl UpdateLinkAttributesError {
/// Creates a new `UpdateLinkAttributesError`.
pub fn new(kind: UpdateLinkAttributesErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `UpdateLinkAttributesError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: UpdateLinkAttributesErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `UpdateLinkAttributesError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: UpdateLinkAttributesErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `UpdateLinkAttributesErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
UpdateLinkAttributesErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `UpdateLinkAttributesErrorKind::DirectoryNotEnabledException`.
pub fn is_directory_not_enabled_exception(&self) -> bool {
matches!(
&self.kind,
UpdateLinkAttributesErrorKind::DirectoryNotEnabledException(_)
)
}
/// Returns `true` if the error kind is `UpdateLinkAttributesErrorKind::FacetValidationException`.
pub fn is_facet_validation_exception(&self) -> bool {
matches!(
&self.kind,
UpdateLinkAttributesErrorKind::FacetValidationException(_)
)
}
/// Returns `true` if the error kind is `UpdateLinkAttributesErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
UpdateLinkAttributesErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `UpdateLinkAttributesErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(
&self.kind,
UpdateLinkAttributesErrorKind::InvalidArnException(_)
)
}
/// Returns `true` if the error kind is `UpdateLinkAttributesErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
UpdateLinkAttributesErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `UpdateLinkAttributesErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
UpdateLinkAttributesErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `UpdateLinkAttributesErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
UpdateLinkAttributesErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `UpdateLinkAttributesErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
UpdateLinkAttributesErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for UpdateLinkAttributesError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
UpdateLinkAttributesErrorKind::AccessDeniedException(_inner) => Some(_inner),
UpdateLinkAttributesErrorKind::DirectoryNotEnabledException(_inner) => Some(_inner),
UpdateLinkAttributesErrorKind::FacetValidationException(_inner) => Some(_inner),
UpdateLinkAttributesErrorKind::InternalServiceException(_inner) => Some(_inner),
UpdateLinkAttributesErrorKind::InvalidArnException(_inner) => Some(_inner),
UpdateLinkAttributesErrorKind::LimitExceededException(_inner) => Some(_inner),
UpdateLinkAttributesErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
UpdateLinkAttributesErrorKind::RetryableConflictException(_inner) => Some(_inner),
UpdateLinkAttributesErrorKind::ValidationException(_inner) => Some(_inner),
UpdateLinkAttributesErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `UpdateObjectAttributes` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct UpdateObjectAttributesError {
/// Kind of error that occurred.
pub kind: UpdateObjectAttributesErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `UpdateObjectAttributes` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum UpdateObjectAttributesErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Operations are only permitted on enabled directories.</p>
DirectoryNotEnabledException(crate::error::DirectoryNotEnabledException),
/// <p>The <a>Facet</a> that you provided was not well formed or could not be
/// validated with the schema.</p>
FacetValidationException(crate::error::FacetValidationException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>Indicates that a link could not be created due to a naming conflict. Choose a different
/// name and then try again.</p>
LinkNameAlreadyInUseException(crate::error::LinkNameAlreadyInUseException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for UpdateObjectAttributesError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
UpdateObjectAttributesErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
UpdateObjectAttributesErrorKind::DirectoryNotEnabledException(_inner) => _inner.fmt(f),
UpdateObjectAttributesErrorKind::FacetValidationException(_inner) => _inner.fmt(f),
UpdateObjectAttributesErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
UpdateObjectAttributesErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
UpdateObjectAttributesErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
UpdateObjectAttributesErrorKind::LinkNameAlreadyInUseException(_inner) => _inner.fmt(f),
UpdateObjectAttributesErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
UpdateObjectAttributesErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
UpdateObjectAttributesErrorKind::ValidationException(_inner) => _inner.fmt(f),
UpdateObjectAttributesErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for UpdateObjectAttributesError {
fn code(&self) -> Option<&str> {
UpdateObjectAttributesError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl UpdateObjectAttributesError {
/// Creates a new `UpdateObjectAttributesError`.
pub fn new(kind: UpdateObjectAttributesErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `UpdateObjectAttributesError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: UpdateObjectAttributesErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `UpdateObjectAttributesError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: UpdateObjectAttributesErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `UpdateObjectAttributesErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
UpdateObjectAttributesErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `UpdateObjectAttributesErrorKind::DirectoryNotEnabledException`.
pub fn is_directory_not_enabled_exception(&self) -> bool {
matches!(
&self.kind,
UpdateObjectAttributesErrorKind::DirectoryNotEnabledException(_)
)
}
/// Returns `true` if the error kind is `UpdateObjectAttributesErrorKind::FacetValidationException`.
pub fn is_facet_validation_exception(&self) -> bool {
matches!(
&self.kind,
UpdateObjectAttributesErrorKind::FacetValidationException(_)
)
}
/// Returns `true` if the error kind is `UpdateObjectAttributesErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
UpdateObjectAttributesErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `UpdateObjectAttributesErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(
&self.kind,
UpdateObjectAttributesErrorKind::InvalidArnException(_)
)
}
/// Returns `true` if the error kind is `UpdateObjectAttributesErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
UpdateObjectAttributesErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `UpdateObjectAttributesErrorKind::LinkNameAlreadyInUseException`.
pub fn is_link_name_already_in_use_exception(&self) -> bool {
matches!(
&self.kind,
UpdateObjectAttributesErrorKind::LinkNameAlreadyInUseException(_)
)
}
/// Returns `true` if the error kind is `UpdateObjectAttributesErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
UpdateObjectAttributesErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `UpdateObjectAttributesErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
UpdateObjectAttributesErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `UpdateObjectAttributesErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
UpdateObjectAttributesErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for UpdateObjectAttributesError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
UpdateObjectAttributesErrorKind::AccessDeniedException(_inner) => Some(_inner),
UpdateObjectAttributesErrorKind::DirectoryNotEnabledException(_inner) => Some(_inner),
UpdateObjectAttributesErrorKind::FacetValidationException(_inner) => Some(_inner),
UpdateObjectAttributesErrorKind::InternalServiceException(_inner) => Some(_inner),
UpdateObjectAttributesErrorKind::InvalidArnException(_inner) => Some(_inner),
UpdateObjectAttributesErrorKind::LimitExceededException(_inner) => Some(_inner),
UpdateObjectAttributesErrorKind::LinkNameAlreadyInUseException(_inner) => Some(_inner),
UpdateObjectAttributesErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
UpdateObjectAttributesErrorKind::RetryableConflictException(_inner) => Some(_inner),
UpdateObjectAttributesErrorKind::ValidationException(_inner) => Some(_inner),
UpdateObjectAttributesErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `UpdateSchema` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct UpdateSchemaError {
/// Kind of error that occurred.
pub kind: UpdateSchemaErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `UpdateSchema` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum UpdateSchemaErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for UpdateSchemaError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
UpdateSchemaErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
UpdateSchemaErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
UpdateSchemaErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
UpdateSchemaErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
UpdateSchemaErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
UpdateSchemaErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
UpdateSchemaErrorKind::ValidationException(_inner) => _inner.fmt(f),
UpdateSchemaErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for UpdateSchemaError {
fn code(&self) -> Option<&str> {
UpdateSchemaError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl UpdateSchemaError {
/// Creates a new `UpdateSchemaError`.
pub fn new(kind: UpdateSchemaErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `UpdateSchemaError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: UpdateSchemaErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `UpdateSchemaError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: UpdateSchemaErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `UpdateSchemaErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(&self.kind, UpdateSchemaErrorKind::AccessDeniedException(_))
}
/// Returns `true` if the error kind is `UpdateSchemaErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
UpdateSchemaErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `UpdateSchemaErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(&self.kind, UpdateSchemaErrorKind::InvalidArnException(_))
}
/// Returns `true` if the error kind is `UpdateSchemaErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(&self.kind, UpdateSchemaErrorKind::LimitExceededException(_))
}
/// Returns `true` if the error kind is `UpdateSchemaErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
UpdateSchemaErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `UpdateSchemaErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
UpdateSchemaErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `UpdateSchemaErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(&self.kind, UpdateSchemaErrorKind::ValidationException(_))
}
}
impl std::error::Error for UpdateSchemaError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
UpdateSchemaErrorKind::AccessDeniedException(_inner) => Some(_inner),
UpdateSchemaErrorKind::InternalServiceException(_inner) => Some(_inner),
UpdateSchemaErrorKind::InvalidArnException(_inner) => Some(_inner),
UpdateSchemaErrorKind::LimitExceededException(_inner) => Some(_inner),
UpdateSchemaErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
UpdateSchemaErrorKind::RetryableConflictException(_inner) => Some(_inner),
UpdateSchemaErrorKind::ValidationException(_inner) => Some(_inner),
UpdateSchemaErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `UpdateTypedLinkFacet` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct UpdateTypedLinkFacetError {
/// Kind of error that occurred.
pub kind: UpdateTypedLinkFacetErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `UpdateTypedLinkFacet` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum UpdateTypedLinkFacetErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>The specified <a>Facet</a> could not be found.</p>
FacetNotFoundException(crate::error::FacetNotFoundException),
/// <p>The <a>Facet</a> that you provided was not well formed or could not be
/// validated with the schema.</p>
FacetValidationException(crate::error::FacetValidationException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>An attempt to modify a <a>Facet</a> resulted in an invalid schema
/// exception.</p>
InvalidFacetUpdateException(crate::error::InvalidFacetUpdateException),
/// <p>Occurs when any of the rule parameter keys or values are invalid.</p>
InvalidRuleException(crate::error::InvalidRuleException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for UpdateTypedLinkFacetError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
UpdateTypedLinkFacetErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
UpdateTypedLinkFacetErrorKind::FacetNotFoundException(_inner) => _inner.fmt(f),
UpdateTypedLinkFacetErrorKind::FacetValidationException(_inner) => _inner.fmt(f),
UpdateTypedLinkFacetErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
UpdateTypedLinkFacetErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
UpdateTypedLinkFacetErrorKind::InvalidFacetUpdateException(_inner) => _inner.fmt(f),
UpdateTypedLinkFacetErrorKind::InvalidRuleException(_inner) => _inner.fmt(f),
UpdateTypedLinkFacetErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
UpdateTypedLinkFacetErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
UpdateTypedLinkFacetErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
UpdateTypedLinkFacetErrorKind::ValidationException(_inner) => _inner.fmt(f),
UpdateTypedLinkFacetErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for UpdateTypedLinkFacetError {
fn code(&self) -> Option<&str> {
UpdateTypedLinkFacetError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl UpdateTypedLinkFacetError {
/// Creates a new `UpdateTypedLinkFacetError`.
pub fn new(kind: UpdateTypedLinkFacetErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `UpdateTypedLinkFacetError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: UpdateTypedLinkFacetErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `UpdateTypedLinkFacetError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: UpdateTypedLinkFacetErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `UpdateTypedLinkFacetErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
UpdateTypedLinkFacetErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `UpdateTypedLinkFacetErrorKind::FacetNotFoundException`.
pub fn is_facet_not_found_exception(&self) -> bool {
matches!(
&self.kind,
UpdateTypedLinkFacetErrorKind::FacetNotFoundException(_)
)
}
/// Returns `true` if the error kind is `UpdateTypedLinkFacetErrorKind::FacetValidationException`.
pub fn is_facet_validation_exception(&self) -> bool {
matches!(
&self.kind,
UpdateTypedLinkFacetErrorKind::FacetValidationException(_)
)
}
/// Returns `true` if the error kind is `UpdateTypedLinkFacetErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
UpdateTypedLinkFacetErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `UpdateTypedLinkFacetErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(
&self.kind,
UpdateTypedLinkFacetErrorKind::InvalidArnException(_)
)
}
/// Returns `true` if the error kind is `UpdateTypedLinkFacetErrorKind::InvalidFacetUpdateException`.
pub fn is_invalid_facet_update_exception(&self) -> bool {
matches!(
&self.kind,
UpdateTypedLinkFacetErrorKind::InvalidFacetUpdateException(_)
)
}
/// Returns `true` if the error kind is `UpdateTypedLinkFacetErrorKind::InvalidRuleException`.
pub fn is_invalid_rule_exception(&self) -> bool {
matches!(
&self.kind,
UpdateTypedLinkFacetErrorKind::InvalidRuleException(_)
)
}
/// Returns `true` if the error kind is `UpdateTypedLinkFacetErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
UpdateTypedLinkFacetErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `UpdateTypedLinkFacetErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
UpdateTypedLinkFacetErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `UpdateTypedLinkFacetErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
UpdateTypedLinkFacetErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `UpdateTypedLinkFacetErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
UpdateTypedLinkFacetErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for UpdateTypedLinkFacetError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
UpdateTypedLinkFacetErrorKind::AccessDeniedException(_inner) => Some(_inner),
UpdateTypedLinkFacetErrorKind::FacetNotFoundException(_inner) => Some(_inner),
UpdateTypedLinkFacetErrorKind::FacetValidationException(_inner) => Some(_inner),
UpdateTypedLinkFacetErrorKind::InternalServiceException(_inner) => Some(_inner),
UpdateTypedLinkFacetErrorKind::InvalidArnException(_inner) => Some(_inner),
UpdateTypedLinkFacetErrorKind::InvalidFacetUpdateException(_inner) => Some(_inner),
UpdateTypedLinkFacetErrorKind::InvalidRuleException(_inner) => Some(_inner),
UpdateTypedLinkFacetErrorKind::LimitExceededException(_inner) => Some(_inner),
UpdateTypedLinkFacetErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
UpdateTypedLinkFacetErrorKind::RetryableConflictException(_inner) => Some(_inner),
UpdateTypedLinkFacetErrorKind::ValidationException(_inner) => Some(_inner),
UpdateTypedLinkFacetErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `UpgradeAppliedSchema` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct UpgradeAppliedSchemaError {
/// Kind of error that occurred.
pub kind: UpgradeAppliedSchemaErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `UpgradeAppliedSchema` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum UpgradeAppliedSchemaErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Indicates a failure occurred while performing a check for backward compatibility between the specified schema and the schema that is currently applied to the directory.</p>
IncompatibleSchemaException(crate::error::IncompatibleSchemaException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that an attempt to make an attachment was invalid. For example, attaching two nodes
/// with a link type that is not applicable to the nodes or attempting to apply a schema to a directory a second time.</p>
InvalidAttachmentException(crate::error::InvalidAttachmentException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that a schema could not be created due to a naming conflict. Please select a
/// different name and then try again.</p>
SchemaAlreadyExistsException(crate::error::SchemaAlreadyExistsException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for UpgradeAppliedSchemaError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
UpgradeAppliedSchemaErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
UpgradeAppliedSchemaErrorKind::IncompatibleSchemaException(_inner) => _inner.fmt(f),
UpgradeAppliedSchemaErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
UpgradeAppliedSchemaErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
UpgradeAppliedSchemaErrorKind::InvalidAttachmentException(_inner) => _inner.fmt(f),
UpgradeAppliedSchemaErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
UpgradeAppliedSchemaErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
UpgradeAppliedSchemaErrorKind::SchemaAlreadyExistsException(_inner) => _inner.fmt(f),
UpgradeAppliedSchemaErrorKind::ValidationException(_inner) => _inner.fmt(f),
UpgradeAppliedSchemaErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for UpgradeAppliedSchemaError {
fn code(&self) -> Option<&str> {
UpgradeAppliedSchemaError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl UpgradeAppliedSchemaError {
/// Creates a new `UpgradeAppliedSchemaError`.
pub fn new(kind: UpgradeAppliedSchemaErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `UpgradeAppliedSchemaError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: UpgradeAppliedSchemaErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `UpgradeAppliedSchemaError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: UpgradeAppliedSchemaErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `UpgradeAppliedSchemaErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
UpgradeAppliedSchemaErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `UpgradeAppliedSchemaErrorKind::IncompatibleSchemaException`.
pub fn is_incompatible_schema_exception(&self) -> bool {
matches!(
&self.kind,
UpgradeAppliedSchemaErrorKind::IncompatibleSchemaException(_)
)
}
/// Returns `true` if the error kind is `UpgradeAppliedSchemaErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
UpgradeAppliedSchemaErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `UpgradeAppliedSchemaErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(
&self.kind,
UpgradeAppliedSchemaErrorKind::InvalidArnException(_)
)
}
/// Returns `true` if the error kind is `UpgradeAppliedSchemaErrorKind::InvalidAttachmentException`.
pub fn is_invalid_attachment_exception(&self) -> bool {
matches!(
&self.kind,
UpgradeAppliedSchemaErrorKind::InvalidAttachmentException(_)
)
}
/// Returns `true` if the error kind is `UpgradeAppliedSchemaErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
UpgradeAppliedSchemaErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `UpgradeAppliedSchemaErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
UpgradeAppliedSchemaErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `UpgradeAppliedSchemaErrorKind::SchemaAlreadyExistsException`.
pub fn is_schema_already_exists_exception(&self) -> bool {
matches!(
&self.kind,
UpgradeAppliedSchemaErrorKind::SchemaAlreadyExistsException(_)
)
}
/// Returns `true` if the error kind is `UpgradeAppliedSchemaErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
UpgradeAppliedSchemaErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for UpgradeAppliedSchemaError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
UpgradeAppliedSchemaErrorKind::AccessDeniedException(_inner) => Some(_inner),
UpgradeAppliedSchemaErrorKind::IncompatibleSchemaException(_inner) => Some(_inner),
UpgradeAppliedSchemaErrorKind::InternalServiceException(_inner) => Some(_inner),
UpgradeAppliedSchemaErrorKind::InvalidArnException(_inner) => Some(_inner),
UpgradeAppliedSchemaErrorKind::InvalidAttachmentException(_inner) => Some(_inner),
UpgradeAppliedSchemaErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
UpgradeAppliedSchemaErrorKind::RetryableConflictException(_inner) => Some(_inner),
UpgradeAppliedSchemaErrorKind::SchemaAlreadyExistsException(_inner) => Some(_inner),
UpgradeAppliedSchemaErrorKind::ValidationException(_inner) => Some(_inner),
UpgradeAppliedSchemaErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// Error type for the `UpgradePublishedSchema` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct UpgradePublishedSchemaError {
/// Kind of error that occurred.
pub kind: UpgradePublishedSchemaErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur for the `UpgradePublishedSchema` operation.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum UpgradePublishedSchemaErrorKind {
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
AccessDeniedException(crate::error::AccessDeniedException),
/// <p>Indicates a failure occurred while performing a check for backward compatibility between the specified schema and the schema that is currently applied to the directory.</p>
IncompatibleSchemaException(crate::error::IncompatibleSchemaException),
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
InternalServiceException(crate::error::InternalServiceException),
/// <p>Indicates that the provided ARN value is not valid.</p>
InvalidArnException(crate::error::InvalidArnException),
/// <p>Indicates that an attempt to make an attachment was invalid. For example, attaching two nodes
/// with a link type that is not applicable to the nodes or attempting to apply a schema to a directory a second time.</p>
InvalidAttachmentException(crate::error::InvalidAttachmentException),
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
LimitExceededException(crate::error::LimitExceededException),
/// <p>The specified resource could not be found.</p>
ResourceNotFoundException(crate::error::ResourceNotFoundException),
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
RetryableConflictException(crate::error::RetryableConflictException),
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
ValidationException(crate::error::ValidationException),
/// An unexpected error, e.g. invalid JSON returned by the service or an unknown error code
Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for UpgradePublishedSchemaError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match &self.kind {
UpgradePublishedSchemaErrorKind::AccessDeniedException(_inner) => _inner.fmt(f),
UpgradePublishedSchemaErrorKind::IncompatibleSchemaException(_inner) => _inner.fmt(f),
UpgradePublishedSchemaErrorKind::InternalServiceException(_inner) => _inner.fmt(f),
UpgradePublishedSchemaErrorKind::InvalidArnException(_inner) => _inner.fmt(f),
UpgradePublishedSchemaErrorKind::InvalidAttachmentException(_inner) => _inner.fmt(f),
UpgradePublishedSchemaErrorKind::LimitExceededException(_inner) => _inner.fmt(f),
UpgradePublishedSchemaErrorKind::ResourceNotFoundException(_inner) => _inner.fmt(f),
UpgradePublishedSchemaErrorKind::RetryableConflictException(_inner) => _inner.fmt(f),
UpgradePublishedSchemaErrorKind::ValidationException(_inner) => _inner.fmt(f),
UpgradePublishedSchemaErrorKind::Unhandled(_inner) => _inner.fmt(f),
}
}
}
impl aws_smithy_types::retry::ProvideErrorKind for UpgradePublishedSchemaError {
fn code(&self) -> Option<&str> {
UpgradePublishedSchemaError::code(self)
}
fn retryable_error_kind(&self) -> Option<aws_smithy_types::retry::ErrorKind> {
None
}
}
impl UpgradePublishedSchemaError {
/// Creates a new `UpgradePublishedSchemaError`.
pub fn new(kind: UpgradePublishedSchemaErrorKind, meta: aws_smithy_types::Error) -> Self {
Self { kind, meta }
}
/// Creates the `UpgradePublishedSchemaError::Unhandled` variant from any error type.
pub fn unhandled(err: impl Into<Box<dyn std::error::Error + Send + Sync + 'static>>) -> Self {
Self {
kind: UpgradePublishedSchemaErrorKind::Unhandled(err.into()),
meta: Default::default(),
}
}
/// Creates the `UpgradePublishedSchemaError::Unhandled` variant from a `aws_smithy_types::Error`.
pub fn generic(err: aws_smithy_types::Error) -> Self {
Self {
meta: err.clone(),
kind: UpgradePublishedSchemaErrorKind::Unhandled(err.into()),
}
}
// TODO: Consider if this should actually be `Option<Cow<&str>>`. This would enable us to use display
// as implemented by std::Error to generate a message in that case.
/// Returns the error message if one is available.
pub fn message(&self) -> Option<&str> {
self.meta.message()
}
/// Returns error metadata, which includes the error code, message,
/// request ID, and potentially additional information.
pub fn meta(&self) -> &aws_smithy_types::Error {
&self.meta
}
/// Returns the request ID if it's available.
pub fn request_id(&self) -> Option<&str> {
self.meta.request_id()
}
/// Returns the error code if it's available.
pub fn code(&self) -> Option<&str> {
self.meta.code()
}
/// Returns `true` if the error kind is `UpgradePublishedSchemaErrorKind::AccessDeniedException`.
pub fn is_access_denied_exception(&self) -> bool {
matches!(
&self.kind,
UpgradePublishedSchemaErrorKind::AccessDeniedException(_)
)
}
/// Returns `true` if the error kind is `UpgradePublishedSchemaErrorKind::IncompatibleSchemaException`.
pub fn is_incompatible_schema_exception(&self) -> bool {
matches!(
&self.kind,
UpgradePublishedSchemaErrorKind::IncompatibleSchemaException(_)
)
}
/// Returns `true` if the error kind is `UpgradePublishedSchemaErrorKind::InternalServiceException`.
pub fn is_internal_service_exception(&self) -> bool {
matches!(
&self.kind,
UpgradePublishedSchemaErrorKind::InternalServiceException(_)
)
}
/// Returns `true` if the error kind is `UpgradePublishedSchemaErrorKind::InvalidArnException`.
pub fn is_invalid_arn_exception(&self) -> bool {
matches!(
&self.kind,
UpgradePublishedSchemaErrorKind::InvalidArnException(_)
)
}
/// Returns `true` if the error kind is `UpgradePublishedSchemaErrorKind::InvalidAttachmentException`.
pub fn is_invalid_attachment_exception(&self) -> bool {
matches!(
&self.kind,
UpgradePublishedSchemaErrorKind::InvalidAttachmentException(_)
)
}
/// Returns `true` if the error kind is `UpgradePublishedSchemaErrorKind::LimitExceededException`.
pub fn is_limit_exceeded_exception(&self) -> bool {
matches!(
&self.kind,
UpgradePublishedSchemaErrorKind::LimitExceededException(_)
)
}
/// Returns `true` if the error kind is `UpgradePublishedSchemaErrorKind::ResourceNotFoundException`.
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(
&self.kind,
UpgradePublishedSchemaErrorKind::ResourceNotFoundException(_)
)
}
/// Returns `true` if the error kind is `UpgradePublishedSchemaErrorKind::RetryableConflictException`.
pub fn is_retryable_conflict_exception(&self) -> bool {
matches!(
&self.kind,
UpgradePublishedSchemaErrorKind::RetryableConflictException(_)
)
}
/// Returns `true` if the error kind is `UpgradePublishedSchemaErrorKind::ValidationException`.
pub fn is_validation_exception(&self) -> bool {
matches!(
&self.kind,
UpgradePublishedSchemaErrorKind::ValidationException(_)
)
}
}
impl std::error::Error for UpgradePublishedSchemaError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.kind {
UpgradePublishedSchemaErrorKind::AccessDeniedException(_inner) => Some(_inner),
UpgradePublishedSchemaErrorKind::IncompatibleSchemaException(_inner) => Some(_inner),
UpgradePublishedSchemaErrorKind::InternalServiceException(_inner) => Some(_inner),
UpgradePublishedSchemaErrorKind::InvalidArnException(_inner) => Some(_inner),
UpgradePublishedSchemaErrorKind::InvalidAttachmentException(_inner) => Some(_inner),
UpgradePublishedSchemaErrorKind::LimitExceededException(_inner) => Some(_inner),
UpgradePublishedSchemaErrorKind::ResourceNotFoundException(_inner) => Some(_inner),
UpgradePublishedSchemaErrorKind::RetryableConflictException(_inner) => Some(_inner),
UpgradePublishedSchemaErrorKind::ValidationException(_inner) => Some(_inner),
UpgradePublishedSchemaErrorKind::Unhandled(_inner) => Some(_inner.as_ref()),
}
}
}
/// <p>Indicates that your request is malformed in some manner. See the exception
/// message.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ValidationException {
#[allow(missing_docs)] // documentation missing in model
pub message: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for ValidationException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ValidationException");
formatter.field("message", &self.message);
formatter.finish()
}
}
impl ValidationException {
/// Returns the error message.
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for ValidationException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "ValidationException")?;
if let Some(inner_1) = &self.message {
write!(f, ": {}", inner_1)?;
}
Ok(())
}
}
impl std::error::Error for ValidationException {}
/// See [`ValidationException`](crate::error::ValidationException)
pub mod validation_exception {
/// A builder for [`ValidationException`](crate::error::ValidationException)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Consumes the builder and constructs a [`ValidationException`](crate::error::ValidationException)
pub fn build(self) -> crate::error::ValidationException {
crate::error::ValidationException {
message: self.message,
}
}
}
}
impl ValidationException {
/// Creates a new builder-style object to manufacture [`ValidationException`](crate::error::ValidationException)
pub fn builder() -> crate::error::validation_exception::Builder {
crate::error::validation_exception::Builder::default()
}
}
/// <p>Occurs when a conflict with a previous successful write is detected. For example, if a write operation occurs on an object and then an attempt is made to read the object using “SERIALIZABLE” consistency, this exception may result. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct RetryableConflictException {
#[allow(missing_docs)] // documentation missing in model
pub message: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for RetryableConflictException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("RetryableConflictException");
formatter.field("message", &self.message);
formatter.finish()
}
}
impl RetryableConflictException {
/// Returns the error message.
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for RetryableConflictException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "RetryableConflictException")?;
if let Some(inner_2) = &self.message {
write!(f, ": {}", inner_2)?;
}
Ok(())
}
}
impl std::error::Error for RetryableConflictException {}
/// See [`RetryableConflictException`](crate::error::RetryableConflictException)
pub mod retryable_conflict_exception {
/// A builder for [`RetryableConflictException`](crate::error::RetryableConflictException)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Consumes the builder and constructs a [`RetryableConflictException`](crate::error::RetryableConflictException)
pub fn build(self) -> crate::error::RetryableConflictException {
crate::error::RetryableConflictException {
message: self.message,
}
}
}
}
impl RetryableConflictException {
/// Creates a new builder-style object to manufacture [`RetryableConflictException`](crate::error::RetryableConflictException)
pub fn builder() -> crate::error::retryable_conflict_exception::Builder {
crate::error::retryable_conflict_exception::Builder::default()
}
}
/// <p>The specified resource could not be found.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ResourceNotFoundException {
#[allow(missing_docs)] // documentation missing in model
pub message: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for ResourceNotFoundException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ResourceNotFoundException");
formatter.field("message", &self.message);
formatter.finish()
}
}
impl ResourceNotFoundException {
/// Returns the error message.
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for ResourceNotFoundException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "ResourceNotFoundException")?;
if let Some(inner_3) = &self.message {
write!(f, ": {}", inner_3)?;
}
Ok(())
}
}
impl std::error::Error for ResourceNotFoundException {}
/// See [`ResourceNotFoundException`](crate::error::ResourceNotFoundException)
pub mod resource_not_found_exception {
/// A builder for [`ResourceNotFoundException`](crate::error::ResourceNotFoundException)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Consumes the builder and constructs a [`ResourceNotFoundException`](crate::error::ResourceNotFoundException)
pub fn build(self) -> crate::error::ResourceNotFoundException {
crate::error::ResourceNotFoundException {
message: self.message,
}
}
}
}
impl ResourceNotFoundException {
/// Creates a new builder-style object to manufacture [`ResourceNotFoundException`](crate::error::ResourceNotFoundException)
pub fn builder() -> crate::error::resource_not_found_exception::Builder {
crate::error::resource_not_found_exception::Builder::default()
}
}
/// <p>Indicates that limits are exceeded. See <a href="https://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html">Limits</a> for more information.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct LimitExceededException {
#[allow(missing_docs)] // documentation missing in model
pub message: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for LimitExceededException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("LimitExceededException");
formatter.field("message", &self.message);
formatter.finish()
}
}
impl LimitExceededException {
/// Returns the error message.
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for LimitExceededException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "LimitExceededException")?;
if let Some(inner_4) = &self.message {
write!(f, ": {}", inner_4)?;
}
Ok(())
}
}
impl std::error::Error for LimitExceededException {}
/// See [`LimitExceededException`](crate::error::LimitExceededException)
pub mod limit_exceeded_exception {
/// A builder for [`LimitExceededException`](crate::error::LimitExceededException)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Consumes the builder and constructs a [`LimitExceededException`](crate::error::LimitExceededException)
pub fn build(self) -> crate::error::LimitExceededException {
crate::error::LimitExceededException {
message: self.message,
}
}
}
}
impl LimitExceededException {
/// Creates a new builder-style object to manufacture [`LimitExceededException`](crate::error::LimitExceededException)
pub fn builder() -> crate::error::limit_exceeded_exception::Builder {
crate::error::limit_exceeded_exception::Builder::default()
}
}
/// <p>Indicates that an attempt to make an attachment was invalid. For example, attaching two nodes
/// with a link type that is not applicable to the nodes or attempting to apply a schema to a directory a second time.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct InvalidAttachmentException {
#[allow(missing_docs)] // documentation missing in model
pub message: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for InvalidAttachmentException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("InvalidAttachmentException");
formatter.field("message", &self.message);
formatter.finish()
}
}
impl InvalidAttachmentException {
/// Returns the error message.
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for InvalidAttachmentException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "InvalidAttachmentException")?;
if let Some(inner_5) = &self.message {
write!(f, ": {}", inner_5)?;
}
Ok(())
}
}
impl std::error::Error for InvalidAttachmentException {}
/// See [`InvalidAttachmentException`](crate::error::InvalidAttachmentException)
pub mod invalid_attachment_exception {
/// A builder for [`InvalidAttachmentException`](crate::error::InvalidAttachmentException)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Consumes the builder and constructs a [`InvalidAttachmentException`](crate::error::InvalidAttachmentException)
pub fn build(self) -> crate::error::InvalidAttachmentException {
crate::error::InvalidAttachmentException {
message: self.message,
}
}
}
}
impl InvalidAttachmentException {
/// Creates a new builder-style object to manufacture [`InvalidAttachmentException`](crate::error::InvalidAttachmentException)
pub fn builder() -> crate::error::invalid_attachment_exception::Builder {
crate::error::invalid_attachment_exception::Builder::default()
}
}
/// <p>Indicates that the provided ARN value is not valid.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct InvalidArnException {
#[allow(missing_docs)] // documentation missing in model
pub message: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for InvalidArnException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("InvalidArnException");
formatter.field("message", &self.message);
formatter.finish()
}
}
impl InvalidArnException {
/// Returns the error message.
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for InvalidArnException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "InvalidArnException")?;
if let Some(inner_6) = &self.message {
write!(f, ": {}", inner_6)?;
}
Ok(())
}
}
impl std::error::Error for InvalidArnException {}
/// See [`InvalidArnException`](crate::error::InvalidArnException)
pub mod invalid_arn_exception {
/// A builder for [`InvalidArnException`](crate::error::InvalidArnException)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Consumes the builder and constructs a [`InvalidArnException`](crate::error::InvalidArnException)
pub fn build(self) -> crate::error::InvalidArnException {
crate::error::InvalidArnException {
message: self.message,
}
}
}
}
impl InvalidArnException {
/// Creates a new builder-style object to manufacture [`InvalidArnException`](crate::error::InvalidArnException)
pub fn builder() -> crate::error::invalid_arn_exception::Builder {
crate::error::invalid_arn_exception::Builder::default()
}
}
/// <p>Indicates a problem that must be resolved by Amazon Web Services. This might be a transient error in which case you can retry your request until it succeeds. Otherwise, go to the <a href="http://status.aws.amazon.com/">AWS Service Health Dashboard</a> site to see if there are any operational issues with the service.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct InternalServiceException {
#[allow(missing_docs)] // documentation missing in model
pub message: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for InternalServiceException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("InternalServiceException");
formatter.field("message", &self.message);
formatter.finish()
}
}
impl InternalServiceException {
/// Returns the error message.
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for InternalServiceException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "InternalServiceException")?;
if let Some(inner_7) = &self.message {
write!(f, ": {}", inner_7)?;
}
Ok(())
}
}
impl std::error::Error for InternalServiceException {}
/// See [`InternalServiceException`](crate::error::InternalServiceException)
pub mod internal_service_exception {
/// A builder for [`InternalServiceException`](crate::error::InternalServiceException)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Consumes the builder and constructs a [`InternalServiceException`](crate::error::InternalServiceException)
pub fn build(self) -> crate::error::InternalServiceException {
crate::error::InternalServiceException {
message: self.message,
}
}
}
}
impl InternalServiceException {
/// Creates a new builder-style object to manufacture [`InternalServiceException`](crate::error::InternalServiceException)
pub fn builder() -> crate::error::internal_service_exception::Builder {
crate::error::internal_service_exception::Builder::default()
}
}
/// <p>Indicates a failure occurred while performing a check for backward compatibility between the specified schema and the schema that is currently applied to the directory.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct IncompatibleSchemaException {
#[allow(missing_docs)] // documentation missing in model
pub message: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for IncompatibleSchemaException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("IncompatibleSchemaException");
formatter.field("message", &self.message);
formatter.finish()
}
}
impl IncompatibleSchemaException {
/// Returns the error message.
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for IncompatibleSchemaException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "IncompatibleSchemaException")?;
if let Some(inner_8) = &self.message {
write!(f, ": {}", inner_8)?;
}
Ok(())
}
}
impl std::error::Error for IncompatibleSchemaException {}
/// See [`IncompatibleSchemaException`](crate::error::IncompatibleSchemaException)
pub mod incompatible_schema_exception {
/// A builder for [`IncompatibleSchemaException`](crate::error::IncompatibleSchemaException)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Consumes the builder and constructs a [`IncompatibleSchemaException`](crate::error::IncompatibleSchemaException)
pub fn build(self) -> crate::error::IncompatibleSchemaException {
crate::error::IncompatibleSchemaException {
message: self.message,
}
}
}
}
impl IncompatibleSchemaException {
/// Creates a new builder-style object to manufacture [`IncompatibleSchemaException`](crate::error::IncompatibleSchemaException)
pub fn builder() -> crate::error::incompatible_schema_exception::Builder {
crate::error::incompatible_schema_exception::Builder::default()
}
}
/// <p>Access denied or directory not found. Either you don't have permissions for this directory or the directory does not exist. Try calling <a>ListDirectories</a> and check your permissions.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct AccessDeniedException {
#[allow(missing_docs)] // documentation missing in model
pub message: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for AccessDeniedException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("AccessDeniedException");
formatter.field("message", &self.message);
formatter.finish()
}
}
impl AccessDeniedException {
/// Returns the error message.
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for AccessDeniedException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "AccessDeniedException")?;
if let Some(inner_9) = &self.message {
write!(f, ": {}", inner_9)?;
}
Ok(())
}
}
impl std::error::Error for AccessDeniedException {}
/// See [`AccessDeniedException`](crate::error::AccessDeniedException)
pub mod access_denied_exception {
/// A builder for [`AccessDeniedException`](crate::error::AccessDeniedException)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Consumes the builder and constructs a [`AccessDeniedException`](crate::error::AccessDeniedException)
pub fn build(self) -> crate::error::AccessDeniedException {
crate::error::AccessDeniedException {
message: self.message,
}
}
}
}
impl AccessDeniedException {
/// Creates a new builder-style object to manufacture [`AccessDeniedException`](crate::error::AccessDeniedException)
pub fn builder() -> crate::error::access_denied_exception::Builder {
crate::error::access_denied_exception::Builder::default()
}
}
/// <p>Indicates that a schema could not be created due to a naming conflict. Please select a
/// different name and then try again.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct SchemaAlreadyExistsException {
#[allow(missing_docs)] // documentation missing in model
pub message: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for SchemaAlreadyExistsException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("SchemaAlreadyExistsException");
formatter.field("message", &self.message);
formatter.finish()
}
}
impl SchemaAlreadyExistsException {
/// Returns the error message.
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for SchemaAlreadyExistsException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "SchemaAlreadyExistsException")?;
if let Some(inner_10) = &self.message {
write!(f, ": {}", inner_10)?;
}
Ok(())
}
}
impl std::error::Error for SchemaAlreadyExistsException {}
/// See [`SchemaAlreadyExistsException`](crate::error::SchemaAlreadyExistsException)
pub mod schema_already_exists_exception {
/// A builder for [`SchemaAlreadyExistsException`](crate::error::SchemaAlreadyExistsException)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Consumes the builder and constructs a [`SchemaAlreadyExistsException`](crate::error::SchemaAlreadyExistsException)
pub fn build(self) -> crate::error::SchemaAlreadyExistsException {
crate::error::SchemaAlreadyExistsException {
message: self.message,
}
}
}
}
impl SchemaAlreadyExistsException {
/// Creates a new builder-style object to manufacture [`SchemaAlreadyExistsException`](crate::error::SchemaAlreadyExistsException)
pub fn builder() -> crate::error::schema_already_exists_exception::Builder {
crate::error::schema_already_exists_exception::Builder::default()
}
}
/// <p>Occurs when any of the rule parameter keys or values are invalid.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct InvalidRuleException {
#[allow(missing_docs)] // documentation missing in model
pub message: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for InvalidRuleException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("InvalidRuleException");
formatter.field("message", &self.message);
formatter.finish()
}
}
impl InvalidRuleException {
/// Returns the error message.
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for InvalidRuleException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "InvalidRuleException")?;
if let Some(inner_11) = &self.message {
write!(f, ": {}", inner_11)?;
}
Ok(())
}
}
impl std::error::Error for InvalidRuleException {}
/// See [`InvalidRuleException`](crate::error::InvalidRuleException)
pub mod invalid_rule_exception {
/// A builder for [`InvalidRuleException`](crate::error::InvalidRuleException)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Consumes the builder and constructs a [`InvalidRuleException`](crate::error::InvalidRuleException)
pub fn build(self) -> crate::error::InvalidRuleException {
crate::error::InvalidRuleException {
message: self.message,
}
}
}
}
impl InvalidRuleException {
/// Creates a new builder-style object to manufacture [`InvalidRuleException`](crate::error::InvalidRuleException)
pub fn builder() -> crate::error::invalid_rule_exception::Builder {
crate::error::invalid_rule_exception::Builder::default()
}
}
/// <p>An attempt to modify a <a>Facet</a> resulted in an invalid schema
/// exception.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct InvalidFacetUpdateException {
#[allow(missing_docs)] // documentation missing in model
pub message: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for InvalidFacetUpdateException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("InvalidFacetUpdateException");
formatter.field("message", &self.message);
formatter.finish()
}
}
impl InvalidFacetUpdateException {
/// Returns the error message.
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for InvalidFacetUpdateException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "InvalidFacetUpdateException")?;
if let Some(inner_12) = &self.message {
write!(f, ": {}", inner_12)?;
}
Ok(())
}
}
impl std::error::Error for InvalidFacetUpdateException {}
/// See [`InvalidFacetUpdateException`](crate::error::InvalidFacetUpdateException)
pub mod invalid_facet_update_exception {
/// A builder for [`InvalidFacetUpdateException`](crate::error::InvalidFacetUpdateException)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Consumes the builder and constructs a [`InvalidFacetUpdateException`](crate::error::InvalidFacetUpdateException)
pub fn build(self) -> crate::error::InvalidFacetUpdateException {
crate::error::InvalidFacetUpdateException {
message: self.message,
}
}
}
}
impl InvalidFacetUpdateException {
/// Creates a new builder-style object to manufacture [`InvalidFacetUpdateException`](crate::error::InvalidFacetUpdateException)
pub fn builder() -> crate::error::invalid_facet_update_exception::Builder {
crate::error::invalid_facet_update_exception::Builder::default()
}
}
/// <p>The <a>Facet</a> that you provided was not well formed or could not be
/// validated with the schema.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct FacetValidationException {
#[allow(missing_docs)] // documentation missing in model
pub message: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for FacetValidationException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("FacetValidationException");
formatter.field("message", &self.message);
formatter.finish()
}
}
impl FacetValidationException {
/// Returns the error message.
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for FacetValidationException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "FacetValidationException")?;
if let Some(inner_13) = &self.message {
write!(f, ": {}", inner_13)?;
}
Ok(())
}
}
impl std::error::Error for FacetValidationException {}
/// See [`FacetValidationException`](crate::error::FacetValidationException)
pub mod facet_validation_exception {
/// A builder for [`FacetValidationException`](crate::error::FacetValidationException)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Consumes the builder and constructs a [`FacetValidationException`](crate::error::FacetValidationException)
pub fn build(self) -> crate::error::FacetValidationException {
crate::error::FacetValidationException {
message: self.message,
}
}
}
}
impl FacetValidationException {
/// Creates a new builder-style object to manufacture [`FacetValidationException`](crate::error::FacetValidationException)
pub fn builder() -> crate::error::facet_validation_exception::Builder {
crate::error::facet_validation_exception::Builder::default()
}
}
/// <p>The specified <a>Facet</a> could not be found.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct FacetNotFoundException {
#[allow(missing_docs)] // documentation missing in model
pub message: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for FacetNotFoundException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("FacetNotFoundException");
formatter.field("message", &self.message);
formatter.finish()
}
}
impl FacetNotFoundException {
/// Returns the error message.
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for FacetNotFoundException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "FacetNotFoundException")?;
if let Some(inner_14) = &self.message {
write!(f, ": {}", inner_14)?;
}
Ok(())
}
}
impl std::error::Error for FacetNotFoundException {}
/// See [`FacetNotFoundException`](crate::error::FacetNotFoundException)
pub mod facet_not_found_exception {
/// A builder for [`FacetNotFoundException`](crate::error::FacetNotFoundException)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Consumes the builder and constructs a [`FacetNotFoundException`](crate::error::FacetNotFoundException)
pub fn build(self) -> crate::error::FacetNotFoundException {
crate::error::FacetNotFoundException {
message: self.message,
}
}
}
}
impl FacetNotFoundException {
/// Creates a new builder-style object to manufacture [`FacetNotFoundException`](crate::error::FacetNotFoundException)
pub fn builder() -> crate::error::facet_not_found_exception::Builder {
crate::error::facet_not_found_exception::Builder::default()
}
}
/// <p>Indicates that a link could not be created due to a naming conflict. Choose a different
/// name and then try again.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct LinkNameAlreadyInUseException {
#[allow(missing_docs)] // documentation missing in model
pub message: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for LinkNameAlreadyInUseException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("LinkNameAlreadyInUseException");
formatter.field("message", &self.message);
formatter.finish()
}
}
impl LinkNameAlreadyInUseException {
/// Returns the error message.
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for LinkNameAlreadyInUseException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "LinkNameAlreadyInUseException")?;
if let Some(inner_15) = &self.message {
write!(f, ": {}", inner_15)?;
}
Ok(())
}
}
impl std::error::Error for LinkNameAlreadyInUseException {}
/// See [`LinkNameAlreadyInUseException`](crate::error::LinkNameAlreadyInUseException)
pub mod link_name_already_in_use_exception {
/// A builder for [`LinkNameAlreadyInUseException`](crate::error::LinkNameAlreadyInUseException)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Consumes the builder and constructs a [`LinkNameAlreadyInUseException`](crate::error::LinkNameAlreadyInUseException)
pub fn build(self) -> crate::error::LinkNameAlreadyInUseException {
crate::error::LinkNameAlreadyInUseException {
message: self.message,
}
}
}
}
impl LinkNameAlreadyInUseException {
/// Creates a new builder-style object to manufacture [`LinkNameAlreadyInUseException`](crate::error::LinkNameAlreadyInUseException)
pub fn builder() -> crate::error::link_name_already_in_use_exception::Builder {
crate::error::link_name_already_in_use_exception::Builder::default()
}
}
/// <p>Operations are only permitted on enabled directories.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct DirectoryNotEnabledException {
#[allow(missing_docs)] // documentation missing in model
pub message: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for DirectoryNotEnabledException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("DirectoryNotEnabledException");
formatter.field("message", &self.message);
formatter.finish()
}
}
impl DirectoryNotEnabledException {
/// Returns the error message.
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for DirectoryNotEnabledException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "DirectoryNotEnabledException")?;
if let Some(inner_16) = &self.message {
write!(f, ": {}", inner_16)?;
}
Ok(())
}
}
impl std::error::Error for DirectoryNotEnabledException {}
/// See [`DirectoryNotEnabledException`](crate::error::DirectoryNotEnabledException)
pub mod directory_not_enabled_exception {
/// A builder for [`DirectoryNotEnabledException`](crate::error::DirectoryNotEnabledException)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Consumes the builder and constructs a [`DirectoryNotEnabledException`](crate::error::DirectoryNotEnabledException)
pub fn build(self) -> crate::error::DirectoryNotEnabledException {
crate::error::DirectoryNotEnabledException {
message: self.message,
}
}
}
}
impl DirectoryNotEnabledException {
/// Creates a new builder-style object to manufacture [`DirectoryNotEnabledException`](crate::error::DirectoryNotEnabledException)
pub fn builder() -> crate::error::directory_not_enabled_exception::Builder {
crate::error::directory_not_enabled_exception::Builder::default()
}
}
/// <p>Can occur for multiple reasons such as when you tag a resource that doesn’t exist or if you specify a higher number of tags for a resource than the allowed limit. Allowed limit is 50 tags per resource.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct InvalidTaggingRequestException {
#[allow(missing_docs)] // documentation missing in model
pub message: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for InvalidTaggingRequestException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("InvalidTaggingRequestException");
formatter.field("message", &self.message);
formatter.finish()
}
}
impl InvalidTaggingRequestException {
/// Returns the error message.
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for InvalidTaggingRequestException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "InvalidTaggingRequestException")?;
if let Some(inner_17) = &self.message {
write!(f, ": {}", inner_17)?;
}
Ok(())
}
}
impl std::error::Error for InvalidTaggingRequestException {}
/// See [`InvalidTaggingRequestException`](crate::error::InvalidTaggingRequestException)
pub mod invalid_tagging_request_exception {
/// A builder for [`InvalidTaggingRequestException`](crate::error::InvalidTaggingRequestException)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Consumes the builder and constructs a [`InvalidTaggingRequestException`](crate::error::InvalidTaggingRequestException)
pub fn build(self) -> crate::error::InvalidTaggingRequestException {
crate::error::InvalidTaggingRequestException {
message: self.message,
}
}
}
}
impl InvalidTaggingRequestException {
/// Creates a new builder-style object to manufacture [`InvalidTaggingRequestException`](crate::error::InvalidTaggingRequestException)
pub fn builder() -> crate::error::invalid_tagging_request_exception::Builder {
crate::error::invalid_tagging_request_exception::Builder::default()
}
}
/// <p>Indicates that the provided <code>SchemaDoc</code> value is not valid.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct InvalidSchemaDocException {
#[allow(missing_docs)] // documentation missing in model
pub message: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for InvalidSchemaDocException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("InvalidSchemaDocException");
formatter.field("message", &self.message);
formatter.finish()
}
}
impl InvalidSchemaDocException {
/// Returns the error message.
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for InvalidSchemaDocException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "InvalidSchemaDocException")?;
if let Some(inner_18) = &self.message {
write!(f, ": {}", inner_18)?;
}
Ok(())
}
}
impl std::error::Error for InvalidSchemaDocException {}
/// See [`InvalidSchemaDocException`](crate::error::InvalidSchemaDocException)
pub mod invalid_schema_doc_exception {
/// A builder for [`InvalidSchemaDocException`](crate::error::InvalidSchemaDocException)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Consumes the builder and constructs a [`InvalidSchemaDocException`](crate::error::InvalidSchemaDocException)
pub fn build(self) -> crate::error::InvalidSchemaDocException {
crate::error::InvalidSchemaDocException {
message: self.message,
}
}
}
}
impl InvalidSchemaDocException {
/// Creates a new builder-style object to manufacture [`InvalidSchemaDocException`](crate::error::InvalidSchemaDocException)
pub fn builder() -> crate::error::invalid_schema_doc_exception::Builder {
crate::error::invalid_schema_doc_exception::Builder::default()
}
}
/// <p>Indicates that a schema is already published.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct SchemaAlreadyPublishedException {
#[allow(missing_docs)] // documentation missing in model
pub message: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for SchemaAlreadyPublishedException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("SchemaAlreadyPublishedException");
formatter.field("message", &self.message);
formatter.finish()
}
}
impl SchemaAlreadyPublishedException {
/// Returns the error message.
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for SchemaAlreadyPublishedException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "SchemaAlreadyPublishedException")?;
if let Some(inner_19) = &self.message {
write!(f, ": {}", inner_19)?;
}
Ok(())
}
}
impl std::error::Error for SchemaAlreadyPublishedException {}
/// See [`SchemaAlreadyPublishedException`](crate::error::SchemaAlreadyPublishedException)
pub mod schema_already_published_exception {
/// A builder for [`SchemaAlreadyPublishedException`](crate::error::SchemaAlreadyPublishedException)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Consumes the builder and constructs a [`SchemaAlreadyPublishedException`](crate::error::SchemaAlreadyPublishedException)
pub fn build(self) -> crate::error::SchemaAlreadyPublishedException {
crate::error::SchemaAlreadyPublishedException {
message: self.message,
}
}
}
}
impl SchemaAlreadyPublishedException {
/// Creates a new builder-style object to manufacture [`SchemaAlreadyPublishedException`](crate::error::SchemaAlreadyPublishedException)
pub fn builder() -> crate::error::schema_already_published_exception::Builder {
crate::error::schema_already_published_exception::Builder::default()
}
}
/// <p>Indicates that the <code>NextToken</code> value is not valid.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct InvalidNextTokenException {
#[allow(missing_docs)] // documentation missing in model
pub message: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for InvalidNextTokenException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("InvalidNextTokenException");
formatter.field("message", &self.message);
formatter.finish()
}
}
impl InvalidNextTokenException {
/// Returns the error message.
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for InvalidNextTokenException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "InvalidNextTokenException")?;
if let Some(inner_20) = &self.message {
write!(f, ": {}", inner_20)?;
}
Ok(())
}
}
impl std::error::Error for InvalidNextTokenException {}
/// See [`InvalidNextTokenException`](crate::error::InvalidNextTokenException)
pub mod invalid_next_token_exception {
/// A builder for [`InvalidNextTokenException`](crate::error::InvalidNextTokenException)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Consumes the builder and constructs a [`InvalidNextTokenException`](crate::error::InvalidNextTokenException)
pub fn build(self) -> crate::error::InvalidNextTokenException {
crate::error::InvalidNextTokenException {
message: self.message,
}
}
}
}
impl InvalidNextTokenException {
/// Creates a new builder-style object to manufacture [`InvalidNextTokenException`](crate::error::InvalidNextTokenException)
pub fn builder() -> crate::error::invalid_next_token_exception::Builder {
crate::error::invalid_next_token_exception::Builder::default()
}
}
/// <p>Indicates that the requested operation can only operate on policy objects.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct NotPolicyException {
#[allow(missing_docs)] // documentation missing in model
pub message: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for NotPolicyException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("NotPolicyException");
formatter.field("message", &self.message);
formatter.finish()
}
}
impl NotPolicyException {
/// Returns the error message.
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for NotPolicyException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "NotPolicyException")?;
if let Some(inner_21) = &self.message {
write!(f, ": {}", inner_21)?;
}
Ok(())
}
}
impl std::error::Error for NotPolicyException {}
/// See [`NotPolicyException`](crate::error::NotPolicyException)
pub mod not_policy_exception {
/// A builder for [`NotPolicyException`](crate::error::NotPolicyException)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Consumes the builder and constructs a [`NotPolicyException`](crate::error::NotPolicyException)
pub fn build(self) -> crate::error::NotPolicyException {
crate::error::NotPolicyException {
message: self.message,
}
}
}
}
impl NotPolicyException {
/// Creates a new builder-style object to manufacture [`NotPolicyException`](crate::error::NotPolicyException)
pub fn builder() -> crate::error::not_policy_exception::Builder {
crate::error::not_policy_exception::Builder::default()
}
}
/// <p>Cannot list the parents of a <a>Directory</a> root.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct CannotListParentOfRootException {
#[allow(missing_docs)] // documentation missing in model
pub message: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for CannotListParentOfRootException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("CannotListParentOfRootException");
formatter.field("message", &self.message);
formatter.finish()
}
}
impl CannotListParentOfRootException {
/// Returns the error message.
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for CannotListParentOfRootException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "CannotListParentOfRootException")?;
if let Some(inner_22) = &self.message {
write!(f, ": {}", inner_22)?;
}
Ok(())
}
}
impl std::error::Error for CannotListParentOfRootException {}
/// See [`CannotListParentOfRootException`](crate::error::CannotListParentOfRootException)
pub mod cannot_list_parent_of_root_exception {
/// A builder for [`CannotListParentOfRootException`](crate::error::CannotListParentOfRootException)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Consumes the builder and constructs a [`CannotListParentOfRootException`](crate::error::CannotListParentOfRootException)
pub fn build(self) -> crate::error::CannotListParentOfRootException {
crate::error::CannotListParentOfRootException {
message: self.message,
}
}
}
}
impl CannotListParentOfRootException {
/// Creates a new builder-style object to manufacture [`CannotListParentOfRootException`](crate::error::CannotListParentOfRootException)
pub fn builder() -> crate::error::cannot_list_parent_of_root_exception::Builder {
crate::error::cannot_list_parent_of_root_exception::Builder::default()
}
}
/// <p>Occurs when any invalid operations are performed on an object that is not a node, such
/// as calling <code>ListObjectChildren</code> for a leaf node object.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct NotNodeException {
#[allow(missing_docs)] // documentation missing in model
pub message: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for NotNodeException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("NotNodeException");
formatter.field("message", &self.message);
formatter.finish()
}
}
impl NotNodeException {
/// Returns the error message.
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for NotNodeException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "NotNodeException")?;
if let Some(inner_23) = &self.message {
write!(f, ": {}", inner_23)?;
}
Ok(())
}
}
impl std::error::Error for NotNodeException {}
/// See [`NotNodeException`](crate::error::NotNodeException)
pub mod not_node_exception {
/// A builder for [`NotNodeException`](crate::error::NotNodeException)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Consumes the builder and constructs a [`NotNodeException`](crate::error::NotNodeException)
pub fn build(self) -> crate::error::NotNodeException {
crate::error::NotNodeException {
message: self.message,
}
}
}
}
impl NotNodeException {
/// Creates a new builder-style object to manufacture [`NotNodeException`](crate::error::NotNodeException)
pub fn builder() -> crate::error::not_node_exception::Builder {
crate::error::not_node_exception::Builder::default()
}
}
/// <p>Indicates that the requested operation can only operate on index objects.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct NotIndexException {
#[allow(missing_docs)] // documentation missing in model
pub message: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for NotIndexException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("NotIndexException");
formatter.field("message", &self.message);
formatter.finish()
}
}
impl NotIndexException {
/// Returns the error message.
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for NotIndexException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "NotIndexException")?;
if let Some(inner_24) = &self.message {
write!(f, ": {}", inner_24)?;
}
Ok(())
}
}
impl std::error::Error for NotIndexException {}
/// See [`NotIndexException`](crate::error::NotIndexException)
pub mod not_index_exception {
/// A builder for [`NotIndexException`](crate::error::NotIndexException)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Consumes the builder and constructs a [`NotIndexException`](crate::error::NotIndexException)
pub fn build(self) -> crate::error::NotIndexException {
crate::error::NotIndexException {
message: self.message,
}
}
}
}
impl NotIndexException {
/// Creates a new builder-style object to manufacture [`NotIndexException`](crate::error::NotIndexException)
pub fn builder() -> crate::error::not_index_exception::Builder {
crate::error::not_index_exception::Builder::default()
}
}
/// <p>A directory that has been deleted and to which access has been attempted. Note: The
/// requested resource will eventually cease to exist.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct DirectoryDeletedException {
#[allow(missing_docs)] // documentation missing in model
pub message: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for DirectoryDeletedException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("DirectoryDeletedException");
formatter.field("message", &self.message);
formatter.finish()
}
}
impl DirectoryDeletedException {
/// Returns the error message.
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for DirectoryDeletedException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "DirectoryDeletedException")?;
if let Some(inner_25) = &self.message {
write!(f, ": {}", inner_25)?;
}
Ok(())
}
}
impl std::error::Error for DirectoryDeletedException {}
/// See [`DirectoryDeletedException`](crate::error::DirectoryDeletedException)
pub mod directory_deleted_exception {
/// A builder for [`DirectoryDeletedException`](crate::error::DirectoryDeletedException)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Consumes the builder and constructs a [`DirectoryDeletedException`](crate::error::DirectoryDeletedException)
pub fn build(self) -> crate::error::DirectoryDeletedException {
crate::error::DirectoryDeletedException {
message: self.message,
}
}
}
}
impl DirectoryDeletedException {
/// Creates a new builder-style object to manufacture [`DirectoryDeletedException`](crate::error::DirectoryDeletedException)
pub fn builder() -> crate::error::directory_deleted_exception::Builder {
crate::error::directory_deleted_exception::Builder::default()
}
}
/// <p>Indicates that the object is not attached to the index.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ObjectAlreadyDetachedException {
#[allow(missing_docs)] // documentation missing in model
pub message: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for ObjectAlreadyDetachedException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ObjectAlreadyDetachedException");
formatter.field("message", &self.message);
formatter.finish()
}
}
impl ObjectAlreadyDetachedException {
/// Returns the error message.
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for ObjectAlreadyDetachedException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "ObjectAlreadyDetachedException")?;
if let Some(inner_26) = &self.message {
write!(f, ": {}", inner_26)?;
}
Ok(())
}
}
impl std::error::Error for ObjectAlreadyDetachedException {}
/// See [`ObjectAlreadyDetachedException`](crate::error::ObjectAlreadyDetachedException)
pub mod object_already_detached_exception {
/// A builder for [`ObjectAlreadyDetachedException`](crate::error::ObjectAlreadyDetachedException)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Consumes the builder and constructs a [`ObjectAlreadyDetachedException`](crate::error::ObjectAlreadyDetachedException)
pub fn build(self) -> crate::error::ObjectAlreadyDetachedException {
crate::error::ObjectAlreadyDetachedException {
message: self.message,
}
}
}
}
impl ObjectAlreadyDetachedException {
/// Creates a new builder-style object to manufacture [`ObjectAlreadyDetachedException`](crate::error::ObjectAlreadyDetachedException)
pub fn builder() -> crate::error::object_already_detached_exception::Builder {
crate::error::object_already_detached_exception::Builder::default()
}
}
/// <p>The object could not be deleted because links still exist. Remove the links and then
/// try the operation again.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct StillContainsLinksException {
#[allow(missing_docs)] // documentation missing in model
pub message: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for StillContainsLinksException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("StillContainsLinksException");
formatter.field("message", &self.message);
formatter.finish()
}
}
impl StillContainsLinksException {
/// Returns the error message.
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for StillContainsLinksException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "StillContainsLinksException")?;
if let Some(inner_27) = &self.message {
write!(f, ": {}", inner_27)?;
}
Ok(())
}
}
impl std::error::Error for StillContainsLinksException {}
/// See [`StillContainsLinksException`](crate::error::StillContainsLinksException)
pub mod still_contains_links_exception {
/// A builder for [`StillContainsLinksException`](crate::error::StillContainsLinksException)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Consumes the builder and constructs a [`StillContainsLinksException`](crate::error::StillContainsLinksException)
pub fn build(self) -> crate::error::StillContainsLinksException {
crate::error::StillContainsLinksException {
message: self.message,
}
}
}
}
impl StillContainsLinksException {
/// Creates a new builder-style object to manufacture [`StillContainsLinksException`](crate::error::StillContainsLinksException)
pub fn builder() -> crate::error::still_contains_links_exception::Builder {
crate::error::still_contains_links_exception::Builder::default()
}
}
/// <p>Indicates that the requested operation cannot be completed because the object has not
/// been detached from the tree.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ObjectNotDetachedException {
#[allow(missing_docs)] // documentation missing in model
pub message: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for ObjectNotDetachedException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ObjectNotDetachedException");
formatter.field("message", &self.message);
formatter.finish()
}
}
impl ObjectNotDetachedException {
/// Returns the error message.
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for ObjectNotDetachedException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "ObjectNotDetachedException")?;
if let Some(inner_28) = &self.message {
write!(f, ": {}", inner_28)?;
}
Ok(())
}
}
impl std::error::Error for ObjectNotDetachedException {}
/// See [`ObjectNotDetachedException`](crate::error::ObjectNotDetachedException)
pub mod object_not_detached_exception {
/// A builder for [`ObjectNotDetachedException`](crate::error::ObjectNotDetachedException)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Consumes the builder and constructs a [`ObjectNotDetachedException`](crate::error::ObjectNotDetachedException)
pub fn build(self) -> crate::error::ObjectNotDetachedException {
crate::error::ObjectNotDetachedException {
message: self.message,
}
}
}
}
impl ObjectNotDetachedException {
/// Creates a new builder-style object to manufacture [`ObjectNotDetachedException`](crate::error::ObjectNotDetachedException)
pub fn builder() -> crate::error::object_not_detached_exception::Builder {
crate::error::object_not_detached_exception::Builder::default()
}
}
/// <p>Occurs when deleting a facet that contains an attribute that is a target to an
/// attribute reference in a different facet.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct FacetInUseException {
#[allow(missing_docs)] // documentation missing in model
pub message: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for FacetInUseException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("FacetInUseException");
formatter.field("message", &self.message);
formatter.finish()
}
}
impl FacetInUseException {
/// Returns the error message.
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for FacetInUseException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "FacetInUseException")?;
if let Some(inner_29) = &self.message {
write!(f, ": {}", inner_29)?;
}
Ok(())
}
}
impl std::error::Error for FacetInUseException {}
/// See [`FacetInUseException`](crate::error::FacetInUseException)
pub mod facet_in_use_exception {
/// A builder for [`FacetInUseException`](crate::error::FacetInUseException)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Consumes the builder and constructs a [`FacetInUseException`](crate::error::FacetInUseException)
pub fn build(self) -> crate::error::FacetInUseException {
crate::error::FacetInUseException {
message: self.message,
}
}
}
}
impl FacetInUseException {
/// Creates a new builder-style object to manufacture [`FacetInUseException`](crate::error::FacetInUseException)
pub fn builder() -> crate::error::facet_in_use_exception::Builder {
crate::error::facet_in_use_exception::Builder::default()
}
}
/// <p>An operation can only operate on a disabled directory.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct DirectoryNotDisabledException {
#[allow(missing_docs)] // documentation missing in model
pub message: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for DirectoryNotDisabledException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("DirectoryNotDisabledException");
formatter.field("message", &self.message);
formatter.finish()
}
}
impl DirectoryNotDisabledException {
/// Returns the error message.
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for DirectoryNotDisabledException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "DirectoryNotDisabledException")?;
if let Some(inner_30) = &self.message {
write!(f, ": {}", inner_30)?;
}
Ok(())
}
}
impl std::error::Error for DirectoryNotDisabledException {}
/// See [`DirectoryNotDisabledException`](crate::error::DirectoryNotDisabledException)
pub mod directory_not_disabled_exception {
/// A builder for [`DirectoryNotDisabledException`](crate::error::DirectoryNotDisabledException)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Consumes the builder and constructs a [`DirectoryNotDisabledException`](crate::error::DirectoryNotDisabledException)
pub fn build(self) -> crate::error::DirectoryNotDisabledException {
crate::error::DirectoryNotDisabledException {
message: self.message,
}
}
}
}
impl DirectoryNotDisabledException {
/// Creates a new builder-style object to manufacture [`DirectoryNotDisabledException`](crate::error::DirectoryNotDisabledException)
pub fn builder() -> crate::error::directory_not_disabled_exception::Builder {
crate::error::directory_not_disabled_exception::Builder::default()
}
}
/// <p>A facet with the same name already exists.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct FacetAlreadyExistsException {
#[allow(missing_docs)] // documentation missing in model
pub message: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for FacetAlreadyExistsException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("FacetAlreadyExistsException");
formatter.field("message", &self.message);
formatter.finish()
}
}
impl FacetAlreadyExistsException {
/// Returns the error message.
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for FacetAlreadyExistsException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "FacetAlreadyExistsException")?;
if let Some(inner_31) = &self.message {
write!(f, ": {}", inner_31)?;
}
Ok(())
}
}
impl std::error::Error for FacetAlreadyExistsException {}
/// See [`FacetAlreadyExistsException`](crate::error::FacetAlreadyExistsException)
pub mod facet_already_exists_exception {
/// A builder for [`FacetAlreadyExistsException`](crate::error::FacetAlreadyExistsException)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Consumes the builder and constructs a [`FacetAlreadyExistsException`](crate::error::FacetAlreadyExistsException)
pub fn build(self) -> crate::error::FacetAlreadyExistsException {
crate::error::FacetAlreadyExistsException {
message: self.message,
}
}
}
}
impl FacetAlreadyExistsException {
/// Creates a new builder-style object to manufacture [`FacetAlreadyExistsException`](crate::error::FacetAlreadyExistsException)
pub fn builder() -> crate::error::facet_already_exists_exception::Builder {
crate::error::facet_already_exists_exception::Builder::default()
}
}
/// <p>Indicates that the requested index type is not supported.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct UnsupportedIndexTypeException {
#[allow(missing_docs)] // documentation missing in model
pub message: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for UnsupportedIndexTypeException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("UnsupportedIndexTypeException");
formatter.field("message", &self.message);
formatter.finish()
}
}
impl UnsupportedIndexTypeException {
/// Returns the error message.
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for UnsupportedIndexTypeException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "UnsupportedIndexTypeException")?;
if let Some(inner_32) = &self.message {
write!(f, ": {}", inner_32)?;
}
Ok(())
}
}
impl std::error::Error for UnsupportedIndexTypeException {}
/// See [`UnsupportedIndexTypeException`](crate::error::UnsupportedIndexTypeException)
pub mod unsupported_index_type_exception {
/// A builder for [`UnsupportedIndexTypeException`](crate::error::UnsupportedIndexTypeException)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Consumes the builder and constructs a [`UnsupportedIndexTypeException`](crate::error::UnsupportedIndexTypeException)
pub fn build(self) -> crate::error::UnsupportedIndexTypeException {
crate::error::UnsupportedIndexTypeException {
message: self.message,
}
}
}
}
impl UnsupportedIndexTypeException {
/// Creates a new builder-style object to manufacture [`UnsupportedIndexTypeException`](crate::error::UnsupportedIndexTypeException)
pub fn builder() -> crate::error::unsupported_index_type_exception::Builder {
crate::error::unsupported_index_type_exception::Builder::default()
}
}
/// <p>Indicates that a <a>Directory</a> could not be created due to a naming
/// conflict. Choose a different name and try again.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct DirectoryAlreadyExistsException {
#[allow(missing_docs)] // documentation missing in model
pub message: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for DirectoryAlreadyExistsException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("DirectoryAlreadyExistsException");
formatter.field("message", &self.message);
formatter.finish()
}
}
impl DirectoryAlreadyExistsException {
/// Returns the error message.
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for DirectoryAlreadyExistsException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "DirectoryAlreadyExistsException")?;
if let Some(inner_33) = &self.message {
write!(f, ": {}", inner_33)?;
}
Ok(())
}
}
impl std::error::Error for DirectoryAlreadyExistsException {}
/// See [`DirectoryAlreadyExistsException`](crate::error::DirectoryAlreadyExistsException)
pub mod directory_already_exists_exception {
/// A builder for [`DirectoryAlreadyExistsException`](crate::error::DirectoryAlreadyExistsException)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Consumes the builder and constructs a [`DirectoryAlreadyExistsException`](crate::error::DirectoryAlreadyExistsException)
pub fn build(self) -> crate::error::DirectoryAlreadyExistsException {
crate::error::DirectoryAlreadyExistsException {
message: self.message,
}
}
}
}
impl DirectoryAlreadyExistsException {
/// Creates a new builder-style object to manufacture [`DirectoryAlreadyExistsException`](crate::error::DirectoryAlreadyExistsException)
pub fn builder() -> crate::error::directory_already_exists_exception::Builder {
crate::error::directory_already_exists_exception::Builder::default()
}
}
/// <p>A <code>BatchWrite</code> exception has occurred.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct BatchWriteException {
#[allow(missing_docs)] // documentation missing in model
pub index: i32,
#[allow(missing_docs)] // documentation missing in model
pub r#type: std::option::Option<crate::model::BatchWriteExceptionType>,
#[allow(missing_docs)] // documentation missing in model
pub message: std::option::Option<std::string::String>,
}
impl BatchWriteException {
#[allow(missing_docs)] // documentation missing in model
pub fn index(&self) -> i32 {
self.index
}
#[allow(missing_docs)] // documentation missing in model
pub fn r#type(&self) -> std::option::Option<&crate::model::BatchWriteExceptionType> {
self.r#type.as_ref()
}
}
impl std::fmt::Debug for BatchWriteException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("BatchWriteException");
formatter.field("index", &self.index);
formatter.field("r#type", &self.r#type);
formatter.field("message", &self.message);
formatter.finish()
}
}
impl BatchWriteException {
/// Returns the error message.
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for BatchWriteException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "BatchWriteException")?;
if let Some(inner_34) = &self.message {
write!(f, ": {}", inner_34)?;
}
Ok(())
}
}
impl std::error::Error for BatchWriteException {}
/// See [`BatchWriteException`](crate::error::BatchWriteException)
pub mod batch_write_exception {
/// A builder for [`BatchWriteException`](crate::error::BatchWriteException)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) index: std::option::Option<i32>,
pub(crate) r#type: std::option::Option<crate::model::BatchWriteExceptionType>,
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn index(mut self, input: i32) -> Self {
self.index = Some(input);
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_index(mut self, input: std::option::Option<i32>) -> Self {
self.index = input;
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn r#type(mut self, input: crate::model::BatchWriteExceptionType) -> Self {
self.r#type = Some(input);
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_type(
mut self,
input: std::option::Option<crate::model::BatchWriteExceptionType>,
) -> Self {
self.r#type = input;
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Consumes the builder and constructs a [`BatchWriteException`](crate::error::BatchWriteException)
pub fn build(self) -> crate::error::BatchWriteException {
crate::error::BatchWriteException {
index: self.index.unwrap_or_default(),
r#type: self.r#type,
message: self.message,
}
}
}
}
impl BatchWriteException {
/// Creates a new builder-style object to manufacture [`BatchWriteException`](crate::error::BatchWriteException)
pub fn builder() -> crate::error::batch_write_exception::Builder {
crate::error::batch_write_exception::Builder::default()
}
}
/// <p>An object has been attempted to be attached to an object that does not have the appropriate attribute value.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct IndexedAttributeMissingException {
#[allow(missing_docs)] // documentation missing in model
pub message: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for IndexedAttributeMissingException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("IndexedAttributeMissingException");
formatter.field("message", &self.message);
formatter.finish()
}
}
impl IndexedAttributeMissingException {
/// Returns the error message.
pub fn message(&self) -> Option<&str> {
self.message.as_deref()
}
}
impl std::fmt::Display for IndexedAttributeMissingException {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "IndexedAttributeMissingException")?;
if let Some(inner_35) = &self.message {
write!(f, ": {}", inner_35)?;
}
Ok(())
}
}
impl std::error::Error for IndexedAttributeMissingException {}
/// See [`IndexedAttributeMissingException`](crate::error::IndexedAttributeMissingException)
pub mod indexed_attribute_missing_exception {
/// A builder for [`IndexedAttributeMissingException`](crate::error::IndexedAttributeMissingException)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) message: std::option::Option<std::string::String>,
}
impl Builder {
#[allow(missing_docs)] // documentation missing in model
pub fn message(mut self, input: impl Into<std::string::String>) -> Self {
self.message = Some(input.into());
self
}
#[allow(missing_docs)] // documentation missing in model
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message = input;
self
}
/// Consumes the builder and constructs a [`IndexedAttributeMissingException`](crate::error::IndexedAttributeMissingException)
pub fn build(self) -> crate::error::IndexedAttributeMissingException {
crate::error::IndexedAttributeMissingException {
message: self.message,
}
}
}
}
impl IndexedAttributeMissingException {
/// Creates a new builder-style object to manufacture [`IndexedAttributeMissingException`](crate::error::IndexedAttributeMissingException)
pub fn builder() -> crate::error::indexed_attribute_missing_exception::Builder {
crate::error::indexed_attribute_missing_exception::Builder::default()
}
}
| 50.149403 | 451 | 0.686514 |
293ee02cc0511e3949cf53e808847e00ee1d505c | 3,841 | sql | SQL | map_2020-04-06.sql | rizkylab/sample-laravel-leaflet | 2a59fc35b429954e92dda49bfefe8f78070ba908 | [
"MIT"
] | null | null | null | map_2020-04-06.sql | rizkylab/sample-laravel-leaflet | 2a59fc35b429954e92dda49bfefe8f78070ba908 | [
"MIT"
] | null | null | null | map_2020-04-06.sql | rizkylab/sample-laravel-leaflet | 2a59fc35b429954e92dda49bfefe8f78070ba908 | [
"MIT"
] | null | null | null | # ************************************************************
# Sequel Pro SQL dump
# Version 4541
#
# http://www.sequelpro.com/
# https://github.com/sequelpro/sequelpro
#
# Host: localhost (MySQL 5.7.25)
# Database: map
# Generation Time: 2020-04-05 17:33:19 +0000
# ************************************************************
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
# Dump of table map
# ------------------------------------------------------------
DROP TABLE IF EXISTS `map`;
CREATE TABLE `map` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`nama` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`alamat` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`latitude` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`longitude` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`link` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`kategori` enum('Terminal','Kantor','Pelabuhan','Bandara','Angkot') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
LOCK TABLES `map` WRITE;
/*!40000 ALTER TABLE `map` DISABLE KEYS */;
INSERT INTO `map` (`id`, `nama`, `alamat`, `latitude`, `longitude`, `link`, `kategori`)
VALUES
(1,'Dishub Prov Bengkulu','Jl. Kapt. P. Tandean No.32, Jemb. Kecil, Kec. Singaran Pati, Kota Bengkulu, Bengkulu 38225','-3.8157474','102.2904071',NULL,'Kantor'),
(2,'Dinas Perhubungan BU','Jl. Kolonel Alamsyah SH, Kali, Arga Makmur, Kabupaten Bengkulu Utara, Bengkulu 38611','-3.4479424','102.1540052',NULL,'Kantor'),
(3,'Pelabuhan Bintuhan','Linau, Maje, Kaur Regency, Bengkulu 38963','-4.8427756','103.4111369',NULL,'Pelabuhan'),
(4,'Dinas Perhubungan Kab. Kaur','Jl. Lintas Bar., Ps. Sauh, Kaur Sel., Kabupaten Kaur, Bengkulu 38963','-4.7915598','103.3434377',NULL,'Kantor'),
(5,'Dinas Perhubungan Seluma','Talang Saling, Seluma, Seluma Regency, Bengkulu 38878','-4.081188','102.5504164',NULL,'Kantor'),
(6,'Dinas Perhubungan Kota Bengkulu','Beringin Raya, Muara Bangka Hulu, Bengkulu City, Bengkulu 38121','-3.7576759','102.2610789',NULL,'Kantor'),
(9,'Dinas Perhubungan Bengkulu Tengah','Surabaya, Sungai Serut, Bengkulu City, Bengkulu 38119','-3.7836075','102.3288029',NULL,'Kantor'),
(14,'Bandara Fatmawati Soekarno Putri','Jalan Raya Padang kemiling, Pekan Sabtu, Selebar, Pekan Sabtu, Kec. Selebar, Kota Bengkulu, Bengkulu 38877','-3.8607114','102.3393172',NULL,'Bandara'),
(19,'Terminal Gunung Ayu','Jl. Jenderal Ahmad Yani, Gn. Ayu, Kota Manna, Kabupaten Bengkulu Selatan, Bengkulu 38511','-4.4437962','102.9228206',NULL,'Terminal'),
(25,'Terminal Simpang Nangka','Jalan Raya Simpang Nangka, Curup, Simpang Nangka, Selupu Rejang, Kabupaten Rejang Lebong, Bengkulu','-3.4551222','102.5790198',NULL,'Terminal'),
(30,'Pelabuhan Pulau Baai','Pulau Baai, Jl. Yos Sudarso No.9, Tlk. Sepang, Kp. Melayu, Kota Bengkulu, Bengkulu 38216','-3.9315826','102.292667',NULL,'Pelabuhan'),
(31,'UPPKB Padang Ulak Tanding','Padang Ulak Tanding','-3.3356644','102.8230112','-','Kantor');
/*!40000 ALTER TABLE `map` ENABLE KEYS */;
UNLOCK TABLES;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| 56.485294 | 192 | 0.698776 |
120b2a82dee7c38f0b4e197e1d09702d925b7042 | 3,305 | kt | Kotlin | core-api/api/src/main/java/love/forte/simbot/api/message/containers/Containers.kt | 58563528/simpler-robot | ad8efda7936559edf8e7bd00f46ad08719a28c6d | [
"Apache-2.0"
] | 259 | 2020-09-25T01:31:18.000Z | 2022-03-31T02:06:34.000Z | core-api/api/src/main/java/love/forte/simbot/api/message/containers/Containers.kt | Maousuki/simpler-robot | a17fe3793e26fa1219d49f2afdb3b52c784a87c6 | [
"Apache-2.0"
] | 186 | 2020-11-19T15:17:17.000Z | 2022-03-09T02:07:42.000Z | core-api/api/src/main/java/love/forte/simbot/api/message/containers/Containers.kt | Maousuki/simpler-robot | a17fe3793e26fa1219d49f2afdb3b52c784a87c6 | [
"Apache-2.0"
] | 37 | 2020-10-09T06:47:06.000Z | 2022-03-31T02:00:35.000Z | /*
*
* * Copyright (c) 2021. ForteScarlet All rights reserved.
* * Project simple-robot
* * File MiraiAvatar.kt
* *
* * You can contact the author through the following channels:
* * github https://github.com/ForteScarlet
* * gitee https://gitee.com/ForteScarlet
* * email ForteScarlet@163.com
* * QQ 1149159218
*
*/
@file:JvmName("Containers")
@file:JvmMultifileClass
package love.forte.simbot.api.message.containers
import love.forte.simbot.annotation.ContainerType
import love.forte.simbot.api.message.assists.ActionMotivations
import love.forte.simbot.api.message.assists.Flag
import love.forte.simbot.api.message.assists.FlagContent
import love.forte.simbot.api.message.assists.Permissions
import java.util.concurrent.TimeUnit
/**
* 所有的Container的父接口
*/
@ContainerType("容器")
public interface Container
/**
* 原始数据容器。
* 定义可以得到原始数据的字符串信息。
*/
@ContainerType("原始数据容器")
public interface OriginalDataContainer : Container {
/**
* 得到原始数据字符串。
* 数据不应该为null。
*
* 原始数据信息一般用于debug或测试用,大部分情况下功能类似于toString。
*/
val originalData: String
}
/**
* 权限容器,定义可以得到一个 [权限][Permissions]。
*
* 一般代表这个人在群里的权限
*/
@ContainerType("权限容器")
public interface PermissionContainer : Container {
/**
* 权限信息。
*/
val permission: Permissions
}
/**
* 匿名容器,代表此容器是 **可能匿名的**。
*/
@ContainerType("可匿名容器")
public interface AnonymousContainer : Container {
/**
* 当前是否为 **匿名** 状态。
*/
val anonymous: Boolean
}
/**
* 禁言时间容器,代表此容器能够获得一个 **禁言时间(毫秒值)**。
*/
public interface MuteTimeContainer : Container {
/**
* (剩余的)禁言时间。当不支持或无法获取的时候返回 `-1`。
*/
val muteTime: Long
}
/**
* 时间容器,代表此容器能够获得一个 **时间(毫秒值)**。
*/
public interface TimeContainer : Container {
/**
* 获取时间。少数获取不到的情况下会返回`-1`, 但是一般大多数情况以当前时间戳代替。
* 不出意外,此值代表毫秒值。
*/
val time: Long
/**
* 根据给定的时间格式进行时间转化。不出意外的话,其中的[TimeUnit]必然是[TimeUnit.MILLISECONDS]。
*
* In Kotlin:
*
* ```kotlin
*
* // Demo1.kt
*
* val timeContainer: TimeContainer = ...
* // 获取时间的秒值信息。
* val secondTime = t.time { ::toSeconds }
*
* println(secondTime)
*
* ```
*
* In Java:
*
* ```java
*
* // Demo2.java
*
* TimeContainer timeContainer = ...;
* // 获取时间对应的秒值。
* long second = timeContainer.getTime(unit -> unit::toSeconds);
*
* System.out.println(second);
*
* ```
*
*/
fun <N> getTime(unit: TimeUnit.() -> ((Long) -> N)): N = unit(TimeUnit.MILLISECONDS)(time)
companion object {
@JvmSynthetic
inline fun <N> TimeContainer.time(unit: TimeUnit.() -> ((Long) -> N)): N = unit(TimeUnit.MILLISECONDS)(time)
}
}
/**
* 标识容器。定义可以得到一个标识。
*/
@ContainerType("标识容器")
// public interface FlagContainer<out T : FlagContent> : Container {
public interface FlagContainer<out F : Flag<T>, out T : FlagContent> : Container {
/** 标识 */
val flag: F
}
/**
* [行动动机][ActionMotivations]容器, 定义可以得到当前类型的动机类型。
*
* 一般来讲,此容器使用在枚举类上,例如消息事件中特有的类型枚举.
*
* @property actionMotivations ActionMotivations 得到对应的 [行动动机][ActionMotivations]
*/
@ContainerType("行动动机容器")
public interface ActionMotivationContainer : Container {
val actionMotivations: ActionMotivations
}
| 18.463687 | 116 | 0.627534 |
39cc1580deb6dabf63e8b987225e58ad972796cb | 1,429 | swift | Swift | Beneficie/Scenes/Adm_BankInformations/View/BankInformationsViewController.swift | Beneficie/PI_G8_BeneficieApp | dee5978d01e115e452c6d5d90e83b343007942d4 | [
"MIT"
] | 2 | 2021-02-08T12:56:48.000Z | 2021-02-10T12:26:50.000Z | Beneficie/Scenes/Adm_BankInformations/View/BankInformationsViewController.swift | Beneficie/PI_G8_BeneficieApp | dee5978d01e115e452c6d5d90e83b343007942d4 | [
"MIT"
] | null | null | null | Beneficie/Scenes/Adm_BankInformations/View/BankInformationsViewController.swift | Beneficie/PI_G8_BeneficieApp | dee5978d01e115e452c6d5d90e83b343007942d4 | [
"MIT"
] | 1 | 2021-02-08T12:04:27.000Z | 2021-02-08T12:04:27.000Z | //
// BankInformationsViewController.swift
// PI_G8_BeneficieApp
//
// Created by Dominique Nascimento Bezerra on 24/11/20.
//
import UIKit
class BankInformationsViewController: UIViewController {
@IBOutlet weak var BanksListTableView: UITableView!
@IBOutlet weak var newBankButton: UIButton!
var currentUser = User()
var viewModel = BanksMenuViewModel()
override func viewDidLoad() {
super.viewDidLoad()
BanksListTableView.delegate = self
BanksListTableView.dataSource = self
newBankButton.layer.cornerRadius = 15
}
@IBAction func backButton(_ sender: Any) {
navigationController?.popViewController(animated: true)
}
@IBAction func profileButton(_ sender: Any) {
self.viewModel.goToProfileScreen(user: currentUser, navigationController: self.navigationController)
}
}
extension BankInformationsViewController: UITableViewDelegate {
}
extension BankInformationsViewController: UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return viewModel.arrayBanks.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = UITableViewCell()
cell.textLabel?.text = viewModel.arrayBanks[indexPath.row].name
return cell
}
}
| 25.981818 | 108 | 0.701889 |
9eb7a5af0b8f07c2413f54e8f4e3941385431ba5 | 2,640 | lua | Lua | addons/sandbox/build/sandbox.lua | Gurman8r/modus | 5c97a89f77c1c5733793dddc20c5ce4afe1fd134 | [
"MIT"
] | null | null | null | addons/sandbox/build/sandbox.lua | Gurman8r/modus | 5c97a89f77c1c5733793dddc20c5ce4afe1fd134 | [
"MIT"
] | null | null | null | addons/sandbox/build/sandbox.lua | Gurman8r/modus | 5c97a89f77c1c5733793dddc20c5ce4afe1fd134 | [
"MIT"
] | null | null | null | -- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * --
group "addons"
project "sandbox"
targetname "%{prj.name}"
targetdir "%{wks.location}/bin-lib/%{cfg.platform}/%{cfg.buildcfg}/addons/"
objdir "%{wks.location}/bin-obj/%{cfg.platform}/%{cfg.buildcfg}/addons/"
location "%{wks.location}/project/%{_ACTION}/addons/%{prj.name}/"
debugdir "%{wks.location}/bin/%{cfg.platform}/%{cfg.buildcfg}/"
kind "SharedLib"
language "C++"
cppdialect "C++17"
staticruntime "Off"
rtti "On"
systemversion "latest"
dependson{
"modus_launcher",
}
defines{
"_CRT_SECURE_NO_WARNINGS", "NOMINMAX",
"IMGUI_API=__declspec(dllimport)",
}
undefines{
"NDEBUG",
}
debugenvs{
"%{wks.location}/bin/%{cfg.platform}/%{cfg.buildcfg}/",
}
libdirs{
"%{wks.location}/bin-lib/",
"%{wks.location}/bin-lib/",
"%{wks.location}/bin-lib/%{cfg.platform}/",
"%{wks.location}/bin-lib/%{cfg.platform}/%{cfg.buildcfg}/",
"%{wks.location}/vendor/bin-lib/",
"%{wks.location}/vendor/bin-lib/",
"%{wks.location}/vendor/bin-lib/%{cfg.platform}/",
"%{wks.location}/vendor/bin-lib/%{cfg.platform}/%{cfg.buildcfg}/",
}
links{
"opengl32",
"glfw",
"imgui",
"modus_core",
}
includedirs{
"%{wks.location}/source",
"%{wks.location}/vendor/source",
"%{wks.location}/vendor/source/json/include",
"%{wks.location}/vendor/source/pybind11/include",
"%{wks.location}/vendor/source/cpython/Include",
"%{wks.location}/vendor/source/cpython/Include/internal",
"%{wks.location}/vendor/source/cpython/PC",
"%{wks.location}/vendor/source/entt/src",
"%{wks.location}/vendor/source/imgui",
"%{wks.location}/vendor/source/imgui-node-editor/NodeEditor/Include",
}
files{
"%{wks.location}/addons/%{prj.name}/build/**.**",
"%{wks.location}/resource/%{prj.name}.**",
"%{wks.location}/addons/%{prj.name}/resource/**.**",
"%{wks.location}/addons/%{prj.name}/source/**.**",
}
postbuildcommands{
"%{ml_copy} %{wks.location}\\bin-lib\\%{cfg.platform}\\%{cfg.buildcfg}\\addons\\%{prj.name}%{ml_dll} %{wks.location}\\bin\\%{cfg.platform}\\%{cfg.buildcfg}\\addons\\",
}
filter{ "configurations:Debug" }
symbols "On"
links{
"glew32d",
"python39_d",
}
filter{ "configurations:Release" }
optimize "Speed"
links{
"glew32",
"python39",
}
-- WINDOWS
filter{ "system:Windows", "configurations:Debug" }
linkoptions{
"/NODEFAULTLIB:MSVCRT.lib", "/NODEFAULTLIB:LIBCMT.lib", "/NODEFAULTLIB:LIBCMTD.lib"
}
filter{ "system:Windows", "configurations:Release" }
linkoptions{
"/NODEFAULTLIB:LIBCMT.lib"
}
-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -- | 25.882353 | 168 | 0.617424 |
28c1b2a3f7b891a2d5105b63702e29ad96af5bd9 | 3,565 | rb | Ruby | spec/active_model/validations/relations_spec.rb | sleepingkingstudios-archive/active_model-validations-relations | 5106101f625539d34d0015b7e10c11198c4b62f8 | [
"MIT"
] | null | null | null | spec/active_model/validations/relations_spec.rb | sleepingkingstudios-archive/active_model-validations-relations | 5106101f625539d34d0015b7e10c11198c4b62f8 | [
"MIT"
] | null | null | null | spec/active_model/validations/relations_spec.rb | sleepingkingstudios-archive/active_model-validations-relations | 5106101f625539d34d0015b7e10c11198c4b62f8 | [
"MIT"
] | null | null | null | # spec/active_model/validations/relations_spec.rb
require 'spec_helper'
require 'active_model/validations/relations'
require 'active_model/validations/relations/serializers/underscore_serializer'
RSpec.describe ActiveModel::Validations::Relations do
let(:described_class) { Class.new.send(:include, ActiveModel::Validations).send(:include, super()) }
describe '::validates_related_records' do
it { expect(described_class).to respond_to(:validates_related_documents).with(1..2).arguments }
it { expect(described_class).to respond_to(:validates_related_records).with(1..2).arguments }
describe 'with :inventor' do
it 'should set a validation on the base class' do
expect(described_class).to receive(:validates_with) do |validator_class|
expect(validator_class).to be < ActiveModel::Validations::Relations::One
validator = validator_class.new
expect(validator.send :relation_name).to be == :inventor
end # expect
described_class.validates_related_records :inventor
end # it
end # describe
describe 'with :widgets' do
it 'should set a validation on the base class' do
expect(described_class).to receive(:validates_with) do |validator_class|
expect(validator_class).to be < ActiveModel::Validations::Relations::Many
validator = validator_class.new
expect(validator.send :relation_name).to be == :widgets
end # expect
described_class.validates_related_records :widgets
end # it
end # describe
describe 'with :sheep, :arity => :one' do
it 'should set a validation on the base class' do
expect(described_class).to receive(:validates_with) do |validator_class|
expect(validator_class).to be < ActiveModel::Validations::Relations::One
validator = validator_class.new
expect(validator.send :relation_name).to be == :sheep
end # expect
described_class.validates_related_records :sheep
end # it
end # describe
describe 'with :sheep, :arity => :many' do
it 'should set a validation on the base class' do
expect(described_class).to receive(:validates_with) do |validator_class|
expect(validator_class).to be < ActiveModel::Validations::Relations::Many
validator = validator_class.new
expect(validator.send :relation_name).to be == :sheep
end # expect
described_class.validates_related_records :sheep, :arity => :many
end # it
end # describe
describe 'with :trolls, :arity => :trololol' do
it 'raises an error' do
expect {
described_class.validates_related_records :trolls, :arity => :trololol
}.to raise_error ArgumentError, /unrecognized arity/
end # it
end # describe
describe 'with :patents, :serializer => UnderscoreSerializer' do
let(:serializer) { ActiveModel::Validations::Relations::Serializers::UnderscoreSerializer }
it 'should set a validation on the base class' do
expect(described_class).to receive(:validates_with) do |validator_class|
expect(validator_class).to be < ActiveModel::Validations::Relations::Many
validator = validator_class.new
expect(validator.send :relation_name).to be == :patents
expect(validator.send :serializer).to be == serializer
end # expect
described_class.validates_related_records :patents, :serializer => serializer
end # it
end # describe
end # describe
end # describe
| 38.333333 | 102 | 0.692286 |
f71a18b7e8d2aa4b616cd27548491bff4ce2bca9 | 44 | asm | Assembly | src/bootc/start.asm | devcfei/bootstrap-x86 | c16824b76df59bc9305cfee10b07baa6e2c41dd7 | [
"Unlicense"
] | null | null | null | src/bootc/start.asm | devcfei/bootstrap-x86 | c16824b76df59bc9305cfee10b07baa6e2c41dd7 | [
"Unlicense"
] | null | null | null | src/bootc/start.asm | devcfei/bootstrap-x86 | c16824b76df59bc9305cfee10b07baa6e2c41dd7 | [
"Unlicense"
] | null | null | null | extern kmain
[bits 32]
_start:
call kmain | 8.8 | 12 | 0.727273 |
3bdb2fa01df1b760e98777011a56cc3f66facf45 | 3,277 | h | C | algorithms/hard/1216. Valid Palindrome III.h | MultivacX/letcode2020 | f86289f8718237303918a7705ae31625a12b68f6 | [
"MIT"
] | null | null | null | algorithms/hard/1216. Valid Palindrome III.h | MultivacX/letcode2020 | f86289f8718237303918a7705ae31625a12b68f6 | [
"MIT"
] | null | null | null | algorithms/hard/1216. Valid Palindrome III.h | MultivacX/letcode2020 | f86289f8718237303918a7705ae31625a12b68f6 | [
"MIT"
] | null | null | null | // 1216. Valid Palindrome III
// https://leetcode.com/problems/valid-palindrome-iii/
// Runtime: 16 ms, faster than 92.83% of C++ online submissions for Valid Palindrome III.
// Memory Usage: 14.3 MB, less than 86.55% of C++ online submissions for Valid Palindrome III.
class Solution {
vector<vector<int>> memo;
int makePalindrome(const string& s, int i, int j) {
if (i >= j) return 0;
if (i + 1 == j) return s[i] == s[j] ? 0 : 1;
if (memo[i][j] != -1) return memo[i][j];
int ans = 0;
if (s[i] == s[j]) ans = makePalindrome(s, i + 1, j - 1);
else ans = 1 + min(makePalindrome(s, i + 1, j), makePalindrome(s, i, j - 1));
memo[i][j] = ans;
return ans;
}
public:
bool isValidPalindrome(string s, int k) {
const int n = s.length();
if (n == k) return true;
memo = vector<vector<int>>(n, vector<int>(n, -1));
return makePalindrome(s, 0, s.length() - 1) <= k;
}
};
// TLE
// 48 / 50 test cases passed.
class Solution {
int n;
vector<vector<vector<int>>> memo;
vector<vector<pair<int, int>>> ij;
bool isPalindromic(const string& s, int& i, int& j) {
if (i < n && j > -1 && ij[i][j].first != -1)
return ij[i][j].first >= ij[i][j].second;
while (i < j && s[i] == s[j])
++i, --j;
ij[i][j].first = i;
ij[i][j].second = j;
return i >= j;
}
bool isValidPalindrome(const string& s, int k, int i, int j) {
if (isPalindromic(s, i, j)) return true;
if (k == j - i + 1) return true;
if (k <= 0) return false;
if (memo[i][j][k] != -1) return memo[i][j][k];
bool ans = isValidPalindrome(s, k - 1, i + 1, j) ||
isValidPalindrome(s, k - 1, i, j - 1);
memo[i][j][k] = ans;
return ans;
}
public:
bool isValidPalindrome(string s, int k) {
n = s.length();
if (n == k) return true;
memo = vector<vector<vector<int>>>(n, vector<vector<int>>(n, vector<int>(k + 1, -1)));
ij = vector<vector<pair<int, int>>>(n, vector<pair<int, int>>(n, {-1, -1}));
return isValidPalindrome(s, k, 0, s.length() - 1);
}
};
// TLE
// 44 / 50 test cases passed.
class Solution {
int n;
vector<vector<pair<int, int>>> ij;
bool isPalindromic(const string& s, int& i, int& j) {
if (i < n && j > -1 && ij[i][j].first != -1)
return ij[i][j].first >= ij[i][j].second;
while (i < j && s[i] == s[j])
++i, --j;
ij[i][j].first = i;
ij[i][j].second = j;
return i >= j;
}
bool isValidPalindrome(const string& s, int k, int i, int j) {
if (isPalindromic(s, i, j)) return true;
if (k == j - i + 1) return true;
if (k <= 0) return false;
return isValidPalindrome(s, k - 1, i + 1, j) ||
isValidPalindrome(s, k - 1, i, j - 1);
}
public:
bool isValidPalindrome(string s, int k) {
n = s.length();
if (n == k) return true;
ij = vector<vector<pair<int, int>>>(n, vector<pair<int, int>>(n, {-1, -1}));
return isValidPalindrome(s, k, 0, s.length() - 1);
}
}; | 31.509615 | 94 | 0.49527 |
21b8307a13b9e34cefb81e6f59df6ac47d4ae1c8 | 3,032 | kt | Kotlin | src/main/kotlin/io/github/karlatemp/klib/formatter/Formatter.kt | Karlatemp/KLib | e09af7451961417cda17f974c96f2a353a2f3fc5 | [
"MIT"
] | 2 | 2020-05-14T13:56:47.000Z | 2021-07-15T15:08:48.000Z | src/main/kotlin/io/github/karlatemp/klib/formatter/Formatter.kt | Karlatemp/KLib | e09af7451961417cda17f974c96f2a353a2f3fc5 | [
"MIT"
] | null | null | null | src/main/kotlin/io/github/karlatemp/klib/formatter/Formatter.kt | Karlatemp/KLib | e09af7451961417cda17f974c96f2a353a2f3fc5 | [
"MIT"
] | null | null | null | /*
* Copyright (c) 2018-2020 Karlatemp. All rights reserved.
* @author Karlatemp <karlatemp@vip.qq.com> <https://github.com/Karlatemp>
* @create 2020/05/13 21:26:55
*
* KLib/KLib.main/Formatter.kt
*/
@file:Suppress("MemberVisibilityCanBePrivate")
package io.github.karlatemp.klib.formatter
import java.util.*
abstract class Formatter {
abstract fun parse(
template: String
): Template
}
class NoneTemplate(private val key: String) : Template() {
override fun format(buffer: StringBuilder, vararg arguments: String) {
buffer.append("{unknown i18n $key}")
}
}
abstract class Template {
fun doFormat(
buffer: StringBuilder,
vararg arguments: String
): StringBuilder {
return buffer.also { format(it, *arguments) }
}
operator fun get(vararg arguments: String): String {
return StringBuilder().also { format(it, *arguments) }.toString()
}
abstract fun format(
buffer: StringBuilder,
vararg arguments: String
)
}
abstract class Action {
abstract fun apply(
buffer: StringBuilder,
vararg arguments: String
)
}
open class LinkedTemplate(
val actions: Collection<Action>
) : Template() {
override fun toString(): String {
return "LinkedTemplate{$actions}"
}
override fun format(buffer: StringBuilder, vararg arguments: String) {
actions.forEach {
it.apply(buffer, *arguments)
}
}
}
open class ArgumentAction(val slot: Int) : Action() {
override fun toString(): String {
return "Argument{$slot}"
}
override fun apply(
buffer: StringBuilder,
vararg arguments: String
) {
(arguments.getOrNull(slot)
?: return buffer.append("{$slot}").let {})
.apply { buffer.append(this) }
}
}
open class TextAction(
val content: String,
val start: Int = 0,
end: Int = -1
) : Action() {
override fun toString(): String {
return "Text{${content.substring(start, end)}}"
}
val end = if (end == -1) content.length else end
override fun apply(buffer: StringBuilder, vararg arguments: String) {
buffer.append(content, start, end)
}
}
object FEFormatter : Formatter() {
override fun parse(template: String): Template {
val linked = LinkedList<Action>()
var index = 0
while (true) {
val ind = template.indexOf('{', index)
if (ind == -1) break
linked.add(TextAction(template, index, ind))
index = ind
val ed = template.indexOf('}', ind)
if (ed == -1) break
index = ed + 1
val ct = template.substring(ind + 1, ed)
ct.toIntOrNull()?.also {
linked.add(ArgumentAction(it))
} ?: kotlin.run {
linked.add(TextAction(template, ind, index))
}
}
linked.add(TextAction(template, index))
return LinkedTemplate(linked)
}
}
| 24.451613 | 74 | 0.593997 |
9c4b7a2a8c37749c21b1e7a4a05c5caf93b62206 | 66 | js | JavaScript | ported_plugins/behaviors/rex_cameraFollower/source/c3runtime/conditions.js | 2SGamix/construct-plugins | a1213364084b3f3ab8e80cee281f7a3b56d3e51a | [
"MIT"
] | 34 | 2018-11-26T19:19:50.000Z | 2022-03-13T05:22:58.000Z | ported_plugins/behaviors/rex_cameraFollower/source/c3runtime/conditions.js | 2SGamix/construct-plugins | a1213364084b3f3ab8e80cee281f7a3b56d3e51a | [
"MIT"
] | 25 | 2019-02-06T23:31:50.000Z | 2021-03-07T18:42:50.000Z | ported_plugins/behaviors/rex_cameraFollower/source/c3runtime/conditions.js | 2SGamix/construct-plugins | a1213364084b3f3ab8e80cee281f7a3b56d3e51a | [
"MIT"
] | 19 | 2019-02-05T09:39:36.000Z | 2022-01-25T06:37:50.000Z | "use strict";
{
C3.Behaviors.Rex_CameraFollower.Cnds =
{
};
} | 8.25 | 39 | 0.636364 |
e5399c49952ad461d6f69268d3ccb326e2eb39b3 | 130,067 | asm | Assembly | Library/GrObj/Body/body.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Library/GrObj/Body/body.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Library/GrObj/Body/body.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1989 -- All Rights Reserved
PROJECT: PC GEOS
MODULE:
FILE: body.asm
AUTHOR: Steve Scholl, Nov 15, 1989
ROUTINES:
Name Description
---- -----------
GrObjBodySetBoundsLow
GrObjBodyAlloc
GrObjBodyAllocGrObjBlock
GrObjBodySetGrObjDrawFlags
MSG_HANDLERS
Name
----
GrObjBodyInitialize
GrObjBodyVupCreateGState
GrObjBodyAddGrObj
GrObjBodyRemoveGrObj
GrObjBodyAddGrObjLow
GrObjBodyRemoveGrObjLow
GrObjBodyChangeGrObjDepth
GrObjBodyAttachHead
GrObjBodyAttachGOAM
GrObjBodyDetachGOAM
GrObjBodyAttachRuler
GrObjBodyStrayMouseEvents
GrObjBodyVupAlterInputFlow
GrObjBodyVisLayerSetDocBounds
GrObjBodyGetDocBounds
GrObjBodyGetBlockForOneGrObj
GrObjBodyGrab
GrObjBodyViewScaleFactorChanged
GrObjBodyGetWindow
GrObjBodyAddGrObjThenDraw
GrObjBodySetBounds
GrObjBodyAttachUI
GrObjBodyDetachUI
GrObjBodySetActionNotificationOutput
GrObjBodySuspend
GrObjBodyUnsuspend
GrObjBodyAlterFTVMCExcl
GrObjBodyGetTarget
GrObjBodyGetFocus
GrObjBodyGrabTargetFocus
REVISION HISTORY:
Name Date Description
---- ---- -----------
Steve 11/15/89 Initial revision
DESCRIPTION:
This file contains routines to implement the GrObjBody class.
$Id: body.asm,v 1.1 97/04/04 18:08:08 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjInitCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyInitialize
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Primitive initialization of body to match defaults
in grobj.uih
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This method should be optimized for SMALL SIZE over SPEED
Common cases:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 1/29/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyInitialize method dynamic GrObjBodyClass, MSG_META_INITIALIZE
.enter
mov di,offset GrObjBodyClass
call ObjCallSuperNoLock
mov di,ds:[si]
add di,ds:[di].Vis_offset
; We'll need to mark ourselves as VTF_IS_INPUT_NODE in order to
; get MSG_META_MUP_ALTER_FTVMC_EXCL. -- Doug 2/9/93
;
ornf ds:[di].VI_typeFlags, mask VTF_IS_INPUT_NODE
; Clear all the geometry bits that will make my life
; miserable
;
andnf ds:[di].VI_optFlags, not (mask VOF_GEO_UPDATE_PATH or \
mask VOF_GEOMETRY_INVALID or \
mask VOF_IMAGE_INVALID or \
mask VOF_IMAGE_UPDATE_PATH )
andnf ds:[di].VI_attrs, not mask VA_MANAGED
ornf ds:[di].VI_attrs, mask VA_FULLY_ENABLED
mov di,ds:[si]
add di,ds:[di].GrObjBody_offset
mov ds:[di].GBI_desiredHandleSize,DEFAULT_DESIRED_HANDLE_SIZE
ornf ds:[di].GBI_flags, mask GBF_DEFAULT_TARGET or \
mask GBF_DEFAULT_FOCUS
ornf ds:[di].GBI_drawFlags, mask GODF_DRAW_INSTRUCTIONS
;
; We want to set the interesting point to some outrageous value
; so that the first paste will end up the middle of the screen,
; rather than in the upper left corner
;
mov ax, -30000
segmov es, ds
add di, offset GBI_interestingPoint
mov cx, size PointDWFixed/2
rep stosw
.leave
ret
GrObjBodyInitialize endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyAttachHead
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Set the od of the head in the body
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBody
cx:dx - optr of head
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 7/17/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyAttachHead method dynamic GrObjBodyClass, MSG_GB_ATTACH_HEAD
.enter
mov ds:[di].GBI_head.handle,cx
mov ds:[di].GBI_head.chunk,dx
.leave
ret
GrObjBodyAttachHead endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyAttachGOAM
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Set the od of the oam in the body
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBody
cx:dx - optr of goam
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 7/17/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyAttachGOAM method dynamic GrObjBodyClass, MSG_GB_ATTACH_GOAM
uses cx,dx
.enter
mov ds:[di].GBI_goam.handle,cx
mov ds:[di].GBI_goam.chunk,dx
clr di
mov cx,ds:[LMBH_handle]
mov dx,si
mov ax, MSG_GOAM_ATTACH_BODY
call GrObjBodyMessageToGOAM
.leave
ret
GrObjBodyAttachGOAM endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyDetachGOAM
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Clear the od of the oam in the body
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBody
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 7/17/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyDetachGOAM method dynamic GrObjBodyClass, MSG_GB_DETACH_GOAM
.enter
clr ds:[di].GBI_goam.handle
clr di
mov cx,ds:[LMBH_handle]
mov dx,si
mov ax, MSG_GOAM_DETACH_BODY
call GrObjBodyMessageToGOAM
.leave
ret
GrObjBodyDetachGOAM endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyAttachRuler
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Set the od of the ruler in the body
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBody
cx:dx - optr of ruler
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 7/17/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyAttachRuler method dynamic GrObjBodyClass, MSG_GB_ATTACH_RULER
.enter
mov ds:[di].GBI_ruler.handle,cx
mov ds:[di].GBI_ruler.chunk,dx
.leave
ret
GrObjBodyAttachRuler endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyVisOpen
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Handle MSG_VIS_OPEN
Note: We purposely don't call our super class because
we don't want the superclass to muck with the vis bits
nor do we want it to send vis open to our children.
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjClass
bp - window
RETURN:
nothing
DESTROYED:
ax,cx,dx,bp
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 4/23/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyVisOpen method GrObjBodyClass, MSG_VIS_OPEN
.enter
mov di, ds:[si]
add di, ds:[di].Vis_offset ; ds:di = VisInstance
EC < test ds:[di].VI_attrs, mask VA_REALIZED >
EC < ERROR_NZ GRAPHIC_OBJECT_ALREADY_OPENED >
; If not passed a window, then query up for one
;
tst bp ;window
jnz haveWindow
call VisQueryParentWin
EC < tst di >
EC < ERROR_Z GRAPHIC_NO_PARENT_WIN_FOUND >
mov bp, di ;window
haveWindow:
; INCREMENT INTERACTIBLE COUNT for object
; block. The other half of this
; inc/dec pair is mirrored in
; VisClose, which is one more reason
; why these methods must be
; symmetrical.
call ObjIncInteractibleCount
; Mark body as realized and if it is a composite then
; store the window handle
;
mov di, ds:[si]
add di, ds:[di].Vis_offset
or ds:[di].VI_attrs, mask VA_REALIZED
test ds:[di].VI_typeFlags, mask VTF_IS_COMPOSITE
jz done ; if not, done
; Save window handle for non-win composites
;
EC < cmp ds:[di].VCI_window, 0 ; see if window stored here >
EC < ERROR_NZ GRAPHIC_OBJECT_NOT_REALIZED_YET_HAS_GWIN >
EC < xchg bx, bp >
EC < call ECCheckWindowHandle >
EC < xchg bx, bp >
mov ds:[di].VCI_window, bp ;keep window handle in instance data
; If for some reason we created a gstate when we didn't have
; a window then jump to recreate our gstate and any
; of our childrens' cached gstates, otherwise
; just vup us a new one.
;
mov di,ds:[si]
add di,ds:[di].GrObjBody_offset
tst ds:[di].GBI_graphicsState
jnz recreate
mov ax,MSG_VIS_VUP_CREATE_GSTATE
call ObjCallInstanceNoLock
mov di,ds:[si]
add di,ds:[di].GrObjBody_offset
mov ds:[di].GBI_graphicsState,bp
; Vis objects in the grobj do not receive vis open
; So, don't send it
;
checkTargeted:
; If already gained target then draw handles of objects with
; newly created gstate. Else grab target and the gain target
; excl routine will draw the handles
;
test ds:[di].GBI_fileStatus, mask GOFS_TARGETED
jnz drawHandles ;jmp if already the target
done:
.leave
ret
;; We already have the target but have been unable to draw
;; the handles of the currently selected objects
;; because we had no gstate, but now we do
;; Also, update the ui for the selected objects
drawHandles:
mov dx,ds:[di].GBI_graphicsState
mov ax,MSG_GO_DRAW_HANDLES_RAW
call GrObjBodySendToSelectedGrObjsAndEditGrab
mov cx, mask GrObjUINotificationTypes
mov ax,MSG_GB_UPDATE_UI_CONTROLLERS
call ObjCallInstanceNoLock
jmp short done
recreate:
mov ax,MSG_VIS_RECREATE_CACHED_GSTATES
call ObjCallInstanceNoLock
jmp checkTargeted
GrObjBodyVisOpen endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyVisClose
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:
Handle MSG_VIS_CLOSE
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
RETURN:
nothing
DESTROYED:
ax,cx,dx,bp
PSEUDO CODE/STRATEGY:
nothing
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This method should be optimized for SMALL SIZE over SPEED
Common cases:
gstate exists
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 4/23/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyVisClose method dynamic GrObjBodyClass, MSG_VIS_CLOSE
.enter
mov di,offset GrObjBodyClass
call ObjCallSuperNoLock
; Vis objects in the grobj don't receive vis close
; So don't send it.
;
; Destroy the gstate if it exists. They may not be a gstate
; if the user reverts to an empty document.
;
mov bx,ds:[si]
add bx,ds:[bx].GrObjBody_offset
clr di
xchg di,ds:[bx].GBI_graphicsState
tst di
jz done
call GrDestroyState
done:
Destroy ax,cx,dx,bp
.leave
ret
GrObjBodyVisClose endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyAttachUI
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Prepare GrObjBody for opening after it has been
added to the Document/Content. Mark body as open
and create selection array.
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
cx:dx - OD of GrObjHead
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This method should be optimized for SMALL SIZE over SPEED
Common cases:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 1/31/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyAttachUI method dynamic GrObjBodyClass, MSG_GB_ATTACH_UI
.enter
; Do some heavy error checking on the vm file
;
EC < push ax,bx >
EC < test ds:[LMBH_flags],mask LMF_IS_VM >
EC < ERROR_Z GROBJ_BODY_MUST_BE_ATTACHED_TO_VM >
EC < mov bx,ds:[LMBH_handle] >
EC < mov ax,MGIT_OWNER_OR_VM_FILE_HANDLE >
EC < call MemGetInfo >
EC < mov bx,ax ;vm file handle >
EC < call VMGetAttributes >
EC < test al, mask VMA_OBJECT_RELOC >
EC < ERROR_Z GROBJ_BAD_VM_ATTRIBUTES >
EC < test al, mask VMA_SYNC_UPDATE or mask VMA_TEMP_ASYNC >
EC < ERROR_Z GROBJ_BAD_VM_ATTRIBUTES >
EC < test al, mask VMA_NO_DISCARD_IF_IN_USE >
EC < ERROR_Z GROBJ_BAD_VM_ATTRIBUTES >
EC < pop ax,bx >
; The body cannot be discarded. So inc its in use count
; which will prevent it from being discarded.
; In general the in use count will already be non zero
; because the body will be added to the content/document
; with MSG_VIS_ADD_NON_DISCARDABLE_VM_CHILD each time the
; document is opened.. However, in some files the body may
; be a child of an object in the file, so the body will not
; be added to this other object each time the document is opened.
; So incing the in use count here will prevent the body from
; being discarded in these cases. (Note: the in use count
; is cleared whenever a file is opened)
;
call ObjIncInUseCount
mov ax,MSG_GB_ATTACH_HEAD
call ObjCallInstanceNoLock
mov di,ds:[si]
add di,ds:[di].GrObjBody_offset
ornf ds:[di].GBI_fileStatus, mask GOFS_OPEN
call GrObjBodyCreateSelectionArray
; Must grab grabs after creating selection array because
; the GAINED messages may need to process selection list
;
mov di,ds:[si]
add di,ds:[di].GrObjBody_offset
test ds:[di].GBI_flags, mask GBF_DEFAULT_TARGET
jz checkDefaultFocus
call MetaGrabTargetExclLow
checkDefaultFocus:
test ds:[di].GBI_flags, mask GBF_DEFAULT_FOCUS
jz done
call MetaGrabFocusExclLow
done:
.leave
ret
GrObjBodyAttachUI endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyDetachUI
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Prepare GrObjBody for closing before it is removed
from the body. Mark body as closed and destroy
selection array.
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This method should be optimized for SMALL SIZE over SPEED
Common cases:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 1/31/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyDetachUI method dynamic GrObjBodyClass, MSG_GB_DETACH_UI
.enter
;
; We probably won't have an undo context here -- in any case, we
; want to ignore these actions, so no chains/actions will be added,
; causing a horrible death.
;
call GrObjGlobalUndoIgnoreActions
;
; clear this flag before releasing the target, so that
; children will know the document is closing
;
mov di,ds:[si]
add di,ds:[di].GrObjBody_offset
andnf ds:[di].GBI_fileStatus, not mask GOFS_OPEN
; Must release grabs before destroying selection array
; because some of the LOST message do things with the
; selection list.
;
call MetaReleaseFocusExclLow
call MetaReleaseTargetExclLow
; We may have become the current body without become the
; target if the EditTextGuardian rejected a start select.
; So just in case make sure we aren't the current body.
;
mov cx,ds:[LMBH_handle]
mov dx,si
mov ax,MSG_GH_CLEAR_CURRENT_BODY
clr di ;MessageFlags
call GrObjBodyMessageToHead
; If we didn't do this then we would end up with objects
; that had their GOTM_SELECTED bit set but weren't
; in the selection array.
;
call GrObjBodyRemoveAllGrObjsFromSelectionList
call GrObjBodyDestroySelectionArray
call GrObjGlobalUndoAcceptActions
.leave
ret
GrObjBodyDetachUI endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodySetBoundsWithoutMarkingDirty
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Set bounds of body
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
ss:bp - RectDWord
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This method should be optimized for SMALL SIZE over SPEED
Common cases:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 1/29/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodySetBoundsWithoutMarkingDirty method dynamic GrObjBodyClass, MSG_GB_SET_BOUNDS_WITHOUT_MARKING_DIRTY
.enter
call GrObjBodySetBoundsLow
.leave
ret
GrObjBodySetBoundsWithoutMarkingDirty endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyGetBounds
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Return bounds of the Body
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
ss:bp - RectDWord buffer to fill
RETURN:
ss:bp - RectDWord buffer filled
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This method should be optimized for SMALL SIZE over SPEED
Common cases:
unknown
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 3/17/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyGetBounds method dynamic GrObjBodyClass, MSG_GB_GET_BOUNDS
uses cx
.enter
lea si, ds:[di].GBI_bounds ;ds:si = source
segmov es, ss
mov di, bp
mov cx, (size RectDWord)/2
rep movsw
.leave
ret
GrObjBodyGetBounds endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyVisLayerSetDocBounds
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Set the document bounds to the passed rectangle
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
ss:bp - RectDWord structure
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
chrisb 11/14/91 Initial revision
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyVisLayerSetDocBounds method dynamic GrObjBodyClass,
MSG_VIS_LAYER_SET_DOC_BOUNDS,
MSG_GB_SET_BOUNDS
;
; If there's no change, don't mark dirty!
;
push si
lea si, ds:[di].GBI_bounds
mov di, bp
segmov es, ss
mov cx, size RectDWord/2
repe cmpsw
pop si
je done
call ObjMarkDirty
call GrObjBodySetBoundsLow
done:
ret
GrObjBodyVisLayerSetDocBounds endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodySetBoundsLow
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Set bounds of body
CALLED BY: INTERNAL
GrObjBodySetBounds
PASS:
*(ds:si) - body instance
ss:bp - RectDWord
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
NOTE: This low level routine does NOT dirty the document.
This simplifies things for the spreadsheet which doesn't
want to dirty the document when the bounds change. It
can subclass the messages for changing the bound and
have them call this routine without also calling ObjMarkDirty.
This routine should be optimized for SMALL SIZE over SPEED
Common cases:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 7/25/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodySetBoundsLow proc far
uses ax,bx,cx,dx,bp,di,es
class GrObjBodyClass
.enter
EC < call ECGrObjBodyCheckLMemObject >
; Copy the new bounds into the body's instance data noting
; if the upper left of the bounds move.
;
clr cx ;assume no gstate recalc needed
mov di,ds:[si]
add di,ds:[di].GrObjBody_offset
movdw bxax,ss:[bp].RD_left
cmpdw bxax,ds:[di].GBI_bounds.RD_left
je 10$
inc cx ;left moved, need recalc gstate
movdw ds:[di].GBI_bounds.RD_left,bxax
10$:
movdw bxax,ss:[bp].RD_top
cmpdw bxax,ds:[di].GBI_bounds.RD_top
je 20$
inc cx ;top moved, need recalc gstate
movdw ds:[di].GBI_bounds.RD_top,bxax
20$:
movdw bxax,ss:[bp].RD_right
movdw ds:[di].GBI_bounds.RD_right,bxax
movdw bxax,ss:[bp].RD_bottom
movdw ds:[di].GBI_bounds.RD_bottom,bxax
; If the upper left didn't change then we are done
;
jcxz done
; The upper left changing affects the
; translation stored in the cached gstate
;
mov ax,MSG_VIS_RECREATE_CACHED_GSTATES
call ObjCallInstanceNoLock
; Changing the upper left also affects how mouse events
; are translated.
;
mov di,ds:[si]
add di,ds:[di].GrObjBody_offset
test ds:[di].GBI_fileStatus,mask GOFS_MOUSE_GRAB
jz done
call VisGrabMouse
done:
.leave
ret
GrObjBodySetBoundsLow endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyViewScaleFactorChanged
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Notify the body that the scale factor in the view has
changed. This default handler recalculates the
curHandleWidth and curHandleHeight based on the new
scale factor and desiredHandle size
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
ss:bp - ScaleChangedParams
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
DO NOT MARK THE BODY DIRTY when setting the curHandleWidth
and curHandleHeight information. This info is only
relevant while the document is open so it does not need
to be saved. Plus, MSG_META_CONTENT_VIEW_SCALE_FACTOR_CHANGED
is always sent when the document is opened, so the body
would always become instantly dirty. Very bad.
This method should be optimized for SMALL SIZE over SPEED
Common cases:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 1/22/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyViewScaleFactorChanged method dynamic GrObjBodyClass,
MSG_META_CONTENT_VIEW_SCALE_FACTOR_CHANGED
.enter
CheckHack <offset SCP_scaleFactor eq 0>
call GrObjBodyCalcHandleSizesFromScaleFactor
.leave
ret
GrObjBodyViewScaleFactorChanged endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyCalcHandleSizesFromScaleFactor
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Description: Calculates GBI_curHandle* from the passed view scale
and the desired handle size. Also figures out nudge
distances
Pass: *ds:si - GrObjBody
ss:[bp] - PointWWFixed
Return: nothing
Destroyed: nothing
Comments:
Revision History:
Name Date Description
---- ------------ -----------
jon Nov 13, 1992 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyCalcHandleSizesFromScaleFactor proc far
class GrObjBodyClass
uses ax, bx, cx, dx, di
.enter
;
; Store the current scale factor. Why? I don't know
;
mov di, ds:[si]
add di, ds:[di].GrObjBody_offset
movwwf ds:[di].GBI_curScaleFactor.PF_x,ss:[bp].SCP_scaleFactor.PF_x,ax
movwwf ds:[di].GBI_curScaleFactor.PF_y,ss:[bp].SCP_scaleFactor.PF_y,ax
;
; Calculate document sizes of handles to achieve desired pixel size
;
mov dl,ds:[di].GBI_desiredHandleSize
tst dl
jns gotDesired
neg dl
gotDesired:
clr dh
push dx
clr cx
movwwf bxax, ss:[bp].SCP_scaleFactor.PF_x
call GrUDivWWFixed
rndwwf dxcx
mov ds:[di].GBI_curHandleWidth,dl
mov dx,1
clr cx
call GrUDivWWFixed
mov ds:[di].GBI_curNudgeX.BBF_int,dl
mov ds:[di].GBI_curNudgeX.BBF_frac,ch
pop dx
clr cx
movwwf bxax,ss:[bp].SCP_scaleFactor.PF_y
call GrUDivWWFixed
rndwwf dxcx
mov ds:[di].GBI_curHandleHeight,dl
mov dx,1
clr cx
call GrUDivWWFixed
mov ds:[di].GBI_curNudgeY.BBF_int,dl
mov ds:[di].GBI_curNudgeY.BBF_frac,ch
call GrObjBodySetCurrentOptionsOnViewScaleFactorChanged
.leave
ret
GrObjBodyCalcHandleSizesFromScaleFactor endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodySetCurrentOptionsOnViewScaleFactorChanged
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Set the GOFA_VIEW_ZOOMED bit in the body's current
options if the view is zoomed in
CALLED BY: INTERNAL
GrObjBodyViewScaleFactorChanged
PASS: *ds:si - body
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
Don't need to mark dirty because this bit isn't saved
with the document and the body won't get discarded
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine should be optimized for SMALL SIZE over SPEED
Common cases:
unknown
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 9/21/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodySetCurrentOptionsOnViewScaleFactorChanged proc near
class GrObjBodyClass
uses di
.enter
EC < call ECGrObjBodyCheckLMemObject >
mov di,ds:[si]
add di,ds:[di].GrObjBody_offset
BitClr ds:[di].GBI_currentModifiers, GOFA_VIEW_ZOOMED
cmp ds:[di].GBI_curScaleFactor.PF_x.WWF_int,1
jne checkXAbove
tst ds:[di].GBI_curScaleFactor.PF_x.WWF_frac
jnz setBit
checkY:
cmp ds:[di].GBI_curScaleFactor.PF_y.WWF_int,1
jne checkYAbove
tst ds:[di].GBI_curScaleFactor.PF_y.WWF_frac
jnz setBit
done:
.leave
ret
checkXAbove:
ja setBit
jmp checkY
checkYAbove:
jb done
setBit:
BitSet ds:[di].GBI_currentModifiers, GOFA_VIEW_ZOOMED
jmp done
GrObjBodySetCurrentOptionsOnViewScaleFactorChanged endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyUpdateFocusExcl
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Provide default focus node behavior
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
RETURN:
nothing
DESTROYED:
ax,cx,dx,bp
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 3/ 5/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyUpdateFocusExcl method GrObjBodyClass,
MSG_META_GAINED_FOCUS_EXCL,
MSG_META_LOST_FOCUS_EXCL,
MSG_META_GAINED_SYS_FOCUS_EXCL
.enter
mov bp, MSG_META_GAINED_FOCUS_EXCL
mov bx, offset GrObjBody_offset
mov di, offset GBI_focusExcl
call FlowUpdateHierarchicalGrab
.leave
Destroy ax,cx,dx,bp
ret
GrObjBodyUpdateFocusExcl endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyLostSystemFocusExcl
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Provide default focus node behavior, and turn off
"GOFA_KEYBOARD_SPECIFIC" flag.
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
RETURN:
nothing
DESTROYED:
ax,cx,dx,bp
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 3/ 5/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyLostSystemFocusExcl method dynamic GrObjBodyClass,
MSG_META_LOST_SYS_FOCUS_EXCL
.enter
; Pass on lost focus
;
call GrObjBodyUpdateFocusExcl ; Provide default behavior
; We no longer know what keys are down
;
mov di,ds:[si]
add di,ds:[di].GrObjBody_offset
andnf ds:[di].GBI_currentModifiers, not GOFA_KEYBOARD_SPECIFIC
call GrObjBodySetOptions
Destroy ax,cx,dx,bp
.leave
ret
GrObjBodyLostSystemFocusExcl endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyGetFocusExcl
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Return the od of the body's focusExcl
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
RETURN:
cx:dx - od of focus
DESTROYED:
ax,bp
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This method should be optimized for SMALL SIZE over SPEED
Common cases:
unknown
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 6/17/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyGetFocusExcl method dynamic GrObjBodyClass,
MSG_META_GET_FOCUS_EXCL
.enter
mov cx,ds:[di].GBI_focusExcl.HG_OD.handle
mov dx,ds:[di].GBI_focusExcl.HG_OD.chunk
stc
.leave
Destroy ax,bp
ret
GrObjBodyGetFocusExcl endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyGetTargetExcl
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Return the od of the body's targetExcl
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
RETURN:
cx:dx - od of target
DESTROYED:
ax,bp
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This method should be optimized for SMALL SIZE over SPEED
Common cases:
unknown
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 6/17/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyGetTargetExcl method dynamic GrObjBodyClass,
MSG_META_GET_TARGET_EXCL
.enter
mov cx,ds:[di].GBI_targetExcl.HG_OD.handle
mov dx,ds:[di].GBI_targetExcl.HG_OD.chunk
stc
.leave
Destroy ax,bp
ret
GrObjBodyGetTargetExcl endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyAlterFTVMCExcl
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: The body is a target and focus node.
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
cx:dx - optr to grab/release exclusive for
bp - MetaAlterFTVMCExclFlags
RETURN:
nothing
DESTROYED:
ax,cx,dx,bp
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This method should be optimized for SMALL SIZE over SPEED
Common cases:
unknown
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 2/12/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyAlterFTVMCExcl method dynamic GrObjBodyClass,
MSG_META_MUP_ALTER_FTVMC_EXCL
.enter
test bp, mask MAEF_NOT_HERE
jnz callSuper
next:
; If this is not for the target or focus then handle normally
;
test bp, mask MAEF_TARGET
jnz target
test bp, mask MAEF_FOCUS
jnz focus
callSuper:
; If no requests for operations left then exit
; Otherwise pass message on to superclass
;
test bp, MAEF_MASK_OF_ALL_HIERARCHIES
jz done
mov ax,MSG_META_MUP_ALTER_FTVMC_EXCL
mov di, offset GrObjBodyClass
call ObjCallSuperNoLock
done:
Destroy ax,cx,dx,bp
.leave
ret
target:
mov ax, MSG_META_GAINED_TARGET_EXCL
mov bx, mask MAEF_TARGET
mov di, offset GBI_targetExcl
doHierarchy:
push bp,bx ;orig flags, flag we are handling
and bp, mask MAEF_GRAB
or bp, bx ;or back in hierarchy flag
mov bx, offset GrObjBody_offset
call FlowAlterHierarchicalGrab
pop bp,bx ;orig flags, flag we are handling
; Clear out bit we just handled
;
not bx ; get not mask for hierarchy
and bp, bx ; clear request on this hierarchy
jmp next
focus:
mov ax, MSG_META_GAINED_FOCUS_EXCL
mov bx, mask MAEF_FOCUS
mov di, offset GBI_focusExcl
jmp doHierarchy
GrObjBodyAlterFTVMCExcl endm
GrObjInitCode ends
GrObjDrawCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyReloc
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Handle relocation and unrelocation of object
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
ax - MSG_META_RELOCATE/MSG_META_UNRELOCATE
cx - handle of block containing relocation
dx - VMRelocType:
VMRT_UNRELOCATE_BEFORE_WRITE
VMRT_RELOCATE_AFTER_READ
VMRT_RELOCATE_AFTER_WRITE
bp - data to pass to ObjRelocOrUnRelocSuper
RETURN:
carry - set if error
DESTROYED:
ax,cx,dx
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 9/17/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyReloc method dynamic GrObjBodyClass, reloc
.enter
; If the body is being relocated after being read from the
; file then it can't have a parent or a window and it can't
; be realized. Also, it can no longer be the target
;
call GrObjBodyRelocObjBlockArray
cmp ax,MSG_META_RELOCATE
jne done
cmp dx,VMRT_RELOCATE_AFTER_READ
jne done
andnf ds:[di].GBI_fileStatus, not ( mask GOFS_TARGETED or \
mask GOFS_OPEN )
; Clear any suspension. Otherwise if we crashed and it
; was set it would never get cleared again.
;
mov ax,ATTR_GB_ACTION_NOTIFICATION
call ObjVarFindData
jnc clearStuff
clr ds:[bx].GOANS_suspendCount
clearStuff:
clr ax
mov ds:[di].GBI_unsuspendOps, ax
mov ds:[di].GBI_suspendCount,ax
mov ds:[di].GBI_mouseGrab.handle,ax
mov ds:[di].GBI_mouseGrab.chunk,ax
mov ds:[di].GBI_targetExcl.HG_OD.handle,ax
mov ds:[di].GBI_focusExcl.HG_OD.handle,ax
mov ds:[di].GBI_targetExcl.HG_OD.chunk,ax
mov ds:[di].GBI_focusExcl.HG_OD.chunk,ax
mov ds:[di].GBI_targetExcl.HG_flags,ax
mov ds:[di].GBI_focusExcl.HG_flags,ax
mov ds:[di].GBI_head.handle,ax
mov ds:[di].GBI_head.chunk,ax
mov ds:[di].GBI_graphicsState,ax
mov ds:[di].GBI_currentModifiers,ax
mov ds:[di].GBI_selectionArray.handle, ax
mov ds:[di].GBI_selectionArray.chunk, ax
mov di,ds:[si]
add di,ds:[di].Vis_offset
mov ds:[di].VCI_window,ax
mov ds:[di].VCI_gadgetExcl.handle, ax
mov ds:[di].VCI_gadgetExcl.chunk, ax
BitSet ds:[di].VI_typeFlags, VTF_IS_INPUT_NODE
done:
.leave
mov di, offset GrObjBodyClass
call ObjRelocOrUnRelocSuper
ret
GrObjBodyReloc endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyRelocObjBlockArray
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Description: Handle relocation and unrelocation of the obj block array
Pass: *ds:si - GrObjBody
ax - MSG_META_RELOCATE or MSG_META_UNRELOCATE
Return: nothing
Destroyed: nothing
Comments:
Revision History:
Name Date Description
---- ------------ -----------
jon Jul 17, 1992 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyRelocObjBlockArray proc near
class GrObjBodyClass
uses ax, bx, cx, dx, di, si
.enter
mov si, ds:[si]
add si, ds:[si].GrObjBody_offset
mov si, ds:[si].GBI_objBlockArray
tst si
jz done
mov bx, cs
mov di, offset UnRelocateCB
cmp ax, MSG_META_RELOCATE
jne enumerate
mov di, offset RelocateCB
enumerate:
call ChunkArrayEnum
done:
.leave
ret
GrObjBodyRelocObjBlockArray endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
RelocateCB, UnRelocateCB
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: callback routine to relocate/unrelocate an OD
CALLED BY:
PASS: ds:di - address at which to do the dirty deed.
RETURN: nothing
DESTROYED: ax,bx,cx,dx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
CDB 5/26/92 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
RelocateCB proc far
.enter
mov al, RELOC_HANDLE
mov cx, ds:[di].GOBHE_blockHandle
mov bx, ds:[LMBH_handle]
call ObjDoRelocation
mov ds:[di].GOBHE_blockHandle, cx
.leave
ret
RelocateCB endp
UnRelocateCB proc far
.enter
mov al, RELOC_HANDLE
mov cx, ds:[di].GOBHE_blockHandle
mov bx, ds:[LMBH_handle]
call ObjDoUnRelocation
mov ds:[di].GOBHE_blockHandle, cx
.leave
ret
UnRelocateCB endp
GrObjDrawCode ends
GrObjMiscUtilsCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyVisInvalidate
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Description: GrObjBody method for MSG_VIS_INVALIDATE
Pass: *ds:si = GrObjBody object
ds:di = GrObjBody instance
Return: nothing
Destroyed: ax,cx,dx,bp
Comments:
Revision History:
Name Date Description
---- ------------ -----------
jon May 7, 1992 Initial version.
srs 12/9/92 Now uses body bounds instead of window
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyVisInvalidate method dynamic GrObjBodyClass, MSG_VIS_INVALIDATE
.enter
mov ax, MSG_GB_CREATE_GSTATE
call ObjCallInstanceNoLock
mov di, bp ;gstate
mov si,ds:[si]
add si,ds:[si].GrObjBody_offset
add si,offset GBI_bounds
call GrInvalRectDWord
call GrDestroyState
.leave
Destroy ax,cx,dx,bp
ret
GrObjBodyVisInvalidate endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyInvalidate
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Description: GrObjBody method for MSG_GB_INVALIDATE
Invalidates all of the GrObjs in this body
Called by:
Pass: *ds:si = GrObjBody object
ds:di = GrObjBody instance
Return: nothing
Destroyed: nothing
Comments:
Revision History:
Name Date Description
---- ------------ -----------
jon May 7, 1992 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyInvalidate method dynamic GrObjBodyClass, MSG_GB_INVALIDATE
.enter
mov ax, MSG_GO_INVALIDATE
call GrObjBodySendToChildren
.leave
ret
GrObjBodyInvalidate endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodySetDesiredHandleSize
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Set the desired handle size of selected GrObj's under
the body.
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
cl - desired handle size (in DEVICE coords)
RETURN:
nothing
DESTROYED:
ax
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
need to correctly erase old/draw new
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 26 feb 1992 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodySetDesiredHandleSize method dynamic GrObjBodyClass,
MSG_GB_SET_DESIRED_HANDLE_SIZE
uses dx, bp
.enter
;
; Create a gstate for drawing/undrawing handles
;
mov ax, MSG_GB_CREATE_GSTATE
call ObjCallInstanceNoLock
mov dx, bp ;dx <- gstate
;
; Undraw any current handles
;
mov ax, MSG_GO_UNDRAW_HANDLES
call GrObjBodySendToSelectedGrObjs
;
; Record the new size
;
mov di, ds:[si]
add di, ds:[di].GrObjBody_offset
mov ds:[di].GBI_desiredHandleSize, cl
;
; Calculate the actual size
;
mov dl,cl
tst dl
jns gotDesired
neg dl
gotDesired:
clr dh
push dx
clr cx
movwwf bxax, ds:[di].GBI_curScaleFactor.PF_x
call GrUDivWWFixed
rndwwf dxcx
mov ds:[di].GBI_curHandleWidth,dl
pop dx
clr cx
movwwf bxax, ds:[di].GBI_curScaleFactor.PF_y
call GrUDivWWFixed
rndwwf dxcx
mov ds:[di].GBI_curHandleHeight,dl
;
; Draw the new handles
;
mov dx, bp ;dx <- gstate
mov ax, MSG_GO_DRAW_HANDLES
call GrObjBodySendToSelectedGrObjs
;
; Free the gstate
;
mov di, dx
call GrDestroyState
mov ax, MSG_GB_UPDATE_INSTRUCTION_CONTROLLERS
call ObjCallInstanceNoLock
.leave
ret
GrObjBodySetDesiredHandleSize endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyGetDesiredHandleSize
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get the desired handle size of selected GrObj's under
the body.
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
RETURN:
al - desired handle size (in DEVICE coords)
DESTROYED:
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
need to correctly erase old/draw new
REVISION HISTORY:
Name Date Description
---- ---- -----------
jon 26 feb 1992 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyGetDesiredHandleSize method dynamic GrObjBodyClass,
MSG_GB_GET_DESIRED_HANDLE_SIZE
.enter
mov al, ds:[di].GBI_desiredHandleSize
.leave
ret
GrObjBodyGetDesiredHandleSize endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyGetWindow
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Return window stored in vis comp instance data
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
RETURN:
cx - window
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 1/22/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyGetWindow method dynamic GrObjBodyClass, MSG_GB_GET_WINDOW
.enter
add bx,ds:[bx].Vis_offset
mov cx,ds:[bx].VCI_window
.leave
ret
GrObjBodyGetWindow endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyClear
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Default handler
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
RETURN:
nothing
DESTROYED:
ax
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This method should be optimized for SMALL SIZE over SPEED
Common cases:
unknown
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 6/ 5/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyClear method dynamic GrObjBodyClass, MSG_GB_CLEAR
uses cx,dx
.enter
mov cx,ds:[LMBH_handle]
mov dx,si
clr di ;MessageFlags
mov ax,MSG_GH_CLEAR_CURRENT_BODY
call GrObjBodyMessageToHead
mov ax,MSG_GOAM_DETACH_BODY
call GrObjBodyMessageToGOAM
mov ax,MSG_VIS_DESTROY
call ObjCallInstanceNoLock
.leave
ret
GrObjBodyClear endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyFinalObjFree
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Free up any chunks or other blocks
See header in GrObjBodyClear
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyFinalObjFree
RETURN:
nothing
DESTROYED:
ax
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This method should be optimized for SMALL SIZE over SPEED
Common cases:
unknown
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 6/ 5/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyFinalObjFree method dynamic GrObjBodyClass,
MSG_META_FINAL_OBJ_FREE
.enter
mov ax,MSG_GO_QUICK_TOTAL_BODY_CLEAR
call GrObjBodySendToChildren
mov di,ds:[si]
add di,ds:[di].GrObjBody_offset
mov di,ds:[di].GBI_graphicsState
tst di
jz 10$
call GrDestroyState
10$:
call GrObjBodyDestroySelectionArray
call GrObjBodyPriorityListDestroy
call GrObjBodyFreeObjBlocks
mov ax,MSG_META_FINAL_OBJ_FREE
mov di,offset GrObjBodyClass
call ObjCallSuperNoLock
.leave
ret
GrObjBodyFinalObjFree endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyFreeObjBlocks
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Description: Handle relocation and unrelocation of the obj block array
Pass: *ds:si - GrObjBody
ax - MSG_META_RELOCATE or MSG_META_UNRELOCATE
Return: nothing
Destroyed: nothing
Comments:
Revision History:
Name Date Description
---- ------------ -----------
jon Jul 17, 1992 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyFreeObjBlocks proc near
class GrObjBodyClass
uses ax, bx, cx, dx, di, si
.enter
mov si, ds:[si]
add si, ds:[si].GrObjBody_offset
mov si, ds:[si].GBI_objBlockArray
tst si
jz done
mov bx, cs
mov di, offset FreeBlocksCB
call ChunkArrayEnum
call ChunkArrayZero
done:
.leave
ret
GrObjBodyFreeObjBlocks endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FreeCB
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: callback routine to relocate/unrelocate an OD
CALLED BY:
PASS: ds:di - address at which to do the dirty deed.
RETURN: nothing
DESTROYED: ax,bx,cx,dx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
CDB 5/26/92 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FreeBlocksCB proc far
.enter
mov bx, ds:[di].GOBHE_blockHandle
call ObjFreeObjBlock
.leave
ret
FreeBlocksCB endp
GrObjMiscUtilsCode ends
GrObjRequiredInteractiveCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyGrabTargetFocus
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Grab the target and the focus
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
RETURN:
nothing
DESTROYED:
ax
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This method should be optimized for SMALL SIZE over SPEED
Common cases:
unknown
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 5/21/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyGrabTargetFocus method dynamic GrObjBodyClass,
MSG_GB_GRAB_TARGET_FOCUS
.enter
call MetaGrabTargetExclLow
call MetaGrabFocusExclLow
.leave
ret
GrObjBodyGrabTargetFocus endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyUpdateTargetExcl
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Provide default target node behavior
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
RETURN:
nothing
DESTROYED:
ax,cx,dx,bp
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
doug 9/ 1/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyUpdateTargetExcl method GrObjBodyClass,
MSG_META_GAINED_SYS_TARGET_EXCL,
MSG_META_LOST_SYS_TARGET_EXCL
.enter
mov bp, MSG_META_GAINED_TARGET_EXCL ; Pass "base" message in bp
mov bx, offset GrObjBody_offset
mov di, offset GBI_targetExcl
call FlowUpdateHierarchicalGrab
mov di,ds:[si]
add di,ds:[di].GrObjBody_offset
cmp ax,MSG_META_GAINED_SYS_TARGET_EXCL
je setBit
cmp ax,MSG_META_LOST_SYS_TARGET_EXCL
je clearBit
done:
.leave
ret
setBit:
BitSet ds:[di].GBI_fileStatus, GOFS_SYS_TARGETED
mov cl,TRUE
jmp sendOn
clearBit:
BitClr ds:[di].GBI_fileStatus, GOFS_SYS_TARGETED
mov cl,FALSE
sendOn:
; Set the GOTM_SYS_TARGET bit in all the selected children.
;
mov ax,MSG_GO_SET_SYS_TARGET
call GrObjBodySendToSelectedGrObjs
jmp done
GrObjBodyUpdateTargetExcl endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyGainedTargetExcl
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Notify body that it has gained the target excl
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
RETURN:
nothing
DESTROYED:
ax,cx,dx,bp
PSEUDO CODE/STRATEGY:
draw handles of objects on selected list. The RAW method
is used because the objects still have their handlesDrawn
bit set even though the handles aren't drawn. This was
done to prevent dirtying the document when the target was
lost
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 3/ 5/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyGainedTargetExcl method GrObjBodyClass, MSG_META_GAINED_TARGET_EXCL
.enter
ornf ds:[di].GBI_fileStatus, mask GOFS_TARGETED
mov ax, MSG_META_GAINED_TARGET_EXCL
call GrObjBodyUpdateTargetExcl ; do default behavior
; Setting the current body will cause the floater to notify the
; selected and editing objects in this body that the floater
; is activating. This may cause the selection list to change.
;
mov cx,ds:[LMBH_handle]
mov dx,si
mov ax,MSG_GH_SET_CURRENT_BODY
clr di
call GrObjBodyMessageToHead
EC < ERROR_Z GROBJ_BODY_NOT_ATTACHED_TO_HEAD >
;
; Tell the clipboard that we want notifications
;
mov cx, ds:[LMBH_handle]
mov dx, si
call ClipboardAddToNotificationList
;
; Update all the controllers
;
mov cx, mask GrObjUINotificationTypes
mov ax,MSG_GB_UPDATE_UI_CONTROLLERS
call ObjCallInstanceNoLock
mov ax,MSG_GB_UPDATE_INSTRUCTION_CONTROLLERS
call ObjCallInstanceNoLock
;
; Now the text controllers (making sure not to
; pass the select state bit)
;
sub sp, size VisTextGenerateNotifyParams
mov bp, sp
mov ss:[bp].VTGNP_notificationTypes,
VIS_TEXT_GAINED_TARGET_NOTIFICATION_FLAGS \
and not mask VTNF_SELECT_STATE
mov ss:[bp].VTGNP_sendFlags, \
mask VTNSF_UPDATE_APP_TARGET_GCN_LISTS
mov ax, MSG_GB_GENERATE_TEXT_NOTIFY
call ObjCallInstanceNoLock
add sp, size VisTextGenerateNotifyParams
;
; Suck the current scale factor out of the view
;
push si
mov bx, segment GenViewClass
mov si, offset GenViewClass
mov ax, MSG_GEN_VIEW_GET_SCALE_FACTOR
mov di, mask MF_RECORD
call ObjMessage
mov cx, di ;cx <- event to send to view
pop si
;
; dx:cx <- x scale
; bp:ax <- y scale
;
mov ax, MSG_VIS_VUP_CALL_OBJECT_OF_CLASS
call ObjCallInstanceNoLock
;
; Calc our various handle and nudge sizes from the scale factor
;
pushwwf bpax
pushwwf dxcx
mov bp, sp
call GrObjBodyCalcHandleSizesFromScaleFactor
add sp, size PointWWFixed
;
; This call used to be at the start of the routine. I moved it
; to the end so that if a text object is the target it will send out
; its notifications after the body does
;
.leave
Destroy ax, cx, dx, bp
ret
GrObjBodyGainedTargetExcl endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyLostTargetExcl
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Notify body that it has lost the target excl
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
RETURN:
nothing
DESTROYED:
ax,cx,dx,bp
PSEUDO CODE/STRATEGY:
nothing
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 3/ 5/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyLostTargetExcl method dynamic GrObjBodyClass, MSG_META_LOST_TARGET_EXCL
.enter
push ax
mov cx,ds:[LMBH_handle]
mov dx,si
mov ax,MSG_GH_CLEAR_CURRENT_BODY
clr di ;MessageFlags
call GrObjBodyMessageToHead
call GrObjBodyClearMouseGrab
call VisReleaseMouse
mov di,ds:[si]
add di,ds:[di].GrObjBody_offset
andnf ds:[di].GBI_fileStatus, not mask GOFS_TARGETED
;
; Tell the clipboard that we don't want notifications anymore
;
mov cx, ds:[LMBH_handle]
mov dx, si
call ClipboardRemoveFromNotificationList
mov ax, MSG_GB_UPDATE_INSTRUCTION_CONTROLLERS
call ObjCallInstanceNoLock
; Pass on lost target
;
pop ax ; get passed-in ax value
call GrObjBodyUpdateTargetExcl ; do default behavior
Destroy ax, cx, dx, bp
.leave
ret
GrObjBodyLostTargetExcl endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodySetOptions
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Set the currentOptions from the defaultOptions and
the currentModifiers. The currentModifiers mean
that the corresponding defaultOption should be toggled
before being copied to the currentOptions.
CALLED BY: INTERNAL
GrObjBodyKbdChar
PASS:
*ds:si - graphic body
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 11/ 1/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodySetOptions proc far
class GrObjBodyClass
uses ax,bx,di
.enter
EC < call ECGrObjBodyCheckLMemObject >
mov di,ds:[si]
add di,ds:[di].GrObjBody_offset
mov ax,ds:[di].GBI_currentModifiers
andnf ax,GOFA_TOGGLE_BITS
mov bx,ds:[di].GBI_defaultOptions
andnf bx,GOFA_TOGGLE_BITS
xor ax,bx
mov bx,ds:[di].GBI_currentModifiers
andnf bx,GOFA_OR_BITS
ornf ax,bx
mov bx,ds:[di].GBI_defaultOptions
andnf bx,GOFA_OR_BITS
ornf ax,bx
; If the currentOptions need to change the update
; them and force a PTR event so that objects will
; switch immediately to the new options
;
cmp ds:[di].GBI_currentOptions,ax
je done
mov ds:[di].GBI_currentOptions,ax
call ImForcePtrMethod
done:
.leave
ret
GrObjBodySetOptions endp
GrObjRequiredInteractiveCode ends
GrObjAlmostRequiredCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyInstantiateGrObj
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Instantiate a grobject in a block managed by the body
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
cx:dx - fptr to class
RETURN:
cx:dx - OD of new object
DESTROYED:
ax
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This method should be optimized for SMALL SIZE over SPEED
Common cases:
unknown
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 4/19/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyInstantiateGrObj method dynamic GrObjBodyClass,
MSG_GB_INSTANTIATE_GROBJ
.enter
mov es,cx ;class segment
mov di,dx ;class offset
; Get block to create object in
;
mov ax,MSG_GB_GET_BLOCK_FOR_ONE_GROBJ
call ObjCallInstanceNoLock
; Instantiate that object
;
mov bx,cx ;block to create in
call ObjInstantiate
mov dx,si ;new block chunk
; This will cause the object to be completely freed
; if the user undoes the creation and then starts
; a new undo chain.
;
mov di,mask MF_FIXUP_DS
mov ax,MSG_GO_GENERATE_UNDO_UNDO_CLEAR_CHAIN
call ObjMessage
mov ax, MSG_GO_ADD_POTENTIAL_SIZE_TO_BLOCK
mov di, mask MF_FIXUP_DS
call ObjMessage
.leave
ret
GrObjBodyInstantiateGrObj endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyAddGrObjThenDraw
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:
Add a graphic object to the graphic body. The object will be
notified via MSG_GO_AFTER_ADDED_TO_BODY that it has been added
to the body. If the object was added at the top of the draw list
it will be sent a message draw, otherwise it will be invalidated.
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
cx:dx - OD of graphic object to add
bp - GrObjBodyAddGrObjFlags
RETURN:
nothing
DESTROYED:
ax
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This method should be optimized for SMALL SIZE over SPEED
Common cases:
Newly added object will be at end of draw list
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 1/23/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyAddGrObjThenDraw method dynamic GrObjBodyClass,
MSG_GB_ADD_GROBJ_THEN_DRAW
.enter
mov ax,MSG_GB_ADD_GROBJ
call ObjCallInstanceNoLock
mov ax,MSG_GB_DRAW_GROBJ
call ObjCallInstanceNoLock
.leave
ret
GrObjBodyAddGrObjThenDraw endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyDrawGrObj
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Draw or invalidate the passed grobj as necessary
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
^lcx:dx
RETURN:
nothing
DESTROYED:
ax
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This method should be optimized for SMALL SIZE over SPEED
Common cases:
unknown
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 11/ 6/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyDrawGrObj method dynamic GrObjBodyClass,
MSG_GB_DRAW_GROBJ
uses cx,dx,bp
.enter
; Lock the object and check the LP_IS_PARENT in its
; GOI_drawLink field to see if it is the top object
;
mov bx,cx ;object block
mov di,dx ;object chunk
call ObjLockObjBlock
mov es,ax ;object segment
GrObjDeref di,es,di
test es:[di].GOI_drawLink.chunk, LP_IS_PARENT
jz invalidate
; GrObj is top object in draw list, so send it a draw message
;
mov ax,MSG_GB_CREATE_GSTATE
call ObjCallInstanceNoLockES
tst bp
jz unlock ;bail if no gstate
push dx ;object chunk
clr cl ;DrawFlags
call GrObjBodySetGrObjDrawFlagsForDraw
segmov ds,es ;object segment
pop si ;object chunk
mov ax,MSG_GO_DRAW
call ObjCallInstanceNoLockES
mov di,bp ;gstate
call GrDestroyState
unlock:
call MemUnlock
.leave
ret
invalidate:
segmov ds,es ;object segment
mov si,dx ;object chunk
mov ax,MSG_GO_INVALIDATE
call ObjCallInstanceNoLockES
jmp unlock
GrObjBodyDrawGrObj endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyAddGrObj
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Add a graphic object as child of graphic body
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
cx:dx -- optr of object to add
bp - GrObjBodyAddGrObjFlags
RETURN:
nothing
DESTROYED:
ax
PSEUDO CODE/STRATEGY:
All of the children of the body are in two lists. These
list are in reverse order of each other. The drawing order
list is connected with the GOI_drawLink field The reverse list
is connected via the GOI_reverseLink list.
This routine first adds the object to the draw
list then adds it to the reverse list.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 5/17/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyAddGrObj method dynamic GrObjBodyClass, MSG_GB_ADD_GROBJ
.enter
call GrObjBodyGenerateUndoAddToBodyChain
call GrObjBodyAddGrObjLow
mov bx,cx ;child handle
mov si,dx ;child chunk
mov di,mask MF_FIXUP_DS
mov ax,MSG_GO_AFTER_ADDED_TO_BODY
call ObjMessage
; Must do after object has been added to body so that
; the object can be used to calculate wrap areas.
;
call GrObjBodySendWrapNotificationForAddAndRemove
.leave
ret
GrObjBodyAddGrObj endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodySendWrapNotificationForAddAndRemove
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Send GOANT_WRAP_NOTIFICATION for object if it
has one of the wrap flag set
CALLED BY: INTERNAL
GrObjBodyAddGrObj
GrObjBodyRemoveGrObj
PASS: ^lbx:si - grobject
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine should be optimized for SMALL SIZE over SPEED
Common cases:
no wrap flags set
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 3/28/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodySendWrapNotificationForAddAndRemove proc near
uses ax,cx,di,bp
.enter
mov di,mask MF_FIXUP_DS or mask MF_CALL
mov ax,MSG_GO_GET_GROBJ_ATTR_FLAGS
call ObjMessage
test cx,mask GOAF_WRAP
jnz sendNotification
done:
.leave
ret
sendNotification:
mov di,mask MF_FIXUP_DS
mov bp,GOANT_WRAP_CHANGED
mov ax,MSG_GO_NOTIFY_ACTION
call ObjMessage
jmp done
GrObjBodySendWrapNotificationForAddAndRemove endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyAddGrObjLow
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Add a graphic object as child of graphic body,
without sending notification to object.
PASS:
*(ds:si) - instance data of object
cx:dx -- optr of object to add
bp - GrObjBodyAddGrObjFlags
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
All of the children of the body are in two lists. These
list are in reverse order of each other. The drawing order
list is connected with the GOI_drawLink field The reverse list
is connected via the GOI_reverseLink list.
This routine first adds the object to the draw
list then adds it to the reverse list.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 5/17/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyAddGrObjLow proc near
class GrObjBodyClass
uses ax,bp,di
.enter
EC < call ECGrObjBodyCheckLMemObject >
; If position passed is not for draw list then
; convert it to draw list position
;
test bp, mask GOBAGOF_DRAW_LIST_POSITION
jnz addToDrawLinkage
call GrObjBodyConvertListPosition
addToDrawLinkage:
; Add child to normal draw linkage
; The GOBAGOF_DRAW_LIST_POSITION bit is in the
; same place as CCF_MARK_DIRTY, so if we don't muck
; with bp the involved objects will be marked dirty,
; which is what we want.
;
CheckHack <(offset GrObj_offset) eq (offset Vis_offset)>
movnf ax, <offset GOI_drawLink>
mov di,offset GBI_drawComp
mov bx, offset GrObj_offset ;grobj is master
push bp ;draw position
call ObjCompAddChild
pop bp ;draw position
; Convert draw list position to reverse position
;
call GrObjBodyConvertListPosition
; Add child to reverse list
; Since the GOBAGOF_DRAW_LIST_POSITION bit is not set
; we actually need to set the dirty bit here, unlike
; above.
;
ornf bp, mask CCF_MARK_DIRTY
CheckHack <(offset GrObj_offset) eq (offset Vis_offset)>
mov ax, offset GOI_reverseLink
mov di,offset GBI_reverseComp
mov bx, offset GrObj_offset ;grobj is master
call ObjCompAddChild
mov di,ds:[si]
add di,ds:[di].GrObjBody_offset
inc ds:[di].GBI_childCount
.leave
ret
GrObjBodyAddGrObjLow endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyGenerateUndoAddToBodyChain
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Generate an undo chain for adding object to body
CALLED BY: INTERNAL
GrObjBodyAddGrObj
PASS: *ds:si - body
cx:dx - optr of child
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
The undo action for adding a grobject to the body
is MSG_GO_REMOVE_FROM_BODY instead of MSG_GB_REMOVE_GROBJ
because the object may have become selected after
it was added and only MSG_GO_REMOVE_FROM_BODY deals
with releasing exclusives.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine should be optimized for SMALL SIZE over SPEED
Common cases:
unknown
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 8/ 4/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyGenerateUndoAddToBodyChain proc near
uses ax,cx,dx,di,bp
.enter
EC < call ECGrObjBodyCheckLMemObject >
call GrObjGlobalStartUndoChainNoText
jc endChain
sub sp,size AddUndoActionStruct
mov bp,sp
mov ss:[bp].AUAS_data.UAS_dataType,UADT_FLAGS
mov ({GrObjUndoAppType}ss:[bp].AUAS_data.UAS_appType).\
GOUAT_undoMessage,MSG_GO_REMOVE_FROM_BODY
clr ss:[bp].AUAS_flags
mov ss:[bp].AUAS_output.handle,cx
mov ss:[bp].AUAS_output.chunk,dx
mov di,mask MF_FIXUP_DS
call GeodeGetProcessHandle
mov ax,MSG_GEN_PROCESS_UNDO_ADD_ACTION
call ObjMessage
add sp,size AddUndoActionStruct
endChain:
call GrObjGlobalEndUndoChain
.leave
ret
GrObjBodyGenerateUndoAddToBodyChain endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyConvertListPosition
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Convert a draw list position to a reverse list
position and vice versa.
Other list position - child count - list position
CALLED BY: INTERNAL UTILITY
PASS: *ds:si - body
bp - GrObjBodyAddGrObjFlags
RETURN:
bp - GrObjBodyAddGrObjFlags in other list
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine should be optimized for SMALL SIZE over SPEED
Common cases:
unknown
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 5/19/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyConvertListPosition proc far
class GrObjBodyClass
uses ax,bx
.enter
EC < call ECGrObjBodyCheckLMemObject >
; Get other list's position high bit in bx
;
mov bx,bp
not bx
andnf bx,mask GOBAGOF_DRAW_LIST_POSITION
; Convert raw position
;
BitClr bp, GOBAGOF_DRAW_LIST_POSITION
mov di,ds:[si]
add di,ds:[di].GrObjBody_offset
mov ax,ds:[di].GBI_childCount
xchg ax,bp ;ax <- position, bp <- count
sub bp,ax
jns setBit
clr bp
; Set other lists position high bit
;
setBit:
ornf bp,bx
.leave
ret
GrObjBodyConvertListPosition endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyRemoveGrObj
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Remove a graphic object child from graphic body
PASS:
*(ds:si) - instance data of object
cx:dx -- optr of object to remove
RETURN:
nothing
DESTROYED:
ax
PSEUDO CODE/STRATEGY:
All of the children of the body are in two lists. These
list are in reverse order of each other. The drawing order
list is connected with the GOI_drawLink field. The reverse
list is connected via the GOI_reverseLink list.
This routine first removes the object from the draw
list then removes it from the reverse list.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
WARNING: This message handler is not dynamic, so it can
be called as a routine. Thusly, only *ds:si can
be counted on. And it must be careful about the
regsiters is destroys.
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 5/17/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyRemoveGrObj method dynamic GrObjBodyClass, MSG_GB_REMOVE_GROBJ
.enter
call GrObjBodyGenerateUndoRemoveFromBodyChain
; Notify object that it is about to be removed
; from body
;
push si ;body chunk
mov bx,cx ;child block
mov si,dx ;child chunk
mov di,mask MF_FIXUP_DS
mov ax,MSG_GO_BEFORE_REMOVED_FROM_BODY
call ObjMessage
pop si ;body chunk
call GrObjBodyRemoveGrObjLow
; Must do after object has been removed to body so that
; the object won't be used to calculate wrap areas.
;
movdw bxsi,cxdx ;child od
call GrObjBodySendWrapNotificationForAddAndRemove
.leave
ret
GrObjBodyRemoveGrObj endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyRemoveGrObjLow
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Remove a graphic object child from graphic body
with out sending notification of removal to object.
PASS:
*(ds:si) - instance data of object
cx:dx -- optr of object to remove
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
All of the children of the body are in two lists. These
list are in reverse order of each other. The drawing order
list is connected with the GOI_drawLink field. The reverse
list is connected via the GOI_reverseLink list.
This routine first removes the object from the draw
list then removes it from the reverse list.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
WARNING: This message handler is not dynamic, so it can
be called as a routine. Thusly, only *ds:si can
be counted on. And it must be careful about the
regsiters is destroys.
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 5/17/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyRemoveGrObjLow proc near
class GrObjBodyClass
uses ax,bx,bp,di
.enter
EC < call ECGrObjBodyCheckLMemObject >
mov di,ds:[si]
add di,ds:[di].GrObjBody_offset
dec ds:[di].GBI_childCount
; Remove child from normal draw linkage
;
CheckHack <(offset GrObj_offset) eq (offset Vis_offset)>
movnf ax, <offset GOI_drawLink>
mov di,offset GBI_drawComp
mov bx, offset GrObj_offset ;grobj is master
mov bp, mask CCF_MARK_DIRTY
call ObjCompRemoveChild
; Remove child from reverse linkage
;
CheckHack <(offset GrObj_offset) eq (offset Vis_offset)>
mov ax, offset GOI_reverseLink
mov di,offset GBI_reverseComp
mov bx, offset GrObj_offset ;grobj is master
mov bp, mask CCF_MARK_DIRTY
call ObjCompRemoveChild
.leave
ret
GrObjBodyRemoveGrObjLow endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyGenerateUndoRemoveFromBodyChain
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Generate an undo chain for removing object from body
CALLED BY: INTERNAL
GrObjBodyRemoveGrObj
PASS: *ds:si - body
cx:dx - optr of child
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine should be optimized for SMALL SIZE over SPEED
Common cases:
unknown
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 8/ 4/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyGenerateUndoRemoveFromBodyChain proc near
uses ax,bx,di,bp
.enter
EC < call ECGrObjBodyCheckLMemObject >
call GrObjGlobalStartUndoChainNoText
jc endChain
; Get position in reverse list of child so that it can
; be undeleted into the correct place
;
push cx,dx ;child od
mov ax,MSG_GB_FIND_GROBJ
call ObjCallInstanceNoLock
mov bp,dx ;rev position
pop cx,dx ;child od
; Make that undo chain
;
mov ax,MSG_GB_ADD_GROBJ_THEN_DRAW ;undo message
clr bx ;AddUndoActionFlags
call GrObjGlobalAddFlagsUndoAction
endChain:
call GrObjGlobalEndUndoChain
.leave
ret
GrObjBodyGenerateUndoRemoveFromBodyChain endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyVupCreateGState
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Create gstate with proper translations in it
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
RETURN:
bp - gstate
DESTROYED:
stc - defined as returned
ax,cx,dx
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 7/26/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyVupCreateGState method dynamic GrObjBodyClass,
MSG_VIS_VUP_CREATE_GSTATE
.enter
; Send message on up to create gstate
;
mov ax,MSG_VIS_VUP_CREATE_GSTATE
mov di,offset GrObjBodyClass
call ObjCallSuperNoLock
; Apply translation of GrObjBody
;
mov di,ds:[si]
add di,ds:[di].GrObjBody_offset
mov dx, ds:[di].GBI_bounds.RD_left.high
mov cx, ds:[di].GBI_bounds.RD_left.low
mov bx, ds:[di].GBI_bounds.RD_top.high
mov ax, ds:[di].GBI_bounds.RD_top.low
mov di,bp ;gstate
call GrApplyTranslationDWord
stc ;by definition
.leave
ret
GrObjBodyVupCreateGState endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyCreateGState
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: For speed purposes the grobj keeps a cached gstate.
When something in the grobj requests a gstate we
create a gstate and copy the cached gstates transform
into the new one. This prevent us from having
to vup up the vis linking several more levels.
We don't use the cached gstate so that the caller can
function just as if it called GrCreateState and
destroy the gstate when it is done.
PASS:
*(ds:si) - instance data of object
RETURN:
bp - gstate
DESTROYED:
ax
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This method should be optimized for SPEED over SMALL SIZE
Common cases:
body does have a cached gstate
WARNING: This method is not dynamic, so the passed
parameters are more limited and you must be careful
what you destroy.
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 8/26/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyCreateGState method GrObjBodyClass,
MSG_GB_CREATE_GSTATE
uses ax,bx,di,si,ds
.enter
; Check for no cached gstate
;
mov di,ds:[si]
add di,ds:[di].GrObjBody_offset
mov di,ds:[di].GBI_graphicsState
tst di
jz vup
; Get transform from cached gstate.
; Create new gstate to body's window and set transform in it
; Also copy two of the text mode bits
;
; Also copy the text ColorMapMode. Ideally VUPing for the
; GState would always be done, and this wouldn't be an issue.
; However, that isn't pratical for speed reasons. Not
; VUPing means that an app (eg. GeoWrite) cannot subclass
; MSG_VIS_VUP_CREATE_GSTATE & initialize the GState and
; have it consistently used. This results in text being
; drawn differently when edited than when redrawn.
; Another, more general alternative (which involves an API
; change, so I rejected it for now) to copying various
; attributes is to add a new routine, GrDuplicateState()
; which duplicates an existing GState and all its attributes.
; -eca 7/27/94
mov bx,ds:[si]
add bx,ds:[bx].Vis_offset
mov bx,ds:[bx].VCI_window
sub sp,size TransMatrix
mov si,sp
segmov ds,ss,ax
call GrGetTransform
call GrGetTextColorMap ;al = ColorMapMode
push ax
call GrGetTextMode ;al = text mode
mov di,bx ;window
call GrCreateState
and al, mask TM_DRAW_CONTROL_CHARS or mask TM_DRAW_OPTIONAL_HYPHENS
mov ah, mask TM_DRAW_CONTROL_CHARS or mask TM_DRAW_OPTIONAL_HYPHENS
call GrSetTextMode
pop ax ;al = ColorMapMode
call GrSetTextColorMap
call GrSetTransform
mov bp,di ;gstate
add sp,size TransMatrix
done:
.leave
ret
vup:
; For some reason we have no cached gstate so just vup for one
;
push cx,dx
mov ax,MSG_VIS_VUP_CREATE_GSTATE
call ObjCallInstanceNoLock
pop cx,dx
jmp done
GrObjBodyCreateGState endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyRecreateCachedGStates
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Destroy our cached gstate and create a new one
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
RETURN:
nothing
DESTROYED:
ax,cx,dx,bp
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This method should be optimized for SMALL SIZE over SPEED
Common cases:
unknown
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 8/26/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyRecreateCachedGStates method dynamic GrObjBodyClass,
MSG_VIS_RECREATE_CACHED_GSTATES
.enter
mov di,ds:[di].GBI_graphicsState
tst di
jz children
call GrDestroyState
mov ax,MSG_VIS_VUP_CREATE_GSTATE
call ObjCallInstanceNoLock
mov di,ds:[si]
add di,ds:[di].GrObjBody_offset
mov ds:[di].GBI_graphicsState,bp
children:
; The object with the target may have a cached gstate
;
mov ax,MSG_GO_RECREATE_CACHED_GSTATES
mov di,mask MF_FIXUP_DS
call GrObjBodyMessageToEdit
.leave
Destroy ax,cx,dx,bp
ret
GrObjBodyRecreateCachedGStates endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyIncreasePotentialExpansion
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Notify the tree that an object in the current block
could potentially increase to the number of bytes in cx
PASS:
*(ds:si) - instance data
cx - number of bytes
dx - block handle
RETURN:
nothing
DESTROYED:
ax,cx,dx,bp
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 2/18/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyIncreasePotentialExpansion method GrObjBodyClass,
MSG_GB_INCREASE_POTENTIAL_EXPANSION
.enter
mov si, ds:[di].GBI_objBlockArray
tst si
jz done
call ObjMarkDirty
mov bx, cs
mov di, offset GrObjBlockHandleElementUpdatePotentialSizeCB
call ChunkArrayEnum
done:
.leave
ret
GrObjBodyIncreasePotentialExpansion endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyDecreasePotentialExpansion
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Notify the body that an object is being destroyed that
increased the increase potential of block. If the
object is in the current block then decrease potential
PASS:
*(ds:si) - instance data
cx - number of bytes to decrease
dx - handle of block to decrease in
RETURN:
nothing
DESTROYED:
ax,cx,dx,bp
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 2/18/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyDecreasePotentialExpansion method GrObjBodyClass,
MSG_GB_DECREASE_POTENTIAL_EXPANSION
uses cx
.enter
mov si, ds:[di].GBI_objBlockArray
tst si
jz done
call ObjMarkDirty
neg cx
mov bx, cs
mov di, offset GrObjBlockHandleElementUpdatePotentialSizeCB
call ChunkArrayEnum
done:
.leave
ret
GrObjBodyDecreasePotentialExpansion endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBlockHandleElementUpdatePotentialSizeCB
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Description: Updates the block's potential size if it matches the
passed block handle
Pass: ds:di - GrObjBlockHandleElement
dx - block handle
cx - amount to add to potential size
Return: carry set if found, else carry clear
Destroyed: nothing
Comments:
Revision History:
Name Date Description
---- ------------ -----------
jon Jul 17, 1992 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBlockHandleElementUpdatePotentialSizeCB proc far
.enter
cmp ds:[di].GOBHE_blockHandle, dx
clc
jnz done
add ds:[di].GOBHE_potentialSize, cx
stc
done:
.leave
ret
GrObjBlockHandleElementUpdatePotentialSizeCB endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyGetBlockForOneGrObj
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Returns block of handle to instantiate new tool in
CALLED BY: INTERNAL
GrObjBodySetToolClass
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
RETURN:
cx - handle of block
GBI_curBlock = cx
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 12/ 9/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyGetBlockForOneGrObj method dynamic GrObjBodyClass,
MSG_GB_GET_BLOCK_FOR_ONE_GROBJ
.enter
; If no current block then jump to alloc a new one
;
mov ax, ds:[di].GBI_objBlockArray
tst ax
jz createArray
;
; If size of block is too big, or the potential expansion
; is to large the jump to alloc a new block
;
push si ;save body chunk
mov_tr si, ax ;*ds:si <- block
mov bx, cs
mov di, offset GrObjBlockHandleElementGetUnfullBlockCB
clr cx ;assume no block
call ChunkArrayEnum
pop si ;*ds:si <- body
jcxz newBlock
done:
.leave
ret
createArray:
push si ;save body chunk
mov bx, size GrObjBlockHandleElement
clr cx ;default ChunkArrayHeader
clr si ;alloc a chunk
mov al, mask OCF_DIRTY
call ChunkArrayCreate
mov_tr ax, si ;ax <- array chunk
pop si
mov di, ds:[si]
add di, ds:[di].GrObjBody_offset
mov ds:[di].GBI_objBlockArray, ax
newBlock:
call GrObjBodyAllocGrObjBlock
mov_tr cx, bx ;return block in cx
jmp done
GrObjBodyGetBlockForOneGrObj endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBlockHandleElementGetUnfullBlockCB
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Description: Callback routine wherein each GrObjBlockHandleElement
determines whether or not it can take another grobj.
Pass: ds:di - GrObjBlockHandleElement
cx - 0
Return: if GrObjBlockHandleElement could accept another grobj:
carry set
cx - block handle
else
carry clear
cx - 0
Destroyed: ax,bx
Comments:
Revision History:
Name Date Description
---- ------------ -----------
jon Jul 17, 1992 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBlockHandleElementGetUnfullBlockCB proc far
.enter
cmp ds:[di].GOBHE_potentialSize, MAX_ALLOWED_POTENTIAL_BLOCK_SIZE \
- MAX_ALLOWED_POTENTIAL_GROBJ_SIZE
jae done ;jae = jnc
;
; Let's check the block's size against the max allowed
;
mov bx, ds:[di].GOBHE_blockHandle
mov ax, MGIT_SIZE
call MemGetInfo
cmp ax, MAX_DESIRED_BLOCK_SIZE + 1
jae done ;jae = jnc
;
; This block will do.
;
mov cx, bx
stc
done:
.leave
ret
GrObjBlockHandleElementGetUnfullBlockCB endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyAlloc
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Alloc a block in the current vm file
CALLED BY: INTERNAL
GrObjBodyAllocGrObjBlock
PASS:
ds - segment of graphic body
RETURN:
bx - mem handle
ax - vm block handle
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 8/14/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyAlloc proc far
uses cx,dx
.enter
; Allocate object block
;
call GeodeGetProcessHandle
call ProcInfo
call UserAllocObjBlock
mov cx,bx ;memory block handle
; Get VM file handle
;
call GrObjGlobalGetVMFile ;bx <- file handle
; Attach memory block to vm file
;
clr ax ;alloc new vm block handle
call VMAttach
call VMPreserveBlocksHandle
mov bx,cx ;new vm mem block handle
.leave
ret
GrObjBodyAlloc endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyAllocGrObjBlock
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Alloc a block in the current vm file to store
graphic objects in.
CALLED BY: INTERNAL
GrObjBodyGetBlockForOneGrObj
PASS:
*(ds:si) - graphicBody
RETURN:
bx - handle
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
Allocate a block in the vm file
Instantiate a body keeper object at the begining of the block
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 8/14/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyAllocGrObjBlock proc near
class GrObjBodyClass
.enter
EC < call ECGrObjBodyCheckLMemObject >
call GrObjBodyAlloc
call GrObjBodyAddObjBlock
.leave
ret
GrObjBodyAllocGrObjBlock endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyAddObjBlock
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Description: Adds the passed block to the body's obj block array
Pass: *ds:si - GrObjBody
bx - handle to add
Return: nothing
Destroyed: nothing
Comments:
Revision History:
Name Date Description
---- ------------ -----------
jon Jul 17, 1992 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyAddObjBlock proc near
class GrObjBodyClass
uses ax, bx, cx, dx, di, si, es
.enter
;
; Lock our new block
;
call ObjLockObjBlock
mov es, ax
;
; Set the OLMBH_output field = body
;
mov ax, ds:[LMBH_handle]
movdw es:[OLMBH_output], axsi
call MemUnlock
push bx ;save new block handle
; Add as first element in block size list thing.
;
mov si, ds:[si]
add si, ds:[si].GrObjBody_offset
mov si, ds:[si].GBI_objBlockArray
clr ax
call ChunkArrayElementToPtr
call ChunkArrayInsertAt
pop ds:[di].GOBHE_blockHandle
clr ds:[di].GOBHE_potentialSize
.leave
ret
GrObjBodyAddObjBlock endp
if 0
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBlockHandleElementComparePotentialSizeCB
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Description:
Pass: ds:si - GrObjBlockHandleElement #1
es:di - GrObjBlockHandleElement #2
Return: flags set for jl, je, jg for #1 <,=,> #2
Destroyed: ax, bx, cx, dx, si, di
Comments: Since GOBHE_potentialSize is unsigned, be careful to set
the flags as though a signed comparison were made
Revision History:
Name Date Description
---- ------------ -----------
jon Jul 17, 1992 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBlockHandleElementComparePotentialSizeCB proc far
.enter
mov ax, ds:[si].GOBHE_potentialSize
cmp ax, es:[di].GOBHE_potentialSize
mov ax, 1
ja greaterThan
jb lessThan
done:
.leave
ret
greaterThan:
cmp ax, 0
jmp done
lessThan:
cmp ax, 2
jmp done
GrObjBlockHandleElementComparePotentialSizeCB endp
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodySetActionNotificationOutput
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:
Specify the message and output descriptor for grobjects to
send notification to when an action is performed on them.
Grobjects will use this notification in the body if they
don't have one of their own. Many uses of the grobj will
have no notification. This is for special uses like the
chart library which needs to know when pieces of the chart
have become selected, been moved, etc.
When a grobject sends out a notification it will put
its OD in cx:dx and bp will contain GrObjActionNotificationType.
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
cx:dx - optr of object to notify
bp - message to send
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This method should be optimized for SMALL SIZE over SPEED
Common cases:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 2/20/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodySetActionNotificationOutput method dynamic GrObjBodyClass,
MSG_GB_SET_ACTION_NOTIFICATION_OUTPUT
uses ax,cx
.enter
BitSet ds:[di].GBI_flags,GBF_HAS_ACTION_NOTIFICATION
jcxz bitClear
dirty:
call ObjMarkDirty
mov ax, ATTR_GB_ACTION_NOTIFICATION
call GrObjGlobalSetActionNotificationOutput
.leave
ret
bitClear:
BitClr ds:[di].GBI_flags,GBF_HAS_ACTION_NOTIFICATION
jmp dirty
GrObjBodySetActionNotificationOutput endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodySuspendActionNotification
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:
Prevent all grobjects from sending out any action notifications,
even if a given grobject has its own output OD and message.
If the body has no action notification od it will
will still record the suspension and the suspension will
be in place when the action output is set.
Nested suspends and unsuspends are allowed.
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
RETURN:
none
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This method should be optimized for SMALL SIZE over SPEED
Common cases:
action notification var data exists
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 3/26/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodySuspendActionNotification method dynamic GrObjBodyClass,
MSG_GB_SUSPEND_ACTION_NOTIFICATION
uses ax
.enter
mov ax,ATTR_GB_ACTION_NOTIFICATION
call GrObjGlobalSuspendActionNotification
.leave
ret
GrObjBodySuspendActionNotification endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyUnsuspendActionNotification
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:
Counterbalance a call to MSG_GB_SUSPEND_ACTION_NOTIFICATION.
If all suspends have been balanced the grobject will be
free to send out action notification. However, it will not
send action notifications that were aborted during the suspended
period. If the body is not suspend the message will be ignored.
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This method should be optimized for SMALL SIZE over SPEED
Common cases:
action notification var data exists
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 3/26/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyUnsuspendActionNotification method dynamic GrObjBodyClass,
MSG_GB_UNSUSPEND_ACTION_NOTIFICATION
uses ax
.enter
mov ax,ATTR_GB_ACTION_NOTIFICATION
call GrObjGlobalUnsuspendActionNotification
.leave
ret
GrObjBodyUnsuspendActionNotification endm
GrObjAlmostRequiredCode ends
GrObjRequiredCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyIgnoreUndoActionsAndSuspend
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
RETURN:
nothing
DESTROYED:
ax
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This method should be optimized for SMALL SIZE over SPEED
Common cases:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 3/17/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyIgnoreUndoActionsAndSuspend method dynamic GrObjBodyClass,
MSG_GB_IGNORE_UNDO_ACTIONS_AND_SUSPEND
uses cx, dx, bp
.enter
; Ignore actions because suspend the body starts an undo chain
; but we don't want selecting objects to toss out the
; previous undo
;
call GrObjGlobalUndoIgnoreActions
; Suspend the body so that all the objects that are becoming
; selected and unselected won't try and update the controllers
; independently
;
mov ax, MSG_META_SUSPEND
call ObjCallInstanceNoLock
.leave
ret
GrObjBodyIgnoreUndoActionsAndSuspend endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyUnsuspendAndAcceptUndoActions
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
RETURN:
nothing
DESTROYED:
ax
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This method should be optimized for SMALL SIZE over SPEED
Common cases:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 3/17/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyUnsuspendAndAcceptUndoActions method dynamic GrObjBodyClass,
MSG_GB_UNSUSPEND_AND_ACCEPT_UNDO_ACTIONS
uses cx, dx, bp
.enter
mov ax, MSG_META_UNSUSPEND
call ObjCallInstanceNoLock
call GrObjGlobalUndoAcceptActions
.leave
ret
GrObjBodyUnsuspendAndAcceptUndoActions endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodySuspend
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:
Increment the suspend count. When the count is non-zero
grobject invalidations and ui notifications will not be
done.
NOTE: Action notifications will be still be sent out while
the body is suspended.
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This method should be optimized for SMALL SIZE over SPEED
Common cases:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 3/17/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodySuspend method dynamic GrObjBodyClass, MSG_META_SUSPEND
.enter
; If we are making the transition from not suspend to
; suspend then start an undo action
;
tst ds:[di].GBI_suspendCount
jz startUndo
incCount:
inc ds:[di].GBI_suspendCount
mov di,ds:[di].GBI_graphicsState
tst di
jz toSelected
call WinSuspendUpdate
toSelected:
mov ax,MSG_META_SUSPEND
call GrObjBodySendToSelectedGrObjs
; Only send to the edit object if we are the target. This
; prevents deaths on quick copy. An object is getting
; added to a body with out the target and that object
; is becoming editable. Since the body doesn't have the
; target, the new object doesn't get GAINED_TARGET_EXCL
; so it doesn't match the body's suspend count. It is
; bad news to be passing suspends and unsuspends to
; objects that don't have the same suspend count as
; the body.
;
mov di,ds:[si]
add di,ds:[di].GrObjBody_offset
test ds:[di].GBI_fileStatus, mask GOFS_TARGETED
jz done
mov di,mask MF_FIXUP_DS
call GrObjBodyMessageToEdit
done:
Destroy ax, cx, dx, bp
.leave
ret
startUndo:
call GrObjGlobalStartUndoChainNoText
; So that undoing operations will also be suspended.
;
mov ax,MSG_META_UNSUSPEND
clr bx
call GrObjGlobalAddFlagsUndoAction
jmp incCount
GrObjBodySuspend endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyUnsuspend
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:
Decrement the suspend count. If the count reaches zero then
Remove restrictions on grobject invalidations and notifications
sent to the UI. Initiate invalidations and notifications that
were aborted because of the suspension.
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBody
RETURN:
nothing
DESTROYED:
ax, cx, dx, bp
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This method should be optimized for SMALL SIZE over SPEED
Common cases:
unknown
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 3/17/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyUnsuspend method dynamic GrObjBodyClass, MSG_META_UNSUSPEND
.enter
; Bail if we aren't suspended
;
mov cx, ds:[di].GBI_suspendCount
EC< tst cx >
EC< ERROR_Z GROBJ_BODY_UNSUSPENDED_WHEN_NOT_ALREADY_SUSPENDED >
NEC< jcxz done >
; Reduce windows suspend count
;
mov di,ds:[di].GBI_graphicsState
tst di
jz afterUnSuspend
call WinUnSuspendUpdate
afterUnSuspend:
call GrObjBodySendToSelectedGrObjs
; Only send to the edit object if we are the target. This
; prevents deaths on quick copy. An object is getting
; added to a body with out the target and that object
; is becoming editable. Since the body doesn't have the
; target, the new object doesn't get GAINED_TARGET_EXCL
; so it doesn't match the body's suspend count. It is
; bad news to be passing suspends and unsuspends to
; objects that don't have the same suspend count as
; the body.
;
mov di,ds:[si]
add di,ds:[di].GrObjBody_offset
test ds:[di].GBI_fileStatus, mask GOFS_TARGETED
jz decCount
mov di,mask MF_FIXUP_DS
call GrObjBodyMessageToEdit
decCount:
; Reduce suspend count and bail if suspension not removed
;
mov di,ds:[si]
add di,ds:[di].GrObjBody_offset
dec cx
mov ds:[di].GBI_suspendCount, cx
jnz done
; If making the transition from suspended to not suspended
; then end the undo chained start on MSG_META_SUSPEND.
; But throw in a suspend undo action so that undoing operations
; will also be suspended.
;
mov ax,MSG_META_SUSPEND
clr bx
call GrObjGlobalAddFlagsUndoAction
call GrObjGlobalEndUndoChain
mov di,ds:[si]
add di,ds:[di].GrObjBody_offset
xchg ds:[di].GBI_unsuspendOps, cx
jcxz checkText
mov ax, MSG_GB_UPDATE_UI_CONTROLLERS
call ObjCallInstanceNoLock
clr cx
mov di, ds:[si]
add di, ds:[di].GrObjBody_offset
;
; Tell the body to update the text controllers
;
checkText:
xchg ds:[di].GBI_textUnsuspendOps, cx
jcxz done
sub sp, size VisTextGenerateNotifyParams
mov bp, sp
mov ss:[bp].VTGNP_notificationTypes, cx
mov ss:[bp].VTGNP_sendFlags, mask VTNSF_UPDATE_APP_TARGET_GCN_LISTS
mov ax, MSG_GB_GENERATE_TEXT_NOTIFY
call ObjCallInstanceNoLock
add sp, size VisTextGenerateNotifyParams
done:
Destroy ax, cx, dx, bp
.leave
ret
GrObjBodyUnsuspend endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyUndo
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Perform undo
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
ss:bp - UndoActionStruc
RETURN:
nothing
DESTROYED:
ax,cx,dx,bp
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This method should be optimized for SMALL SIZE over SPEED
Common cases:
unknown
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 7/30/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyUndo method dynamic GrObjBodyClass, MSG_META_UNDO
.enter
mov ax,({GrObjUndoAppType}ss:[bp].UAS_appType).GOUAT_undoMessage
; All grobj undo messages take their parameters from the
; UndoActionDataUnion in the same order regardless of
; the UndoActionDataType.
;
CheckHack <(offset UADF_flags.low) eq 0>
CheckHack <(offset UADF_flags.high) eq 2>
CheckHack <(offset UADF_extraFlags) eq 4>
CheckHack <(offset UADVMC_vmChain.low) eq 0>
CheckHack <(offset UADVMC_vmChain.high) eq 2>
CheckHack <(offset UADVMC_file) eq 4>
mov cx,{word}ss:[bp].UAS_data
mov dx,{word}ss:[bp].UAS_data+2
mov bp,{word}ss:[bp].UAS_data+4
call ObjCallInstanceNoLock
.leave
Destroy ax,cx,dx,bp
ret
GrObjBodyUndo endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyUndoFreeingAction
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Perform undo freeing action
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
ss:bp - AddUndoActionStruc
RETURN:
nothing
DESTROYED:
ax,cx,dx,bp
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This method should be optimized for SMALL SIZE over SPEED
Common cases:
unknown
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 7/30/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyUndoFreeingAction method dynamic GrObjBodyClass,
MSG_META_UNDO_FREEING_ACTION
.enter
mov ax,({GrObjUndoAppType}ss:[bp].AUAS_data.\
UAS_appType).GOUAT_freeMessage
; All grobj undo messages take their parameters from the
; UndoActionDataUnion in the same order regardless of
; the UndoActionDataType.
;
CheckHack <(offset UADF_flags.low) eq 0>
CheckHack <(offset UADF_flags.high) eq 2>
CheckHack <(offset UADF_extraFlags) eq 4>
CheckHack <(offset UADVMC_vmChain.low) eq 0>
CheckHack <(offset UADVMC_vmChain.high) eq 2>
CheckHack <(offset UADVMC_file) eq 4>
mov cx,{word}ss:[bp].AUAS_data.UAS_data
mov dx,{word}ss:[bp].AUAS_data.UAS_data+2
mov bp,{word}ss:[bp].AUAS_data.UAS_data+4
call ObjCallInstanceNoLock
.leave
Destroy ax,cx,dx,bp
ret
GrObjBodyUndoFreeingAction endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodySendClassedEvent
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Handler for a classed event passed via
MSG_META_SEND_CLASSED_EVENT.
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
cx - handle of ClassedEvent
dx - TravelOptions
RETURN:
event destroyed
DESTROYED:
ax,cx,dx,bp
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine is ugly, ugly, ugly.
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 12/16/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodySendClassedEvent method dynamic GrObjBodyClass, \
MSG_META_SEND_CLASSED_EVENT
eventHandle local hptr push cx
travelOption local word push dx
.enter
cmp dx, TO_TARGET
je target
cmp dx, TO_FOCUS
je focus
push bp ;stack frame
mov di, offset GrObjBodyClass
CallSuper MSG_META_SEND_CLASSED_EVENT
pop bp ;stack frame
done:
.leave
Destroy ax,cx,dx,bp
ret
focus:
; If we don't have a focusExcl then handle the message
; here at the body. Otherwise send to focus
;
tst ds:[di].GBI_focusExcl.HG_OD.handle
jz toBody
mov cx,eventHandle
mov dx,travelOption
mov di,mask MF_FIXUP_DS
mov ax,MSG_META_SEND_CLASSED_EVENT
call GrObjBodyMessageToFocus
jmp done
target:
; Handle any messages that can be used to set default
; attributes
;
mov ax,MSG_GB_SEND_CLASSED_EVENT_SET_DEFAULT_ATTRS
call ObjCallInstanceNoLock
; Get the class of the encapsulated message
;
mov bx,cx ;event handle
mov dx,si ;guardian chunk
call ObjGetMessageInfo
xchg dx,si ;event class offset,
;guard chunk
; If the class is zero the then message is a meta
; message that should be sent to the leaf. We
; are operating under the assumption that such messages
; cannot be sent to multiple objects with intelligible
; results (eg MSG_META_COPY, MSG_META_PASTE), unless
; they are MetaTextMessages. Our concept of leaf is either
; the edit/target, if there is one, or the body.
;
tst cx ;class segment
jnz hasClass
; The body wants to handle search and spell messages
; itself.
;
call GrObjGlobalCheckForMetaSearchSpellMessages
jc toBody
; The body will handle suspend and unsuspend messages
; itself. See GrObjBodySuspend for details.
;
call GrObjGlobalCheckForMetaSuspendUnsuspendMessages
jc toBody
mov di,ds:[si]
add di,ds:[di].GrObjBody_offset
tst ds:[di].GBI_targetExcl.HG_OD.handle
jz checkText
; We have a target
;
mov cx,eventHandle
mov dx,travelOption
mov di,mask MF_FIXUP_DS
mov ax,MSG_META_SEND_CLASSED_EVENT
call GrObjBodyMessageToEdit
jmp done
checkText:
call GrObjGlobalCheckForMetaTextMessages
jnc toBody ;jmp if not text message
; The suspend gives us an undo chain that encompasses
; the whole operation (in case more than one object is
; selected). It alway fixes multiple update problems
; with text menus which don't send out a suspend/unsuspend
;
push bp ;local frame
mov ax,MSG_META_SUSPEND
call ObjCallInstanceNoLock
pop bp ;local frame
call GrObjBodySendClassedEventToEditSelection
push bp ;local frame
mov ax,MSG_META_UNSUSPEND
call ObjCallInstanceNoLock
pop bp ;local frame
jmp done
toBody:
mov cx,eventHandle
mov dx,travelOption
mov di,offset GrObjBodyClass
mov ax,MSG_META_SEND_CLASSED_EVENT
push bp
call ObjCallSuperNoLock
pop bp
jmp done
hasClass:
; The message actually had a class in it.
; If the message can be handled at this level
; (ie by the GrObjBody), then do so. Since the body
; is also responsible for relaying messages to the
; head and the ruler we will try that also.
;
push bp ;save locals
mov ax,MSG_META_IS_OBJECT_IN_CLASS
call ObjCallInstanceNoLock
pop bp ;restore locals
jc toBody
push bp ;save locals
mov ax,MSG_META_IS_OBJECT_IN_CLASS
mov di,mask MF_FIXUP_DS or mask MF_CALL
call GrObjBodyMessageToHead
pop bp ;restore locals
EC < ERROR_Z GROBJ_BODY_NOT_ATTACHED_TO_HEAD >
jc toHead
; We want to send VisRuler, and its subclasses, messages
; to the VisRuler but we don't want to inadvertently
; send Vis messages intended for Vis Wards to be
; eaten by the ruler.
;
cmp cx,segment VisClass
jne checkRuler
cmp dx, offset VisClass
jne checkRuler
toTarget:
; Our concept of target is either the edit grab or
; the selection list. There will never be both, so
; just send it to both and the right thing will happen
;
call GrObjGlobalStartUndoChainNoText
call GrObjBodySendClassedEventToEditSelection
call GrObjGlobalEndUndoChain
jmp done
checkRuler:
push bp
mov ax,MSG_META_IS_OBJECT_IN_CLASS
mov di,mask MF_FIXUP_DS or mask MF_CALL
call GrObjBodyMessageToRuler
pop bp
jnc toTarget
mov cx,eventHandle
mov dx,travelOption
mov di,mask MF_FIXUP_DS
mov ax,MSG_META_SEND_CLASSED_EVENT
call GrObjBodyMessageToRuler
jmp done
toHead:
mov cx,eventHandle
mov dx,travelOption
mov di,mask MF_FIXUP_DS
mov ax,MSG_META_SEND_CLASSED_EVENT
call GrObjBodyMessageToHead
EC < ERROR_Z GROBJ_BODY_NOT_ATTACHED_TO_HEAD >
jmp done
GrObjBodySendClassedEvent endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodySendClassedEventToEditSelection
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Send the classed event in the inherited stack frame
to, the edit grab and the selection list
CALLED BY: INTERNAL
GrObjBodySendClassedEvent
PASS: *ds:si - GrObjBody
ss:bp - inherited stack frame
RETURN:
nothing
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine should be optimized for SMALL SIZE over SPEED
Common cases:
unknown
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 5/11/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodySendClassedEventToEditSelection proc near
eventHandle local hptr
travelOption local word
uses ax,bx,cx,dx,di
.enter inherit
EC < call ECGrObjBodyCheckLMemObject >
mov bx,eventHandle
mov dx,travelOption
call ObjDuplicateMessage
mov_tr cx,ax ;duped event handle
mov ax,MSG_META_SEND_CLASSED_EVENT
mov di,mask MF_FIXUP_DS
call GrObjBodyMessageToEdit
jz noEdit
mov cx,bx ;original event
toSelected:
mov ax,MSG_META_SEND_CLASSED_EVENT
call GrObjBodySendClassedEventToSelectedGrObjs
.leave
ret
noEdit:
xchg bx,cx ;duped event, original event
call ObjFreeMessage
jmp toSelected
GrObjBodySendClassedEventToEditSelection endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodySendClassedEventSetDefaultAttrs
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: The body sends this message to itself when processing
MSG_META_SEND_CLASSED_EVENT so that it can use the
message for setting default attributes. This handler
must not damage the original message. If it decides
to use the message it must duplicate it
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
cx - event handle
dx - travel option
RETURN:
nothing
DESTROYED:
ax
PSEUDO CODE/STRATEGY:
nothing
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 5/17/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodySendClassedEventSetDefaultAttrs method dynamic GrObjBodyClass,
MSG_GB_SEND_CLASSED_EVENT_SET_DEFAULT_ATTRS
uses cx,bp
.enter
; If nothing is selected and nothing is being edited
; then set the default attrs.
;
tst ds:[di].GBI_targetExcl.HG_OD.handle
jnz editing
call GrObjBodyGetNumSelectedGrObjs
tst bp
jnz somethingSelected
setDefaults:
; READ ME NOW
; For this routine to work it is vital that we only
; come to the setDefaults label if there are no text
; objects selected nor being edited. In this case the
; styled messages need to be sent to the attribute manager
; so that controllers update correctly. If this is not the
; case the style messages must not go to the attribute
; manager, because they would then be handled more than once
; causing no end of trouble.
;
push si, es
mov bx, cx
call ObjGetMessageInfo ;ax = message, cxsi=OD
segmov es, cs
cmp cx,segment VisTextClass
jne normalIgnore
cmp si,offset VisTextClass
jne normalIgnore
mov di, offset visTextMessageIgnoreList
mov cx, length visTextMessageIgnoreList
jmp doIgnoreCheck
normalIgnore:
mov di, offset normalMessageIgnoreList
mov cx, length normalMessageIgnoreList
doIgnoreCheck:
repne scasw
pop si, es
jz done
call ObjDuplicateMessage
mov_tr cx, ax ;duped event handle
mov ax,MSG_META_SEND_CLASSED_EVENT
mov di,mask MF_FIXUP_DS
call GrObjBodyMessageToGOAM
mov cx,bx ;orig event handle
call GrObjGlobalCheckForClassedMetaTextMessages
jc justSetDefaultTextAttrs
done:
.leave
ret
editing:
; Because the attribute manager stores text attributes, if
; the object being edited is not a text object then we
; still need to set the default attrs if this is a text message.
; Otherwise the text message will not get handled and the
; text controllers won't get updated potentially leaving them
; in an inconsistent state.
;
push cx,dx ;event handle, travel option
mov cx, segment TextGuardianClass
mov dx, offset TextGuardianClass
mov di,mask MF_FIXUP_DS or mask MF_CALL
mov ax, MSG_META_IS_OBJECT_IN_CLASS
call GrObjBodyMessageToEdit
pop cx,dx ;event handle, travel option
jc done ;jmp if its a text object
call GrObjGlobalCheckForClassedMetaTextMessages
jc setDefaults ;jmp if text message
call GrObjGlobalCheckForClassedMetaStylesMessages
jc setDefaults ;jmp if styles message
jmp done
somethingSelected:
; Because the attribute manager stores text attributes, if
; none of the selected objects are text objects then we
; still need to set the default attrs if this is a text message.
; Otherwise the text message will not get handled and the
; text controllers won't get updated potentially leaving them
; in an inconsistent state.
;
call GrObjBodyCheckForSelectedGrObjTexts
jc done ;jmp if a text object selected
call GrObjGlobalCheckForClassedMetaTextMessages
jc setDefaults ;jmp if text message
call GrObjGlobalCheckForClassedMetaStylesMessages
jc setDefaults ;jmp if styles message
jmp done
justSetDefaultTextAttrs:
;
; We want to force
; a text update, 'cause the GOAM's text object isn't the target,
; so it won't force one itself
;
sub sp, size VisTextGenerateNotifyParams
mov bp, sp
mov ss:[bp].VTGNP_notificationTypes, VIS_TEXT_STANDARD_NOTIFICATION_FLAGS and not mask VTNF_SELECT_STATE
clr ss:[bp].VTGNP_sendFlags
mov ax, MSG_GB_GENERATE_TEXT_NOTIFY
call ObjCallInstanceNoLock
add sp, size VisTextGenerateNotifyParams
jmp done
GrObjBodySendClassedEventSetDefaultAttrs endm
visTextMessageIgnoreList word \
MSG_VIS_TEXT_REPLACE_WITH_GRAPHIC,
MSG_VIS_TEXT_REPLACE_TEXT,
MSG_META_DISPATCH_EVENT
normalMessageIgnoreList word \
MSG_META_STYLED_OBJECT_DEFINE_STYLE,
MSG_META_STYLED_OBJECT_REDEFINE_STYLE,
MSG_META_STYLED_OBJECT_SAVE_STYLE,
MSG_META_STYLED_OBJECT_REQUEST_ENTRY_MONIKER,
MSG_META_STYLED_OBJECT_UPDATE_MODIFY_BOX,
MSG_META_STYLED_OBJECT_MODIFY_STYLE,
MSG_META_STYLED_OBJECT_LOAD_STYLE_SHEET,
MSG_META_STYLED_OBJECT_DESCRIBE_STYLE,
MSG_META_STYLED_OBJECT_DESCRIBE_ATTRS,
MSG_META_STYLED_OBJECT_DELETE_STYLE,
MSG_VIS_TEXT_REPLACE_WITH_GRAPHIC,
MSG_VIS_TEXT_REPLACE_TEXT,
MSG_META_DISPATCH_EVENT
GrObjRequiredCode ends
GrObjExtInteractiveCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyAddDuplicateFloater
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Add a duplicate of the passed object to the visual tree
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
cx:dx - object
RETURN:
cx:dx - new object OD
DESTROYED:
nothing
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 5/ 9/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyAddDuplicateFloater method dynamic GrObjBodyClass, \
MSG_GB_ADD_DUPLICATE_FLOATER
uses ax,bp
.enter
; Copy object
;
push si ;body lmem
mov ax,MSG_GO_DUPLICATE_FLOATER
mov bx,cx ;object handle
mov cx,ds:[LMBH_handle] ;body handle
xchg si,dx ;object chunk, body chunk
mov di,mask MF_FIXUP_DS or mask MF_CALL
call ObjMessage
pop si ;body lmem
; Add new object to body
;
push cx,dx ;new object OD
mov bp,GOBAGOR_LAST or mask GOBAGOF_DRAW_LIST_POSITION
mov ax,MSG_GB_ADD_GROBJ
call ObjCallInstanceNoLock
pop cx,dx ;new object OD
.leave
ret
GrObjBodyAddDuplicateFloater endm
GrObjExtInteractiveCode ends
GrObjExtNonInteractiveCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyChangeGrObjDepth
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Change grobjs position in the draw and reverse lists.
Note you can knock the selection array out of
draw order when using this message. You may
want to use MSG_GB_REORDER_SELECTION_ARRAY afterwards.
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
cx:dx - od of grobj to change depth of
bp - GrObjBodyAddGrObjFlags
RETURN:
nothing
DESTROYED:
ax
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This method should be optimized for SMALL SIZE over SPEED
Common cases:
unknown
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 5/19/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyChangeGrObjDepth method dynamic GrObjBodyClass,
MSG_GB_CHANGE_GROBJ_DEPTH
uses bp
.enter
; Oh boy. We need to compare the source and dest positions
; so that we reject null moves. However, the passed
; position may well be GOBAGOR_LAST, which doesn't compare
; well with the actual positions. So we take the lesser
; of the passed position and the position in the other list.
; This lesser value cannot, of course, be GOBAGOR_LAST.
;
mov bx,bp ;passed position
mov ax,bp ;passed position
call GrObjBodyConvertListPosition
mov di,bp ;other position
BitClr ax, GOBAGOF_DRAW_LIST_POSITION ;raw passed
BitClr bp, GOBAGOF_DRAW_LIST_POSITION ;raw other
cmp ax,bp ;raw passed to raw other
jb 10$
mov bx,di ;other is smaller
10$:
mov bp,bx
; To simplify our lives we are going to do all our work
; with reverse list positions. (The reverse position doesn't
; have the high bit set, so math works better).
; Convert our dest position to the reverse list if necessary.
;
test bp,mask GOBAGOF_DRAW_LIST_POSITION
jz 20$
call GrObjBodyConvertListPosition
20$:
; Get the current reverse position of the object
;
push cx,dx ;child od
mov ax, MSG_GB_FIND_GROBJ
call ObjCallInstanceNoLock
EC < ERROR_NC GROBJ_BODY_CHANGE_GROBJ_DEPTH_BAD_OD >
mov_tr ax,dx ;reverse position
pop cx,dx ;child od
; If the current and dest positions are the same then
; do nothing.
; If the child's position is less than the position the
; child is being moved to then we need to decrement the
; destination position to account for the child
; having been removed.
;
cmp ax,bp ;current vs dest
je done
ja changeDepth
dec bp
changeDepth:
push cx,dx ;object od
mov cx,handle depthString
mov dx,offset depthString
call GrObjGlobalStartUndoChain
pop cx,dx ;object od
; Change the child's depth
;
mov ax,MSG_GB_REMOVE_GROBJ
call ObjCallInstanceNoLock
mov ax,MSG_GB_ADD_GROBJ
call ObjCallInstanceNoLock
mov bx,cx ;child handle
mov si,dx ;child chunk
mov di,mask MF_FIXUP_DS
mov ax,MSG_GO_INVALIDATE
call ObjMessage
call GrObjGlobalEndUndoChain
done:
.leave
ret
GrObjBodyChangeGrObjDepth endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyFindGrObj
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Find the position in the draw list and the reverse list
of the passed child
PASS:
*(ds:si) - instance data of object
ds:[bx] - instance data of object
ds:[di] - master part of object (if any)
es - segment of GrObjBodyClass
cx:dx - OD of child
RETURN:
stc - if found
cx - position in draw list
dx - position in reverse list
clc - if not found
cx,dx - destroyed
DESTROYED:
see RETURN
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 11/18/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyFindGrObj method dynamic GrObjBodyClass, \
MSG_GB_FIND_GROBJ
uses ax,bp
.enter
; Find child in normal draw linkage
;
; mov di,ds:[si] ;treat composite offset as if
; mov di,ds:[di].GrObjBody_offset ;it is from meta data
; add di,offset GBI_drawComp
CheckHack <(offset GrObj_offset) eq (offset Vis_offset)>
movnf ax, <offset GOI_drawLink>
mov di,offset GBI_drawComp
mov bx, offset GrObj_offset ;grobj is master
call ObjCompFindChild
cmc
jnc done
; Convert draw list position to reverse list position.
; (reverse position = Num children-draw position-1)
;
mov cx,bp ;position in draw list
mov di,ds:[si]
add di,ds:[di].GrObjBody_offset
mov dx,ds:[di].GBI_childCount
sub dx,cx
dec dx
stc ;found
done:
.leave
ret
GrObjBodyFindGrObj endm
GrObjExtNonInteractiveCode ends
| 23.114804 | 109 | 0.609701 |
c9be5b63c051a99685c059980d71fede51961799 | 311 | sql | SQL | src/test/resources/test1.sql | duergner/bigbash | 51290b1912dd5c0ff34e9da1093dcd9028692054 | [
"Apache-2.0"
] | 143 | 2016-05-30T15:01:54.000Z | 2017-06-21T08:55:29.000Z | src/test/resources/test1.sql | duergner/bigbash | 51290b1912dd5c0ff34e9da1093dcd9028692054 | [
"Apache-2.0"
] | 4 | 2016-05-30T14:10:08.000Z | 2017-03-28T11:41:19.000Z | src/test/resources/test1.sql | duergner/bigbash | 51290b1912dd5c0ff34e9da1093dcd9028692054 | [
"Apache-2.0"
] | 10 | 2017-07-17T22:38:03.000Z | 2022-03-16T21:56:39.000Z | CREATE TABLE realtimelogging (actiondate DATE,
appdomain INT,
sku TEXT,
simplesku TEXT,
customerId TEXT,
sessioneId TEXT,
action TEXT,
salecount INT,
price INT,
orderId TEXT,
cookieId TEXT,
shobabtest TEXT,
internalReferer TEXT) ;
Select * from realtimelogging where sku='HI122D06A-A00' or sku='JU621K000-B11'; | 20.733333 | 79 | 0.797428 |
38ed3d988d1fcc492ea5b06bced45142ce29f8ef | 6,243 | h | C | CSC/CSC114/GaddisExamples/Chapter18/LinkedList Template Version 2/LinkedList.h | HNSS-US/DelTech | a424da4e10ec0a33caaa6ed1c1d78837bdc6b0a2 | [
"MIT"
] | 3 | 2019-02-02T16:59:48.000Z | 2019-02-28T14:50:08.000Z | SourceCode/Chapter 17/LinkedList Template Version 2/LinkedList.h | jesushilariohernandez/DelMarCSi.cpp | 6dd7905daea510452691fd25b0e3b0d2da0b06aa | [
"MIT"
] | null | null | null | SourceCode/Chapter 17/LinkedList Template Version 2/LinkedList.h | jesushilariohernandez/DelMarCSi.cpp | 6dd7905daea510452691fd25b0e3b0d2da0b06aa | [
"MIT"
] | 4 | 2020-04-10T17:22:17.000Z | 2021-11-04T14:34:00.000Z | // A class template for holding a linked list.
// The node type is also a class template.
#ifndef LINKEDLIST_H
#define LINKEDLIST_H
//*********************************************
// The ListNode class creates a type used to *
// store a node of the linked list. *
//*********************************************
template <class T>
class ListNode
{
public:
T value; // Node value
ListNode<T> *next; // Pointer to the next node
// Constructor
ListNode (T nodeValue)
{ value = nodeValue;
next = nullptr;}
};
//*********************************************
// LinkedList class *
//*********************************************
template <class T>
class LinkedList
{
private:
ListNode<T> *head; // List head pointer
public:
// Constructor
LinkedList()
{ head = nullptr; }
// Destructor
~LinkedList();
// Linked list operations
void appendNode(T);
void insertNode(T);
void deleteNode(T);
void displayList() const;
};
//**************************************************
// appendNode appends a node containing the value *
// pased into newValue, to the end of the list. *
//**************************************************
template <class T>
void LinkedList<T>::appendNode(T newValue)
{
ListNode<T> *newNode; // To point to a new node
ListNode<T> *nodePtr; // To move through the list
// Allocate a new node and store newValue there.
newNode = new ListNode<T>(newValue);
// If there are no nodes in the list
// make newNode the first node.
if (!head)
head = newNode;
else // Otherwise, insert newNode at end.
{
// Initialize nodePtr to head of list.
nodePtr = head;
// Find the last node in the list.
while (nodePtr->next)
nodePtr = nodePtr->next;
// Insert newNode as the last node.
nodePtr->next = newNode;
}
}
//**************************************************
// displayList shows the value stored in each node *
// of the linked list pointed to by head. *
//**************************************************
template <class T>
void LinkedList<T>::displayList() const
{
ListNode<T> *nodePtr; // To move through the list
// Position nodePtr at the head of the list.
nodePtr = head;
// While nodePtr points to a node, traverse
// the list.
while (nodePtr)
{
// Display the value in this node.
cout << nodePtr->value << endl;
// Move to the next node.
nodePtr = nodePtr->next;
}
}
//**************************************************
// The insertNode function inserts a node with *
// newValue copied to its value member. *
//**************************************************
template <class T>
void LinkedList<T>::insertNode(T newValue)
{
ListNode<T> *newNode; // A new node
ListNode<T> *nodePtr; // To traverse the list
ListNode<T> *previousNode = nullptr; // The previous node
// Allocate a new node and store newValue there.
newNode = new ListNode<T>(newValue);
// If there are no nodes in the list
// make newNode the first node
if (!head)
{
head = newNode;
newNode->next = nullptr;
}
else // Otherwise, insert newNode
{
// Position nodePtr at the head of list.
nodePtr = head;
// Initialize previousNode to nullptr.
previousNode = nullptr;
// Skip all nodes whose value is less than newValue.
while (nodePtr != nullptr && nodePtr->value < newValue)
{
previousNode = nodePtr;
nodePtr = nodePtr->next;
}
// If the new node is to be the 1st in the list,
// insert it before all other nodes.
if (previousNode == nullptr)
{
head = newNode;
newNode->next = nodePtr;
}
else // Otherwise insert after the previous node.
{
previousNode->next = newNode;
newNode->next = nodePtr;
}
}
}
//*****************************************************
// The deleteNode function searches for a node *
// with searchValue as its value. The node, if found, *
// is deleted from the list and from memory. *
//*****************************************************
template <class T>
void LinkedList<T>::deleteNode(T searchValue)
{
ListNode<T> *nodePtr; // To traverse the list
ListNode<T> *previousNode; // To point to the previous node
// If the list is empty, do nothing.
if (!head)
return;
// Determine if the first node is the one.
if (head->value == searchValue)
{
nodePtr = head->next;
delete head;
head = nodePtr;
}
else
{
// Initialize nodePtr to head of list
nodePtr = head;
// Skip all nodes whose value member is
// not equal to num.
while (nodePtr != nullptr && nodePtr->value != searchValue)
{
previousNode = nodePtr;
nodePtr = nodePtr->next;
}
// If nodePtr is not at the end of the list,
// link the previous node to the node after
// nodePtr, then delete nodePtr.
if (nodePtr)
{
previousNode->next = nodePtr->next;
delete nodePtr;
}
}
}
//**************************************************
// Destructor *
// This function deletes every node in the list. *
//**************************************************
template <class T>
LinkedList<T>::~LinkedList()
{
ListNode<T> *nodePtr; // To traverse the list
ListNode<T> *nextNode; // To point to the next node
// Position nodePtr at the head of the list.
nodePtr = head;
// While nodePtr is not at the end of the list...
while (nodePtr != nullptr)
{
// Save a pointer to the next node.
nextNode = nodePtr->next;
// Delete the current node.
delete nodePtr;
// Position nodePtr at the next node.
nodePtr = nextNode;
}
}
#endif | 26.793991 | 66 | 0.507128 |
7ba606a224106fc03ae5bf9a58dc44c2531106ad | 1,522 | rb | Ruby | spec/stellar/client_spec.rb | pwnall/stellar | cd2bfd55a6afe9118a06c0d45d6a168e520ec19f | [
"MIT"
] | 2 | 2015-08-13T20:04:22.000Z | 2018-12-14T22:33:37.000Z | spec/stellar/client_spec.rb | pwnall/stellar | cd2bfd55a6afe9118a06c0d45d6a168e520ec19f | [
"MIT"
] | null | null | null | spec/stellar/client_spec.rb | pwnall/stellar | cd2bfd55a6afe9118a06c0d45d6a168e520ec19f | [
"MIT"
] | null | null | null | require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe Stellar::Client do
let(:client) { Stellar::Client.new }
shared_examples_for 'an authenticated client' do
describe 'get_nokogiri' do
let(:page) { client.get_nokogiri '/atstellar' }
it 'should be a Nokogiri document' do
page.should be_kind_of(Nokogiri::HTML::Document)
end
it 'should have course links' do
page.css('a[title*="class site"]').length.should > 0
end
end
end
describe '#auth' do
describe 'with Kerberos credentials' do
before do
client.auth :kerberos => test_mit_kerberos
end
it_should_behave_like 'an authenticated client'
end
describe 'with a certificate' do
before do
client.auth :cert => test_mit_cert
end
it_should_behave_like 'an authenticated client'
end
describe 'with bad Kerberos credentials' do
it 'should raise ArgumentError' do
lambda {
client.auth :kerberos => test_mit_kerberos.merge(:pass => 'fail')
}.should raise_error(ArgumentError)
end
end
end
describe '#course' do
before do
client.auth :kerberos => test_mit_kerberos
end
let(:six) { client.course('6.006', 2011, :fall) }
it 'should return a Course instance' do
six.should be_kind_of(Stellar::Course)
end
it 'should return a 6.006 course' do
six.number.should == '6.006'
end
end
end
| 24.95082 | 75 | 0.628121 |
9bf903382053bcd7ed3ec8d97535cdc1806f83eb | 1,818 | js | JavaScript | src/components/Accordion.js | corscheparrera/photo-ticket-react-native | e71d2efdcea40fc584c48ef0cb9c96567fa27e2c | [
"Apache-2.0"
] | 2 | 2018-05-16T00:08:57.000Z | 2019-02-28T12:47:11.000Z | src/components/Accordion.js | corscheparrera/photo-ticket-react-native | e71d2efdcea40fc584c48ef0cb9c96567fa27e2c | [
"Apache-2.0"
] | null | null | null | src/components/Accordion.js | corscheparrera/photo-ticket-react-native | e71d2efdcea40fc584c48ef0cb9c96567fa27e2c | [
"Apache-2.0"
] | null | null | null | import React, { Component } from "react";
import {
StyleSheet,
Text,
View,
TouchableHighlight,
Animated,
ScrollView
} from "react-native";
import Icon from "react-native-vector-icons/Ionicons";
class Accordion extends Component {
constructor(props) {
super(props);
this.icons = {
up: "ios-arrow-up",
down: "ios-arrow-down"
};
this.state = {
title: props.title,
expanded: props.expand
};
}
toggle = () => {
this.setState({
expanded: !this.state.expanded
});
};
render() {
let icon = this.icons["down"];
if (this.state.expanded == true) {
icon = this.icons["up"];
}
return (
<View style={{ marginBottom: 15 }}>
<TouchableHighlight onPress={this.toggle} underlayColor="#f1f1f1">
<View style={styles.titleContainer}>
<Text style={styles.title}>{this.state.title}</Text>
<View style={styles.button}>
<Icon name={icon} size={28} />
</View>
</View>
</TouchableHighlight>
<View style={{ display: this.state.expanded ? "flex" : "none" }}>
<ScrollView styles={{ flex: 0 }}>
<View style={styles.content}>{this.props.children}</View>
</ScrollView>
</View>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
backgroundColor: "#fff",
margin: 10,
overflow: "hidden"
},
titleContainer: {
backgroundColor: "#ec2326",
flexDirection: "row"
},
content: {
padding: 15
},
title: {
flex: 1,
padding: 10,
color: "#FFFFFF",
fontWeight: "bold"
},
button: {
justifyContent: "center",
alignItems: "center",
width: 30
},
body: {
padding: 10,
paddingTop: 0
}
});
export default Accordion;
| 19.978022 | 74 | 0.556106 |
18b4e20105e73fad493169696bfa1953f242a6e2 | 4,287 | css | CSS | src/css/views/footer.css | TheSignLab/CreativeLab_20180225_TS_Gakko | 1966183d50226fad4d5edc01353ba72d072a22ae | [
"MIT"
] | null | null | null | src/css/views/footer.css | TheSignLab/CreativeLab_20180225_TS_Gakko | 1966183d50226fad4d5edc01353ba72d072a22ae | [
"MIT"
] | 1 | 2018-02-25T17:56:26.000Z | 2018-02-25T17:56:26.000Z | src/css/views/footer.css | TheSignLab/CreativeLab_20180225_TS_Gakko | 1966183d50226fad4d5edc01353ba72d072a22ae | [
"MIT"
] | null | null | null | /* Generated by less 2.5.1 */
/**
* Filename : footer.less
* Preprocessor : LESS
* Update : 03/05/18
*
**/
span[color="white"] {
color: #ffffff;
}
span[color="yellow"] {
color: #f7b41b;
}
desktop-footer,
mobile-footer {
z-index: 50;
background-color: #000000;
}
desktop-footer {
display: none;
}
mobile-footer wrapper-img {
display: block;
z-index: 50;
width: 100vw;
height: auto;
box-sizing: border-box;
display: -webkit-flex;
display: -ms-flexbox;
display: -ms-flex;
display: flex;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
-webkit-justify-content: center;
-ms-justify-content: center;
justify-content: center;
-webkit-align-content: center;
-ms-align-content: center;
align-content: center;
-webkit-align-items: center;
-ms-align-items: center;
align-items: center;
}
mobile-footer wrapper-img img {
width: 100%;
display: block;
}
mobile-footer wrapper-img item {
display: inline-block;
font-size: 4.3vw;
padding-right: 0.5vw;
margin-right: 0vw;
display: -webkit-flex;
display: -ms-flexbox;
display: -ms-flex;
display: flex;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
-webkit-justify-content: center;
-ms-justify-content: center;
justify-content: center;
-webkit-align-content: center;
-ms-align-content: center;
align-content: center;
-webkit-align-items: center;
-ms-align-items: center;
align-items: center;
}
mobile-footer wrapper-img item span {
position: relative;
top: 0.5vw;
}
mobile-footer wrapper-img item span.f-light {
position: relative;
left: 0.5vw;
}
mobile-footer wrapper-img item.bar {
font-family: font-bold;
vertical-align: middle;
display: -webkit-flex;
display: -ms-flexbox;
display: -ms-flex;
display: flex;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
-webkit-justify-content: center;
-ms-justify-content: center;
justify-content: center;
-webkit-align-content: center;
-ms-align-content: center;
align-content: center;
-webkit-align-items: center;
-ms-align-items: center;
align-items: center;
}
mobile-footer wrapper-img[bg-black] {
padding: 5vw;
background-color: #000000;
}
mobile-footer wrapper-img[bg-yellow] {
padding: 2vw;
background-color: #f7b41b;
}
mobile-footer wrapper-img[bg-yellow] img {
height: 4.5vw;
width: 4.5vw;
display: block;
}
mobile-footer wrapper-img[bg-yellow] item[emailTo] img {
height: 5.0vw;
width: 5.0vw;
display: block;
}
desktop-footer wrapper {
width: 100%;
height: 12vw;
margin: 0 auto;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
-webkit-justify-content: space-around;
-ms-flex-pack: space-around;
justify-content: space-around;
-webkit-align-content: space-around;
-ms-flex-line-pack: space-around;
align-content: space-around;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
}
desktop-footer footer-item {
display: block;
}
desktop-footer footer-line {
width: 2pt;
height: 60%;
background-color: #F7B41B;
border-radius: 250pt;
}
desktop-footer footer-item.image img {
max-width: 250pt;
width: 100%;
display: block;
margin: 0 auto;
}
desktop-footer footer-item.mensaje h2 {
width: 100%;
color: white;
line-height: 98%;
font-weight: 100;
font-size: 1.6vw;
font-family: font-med-condensed;
letter-spacing: 0.05vw;
margin: 0vw 0vw .4vw;
}
desktop-footer footer-item.mensaje h3 {
font-size: 1.6vw;
font-family: font-med-condensed;
background-color: #F7B41B;
color: black;
padding: 0.2vw 1vw 0vw;
width: fit-content;
margin: 0;
margin-left: 0pt;
}
desktop-footer footer-item.contacto img {
max-width: 250pt;
width: 100%;
display: block;
margin: 0 auto;
}
@media (min-width: 1200px) {
desktop-footer {
display: block;
}
mobile-footer {
display: none;
}
}
| 21.651515 | 56 | 0.679729 |
70000fe21cf40eb56bddd05f4e763a5819b30104 | 1,635 | sql | SQL | db/seed.sql | ShaylaStevenson/employee-tracker | f055093028a3b655ad8881fb5bcbcf1c3226d1d8 | [
"MIT"
] | null | null | null | db/seed.sql | ShaylaStevenson/employee-tracker | f055093028a3b655ad8881fb5bcbcf1c3226d1d8 | [
"MIT"
] | null | null | null | db/seed.sql | ShaylaStevenson/employee-tracker | f055093028a3b655ad8881fb5bcbcf1c3226d1d8 | [
"MIT"
] | null | null | null | USE trackerDB;
-- Data for Department table --
INSERT INTO Department (id, name)
VALUES (1, 'Administration'), (2, 'Front End'), (3, 'Merchandising'),
(4, 'Food Court'), (5, 'Deli'), (6, 'Bakery'),
(7, 'Pharmacy'), (8, 'Optical'), (9, 'Hearing Aid');
-- Data for Role table --
INSERT INTO Role (id, title, salary, department_id)
VAlUES (1, 'Payroll Clerk', 60000, 1), (2, 'Sales Auditor', 58000, 1),
(3, 'Cashier', 50000, 2), (4, 'Cart Puller', 30000, 2),
(5, 'Forklift Driver', 50000, 3), (6, 'Stocker', 40000, 3),
(7, 'FC Cashier', 35000, 4), (8, 'FC Prepper', 37000, 4),
(9, 'Deli Prepper', 37000, 5), (10, 'Chicken Chef', 35000, 5),
(11, 'Baker', 50000, 6), (12, 'Wrapper', 35000, 6),
(13, 'Pharmacy Technician', 70000, 7), (14, 'Pharmacist', 90000, 7),
(15, 'Optometrist', 85000, 8), (16, 'Optical Technician', 60000, 8),
(17, 'Hearing Aid Specialist', 75000, 9), (18, 'Hearing Aid Dispenser', 58000, 9),
(19, 'General Manager', 100000, 1);
-- Data for Employee table --
INSERT INTO Employee (id, first_name, last_name, role_id, manager_id)
VALUES (1, 'Bertha', 'Blue', 1, 19), (2, 'Hue', 'Lui', 2, 19),
(3, 'Ben', 'Tens', 3, 19), (4, 'Wina', 'Slima', 4, 3),
(5, 'Gert', 'Mert', 5, 19), (6, 'Beatrice', 'Bert', 6, 5), --merch
(7, 'Gertie', 'Green', 7, 8), (8, 'Bing', 'Tune', 8, 19), --FC
(9, 'Roja', 'Red', 9, 19), (10, 'Azul', 'Blue', 10, 9), --deli
(11, 'Kim', 'Bin', 11, 19), (12, 'Zach', 'Lack', 12, 11),
(13, 'Sam', 'Clam', 13, 14), (14, 'Marietta', 'Smart', 14, 19),
(15, 'Wanda', 'Vision', 15, 19), (16, 'Hatti', 'Thate', 16, 15),
(17, 'Cam', 'Can', 17, 5), (18, 'Ron', 'Long', 18, 17),
(19, 'Mildred', 'Boss', 19);
| 44.189189 | 82 | 0.568807 |
540ff34a77452ab7540df9bfc4cb0705f7fa5863 | 6,102 | go | Go | go/terminalescaper/escaper.go | yan0908/client | 2debd54aa01e01f91cb5ef81104b1932a5cd681f | [
"BSD-3-Clause"
] | 8,805 | 2015-11-03T00:52:29.000Z | 2022-03-29T22:30:03.000Z | go/terminalescaper/escaper.go | joergpanke/client | e310b28b4e58987ffb1228650d35e07b9a379669 | [
"BSD-3-Clause"
] | 14,694 | 2015-02-24T15:13:42.000Z | 2022-03-31T13:16:45.000Z | go/terminalescaper/escaper.go | joergpanke/client | e310b28b4e58987ffb1228650d35e07b9a379669 | [
"BSD-3-Clause"
] | 1,329 | 2015-11-03T20:25:51.000Z | 2022-03-31T18:10:38.000Z | package terminalescaper
import (
"io"
"unicode/utf8"
)
// Taken from unexported data at golang.org/x/crypto/ssh/terminal
// and expanded with data at github.com/keybase/client/go/client:color.go
type EscapeCode []byte
var keyEscape byte = 27
var vt100EscapeCodes = []EscapeCode{
// Foreground colors
{keyEscape, '[', '3', '0', 'm'},
{keyEscape, '[', '3', '1', 'm'},
{keyEscape, '[', '3', '2', 'm'},
{keyEscape, '[', '3', '3', 'm'},
{keyEscape, '[', '3', '4', 'm'},
{keyEscape, '[', '3', '5', 'm'},
{keyEscape, '[', '3', '6', 'm'},
{keyEscape, '[', '3', '7', 'm'},
{keyEscape, '[', '9', '0', 'm'},
// Reset foreground color
{keyEscape, '[', '3', '9', 'm'},
// Bold
{keyEscape, '[', '1', 'm'},
// Italic
{keyEscape, '[', '3', 'm'},
// Underline
{keyEscape, '[', '4', 'm'},
// Reset bold (or doubly underline according to ECMA-48; fallback is code [22m)
// See https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters
{keyEscape, '[', '2', '1', 'm'},
// Normal intensity
{keyEscape, '[', '2', '2', 'm'},
// Reset italic
{keyEscape, '[', '2', '3', 'm'},
// Reset underline
{keyEscape, '[', '2', '4', 'm'},
// Reset all formatting
{keyEscape, '[', '0', 'm'},
}
// Clean escapes the UTF8 encoded string provided as input so it is safe to print on a unix terminal.
// It removes non printing characters and substitutes the vt100 escape character 0x1b with '^['.
func Clean(s string) string {
return replace(func(r rune) rune {
switch {
case r >= 32 && r != 127: // Values below 32 (and 127) are special non printing characters (i.e. DEL, ESC, carriage return).
return r
case r == '\n' || r == '\t': // Allow newlines and tabs.
return r
case r == rune(keyEscape):
// Start of a vt100 escape sequence. If not a color, we will
// substitute it with '^[' (this is how it is usually shown, i.e.
// in vim).
return -1
}
return -2
}, s)
}
func isStartOfColorCode(s string, i int) bool {
outer:
for _, code := range vt100EscapeCodes {
if i+len(code) > len(s) {
continue
}
for j, c := range code {
if s[i+j] != c {
continue outer
}
}
return true
}
return false
}
// replace returns a copy of the string s with all its characters modified
// according to the mapping function.
// If mapping returns -1, the character is substituted with the two character string `^[` (unless it is the start of a color code).
// If mapping returns any other negative value, the character is dropped from the string with no replacement.
// This function is copied from strings.Map, and is identical except for how -1 is handled (differences are marked).
func replace(mapping func(rune) rune, s string) string {
// In the worst case, the string can grow when mapped, making
// things unpleasant. But it's so rare we barge in assuming it's
// fine. It could also shrink but that falls out naturally.
// The output buffer b is initialized on demand, the first
// time a character differs.
var b []byte
// nbytes is the number of bytes encoded in b.
var nbytes int
for i, c := range s {
r := mapping(c)
if r == c {
continue
}
b = make([]byte, len(s)+utf8.UTFMax)
nbytes = copy(b, s[:i])
switch {
case r >= 0:
if r <= utf8.RuneSelf {
b[nbytes] = byte(r)
nbytes++
} else {
nbytes += utf8.EncodeRune(b[nbytes:], r)
}
case r == -1 && isStartOfColorCode(s, i):
// This branch is NOT part of strings.Map
// Allow color codes.
b[nbytes] = byte(c)
nbytes++
case r == -1:
// This else branch is NOT part of strings.Map
// Substitute escape code with ^[ to nullify it.
b[nbytes] = byte('^')
b[nbytes+1] = byte('[')
nbytes += 2
}
if c == utf8.RuneError {
// RuneError is the result of either decoding
// an invalid sequence or '\uFFFD'. Determine
// the correct number of bytes we need to advance.
_, w := utf8.DecodeRuneInString(s[i:])
i += w
} else {
i += utf8.RuneLen(c)
}
s = s[i:]
break
}
if b == nil {
return s
}
for i, c := range s {
r := mapping(c)
// common case
if (0 <= r && r <= utf8.RuneSelf) && nbytes < len(b) {
b[nbytes] = byte(r)
nbytes++
continue
}
// b is not big enough or r is not a ASCII rune.
// The isStartOfColorCode check is NOT part of strings.Map
switch {
case r >= 0:
if nbytes+utf8.UTFMax >= len(b) {
// Grow the buffer.
nb := make([]byte, 2*len(b))
copy(nb, b[:nbytes])
b = nb
}
nbytes += utf8.EncodeRune(b[nbytes:], r)
case r == -1 && isStartOfColorCode(s, i):
// This branch is NOT part of strings.Map
// Allow color codes.
b[nbytes] = byte(c)
nbytes++
case r == -1: // This else branch is NOT part of strings.Map, but mirrors the preceding if branch
if nbytes+2 >= len(b) {
// Grow the buffer.
nb := make([]byte, 2*len(b))
copy(nb, b[:nbytes])
b = nb
}
b[nbytes] = byte('^')
b[nbytes+1] = byte('[')
nbytes += 2
}
}
return string(b[:nbytes])
}
// CleanBytes is a wrapper around Clean to work on byte slices instead of strings.
func CleanBytes(p []byte) []byte {
return []byte(Clean(string(p)))
}
// Writer can be used to write data to the underlying io.Writer, while transparently sanitizing it.
// If an error occurs writing to a Writer, all subsequent writes will return the error.
// Note that the sanitization might alter the size of the actual data being written.
type Writer struct {
err error
io.Writer
}
// Write writes p to the underlying io.Writer, after sanitizing it.
// It returns n = len(p) on a successful write (regardless of how much data is written).
// This is because the escaping function might alter the actual dimension of the data, but the caller is interested
// in knowing how much of what they wanted to write was actually written. In case of errors it (conservatively) returns n=0
// and the error, and no other writes are possible.
func (w *Writer) Write(p []byte) (int, error) {
if w.err != nil {
return 0, w.err
}
_, err := w.Writer.Write(CleanBytes(p))
if err == nil {
return len(p), nil
}
w.err = err
return 0, err
}
| 28.514019 | 131 | 0.627827 |
0bd6c13221d629d1b30e9a7c02dc58adabe343a8 | 282 | js | JavaScript | local-tasks/lint.js | fluffynuts/gulp-nunit-runner | 989267833a1f724de480205447e9e611c65df5c4 | [
"MIT"
] | null | null | null | local-tasks/lint.js | fluffynuts/gulp-nunit-runner | 989267833a1f724de480205447e9e611c65df5c4 | [
"MIT"
] | null | null | null | local-tasks/lint.js | fluffynuts/gulp-nunit-runner | 989267833a1f724de480205447e9e611c65df5c4 | [
"MIT"
] | null | null | null | const
gulp = requireModule("gulp"),
jshint = require("gulp-jshint"),
filter = require("gulp-filter");
gulp.task('lint', function () {
return gulp.src('**/*.js')
.pipe(filter(['*', '!node_modules/**/*']))
.pipe(jshint({node: true}))
.pipe(jshint.reporter('default'));
});
| 23.5 | 44 | 0.609929 |
cdd6810d4ee5e2169ff751de2bae04b09e649391 | 317 | sql | SQL | dm/tests/incremental_mode/data/db1.prepare.sql | sdojjy/tiflow | 98fbefd36966e8b3ffd98fd2bf7299317a326931 | [
"Apache-2.0"
] | 50 | 2021-12-18T06:20:42.000Z | 2022-03-28T11:31:43.000Z | dm/tests/incremental_mode/data/db1.prepare.sql | sdojjy/tiflow | 98fbefd36966e8b3ffd98fd2bf7299317a326931 | [
"Apache-2.0"
] | 1,411 | 2021-12-17T12:18:12.000Z | 2022-03-31T16:53:40.000Z | dm/tests/incremental_mode/data/db1.prepare.sql | sdojjy/tiflow | 98fbefd36966e8b3ffd98fd2bf7299317a326931 | [
"Apache-2.0"
] | 39 | 2021-12-19T16:22:37.000Z | 2022-03-31T08:18:00.000Z | /* Should not add reset master in this file because it is used by binlog 999999 test */
drop database if exists `incremental_mode`;
create database `incremental_mode`;
use `incremental_mode`;
create table t1 (id int, name varchar(20), primary key(`id`));
insert into t1 (id, name) values (1, 'arya'), (2, 'catelyn');
| 45.285714 | 87 | 0.728707 |
d952e29e75f87b07e5eebc796e96d977037f386c | 360 | rs | Rust | parser/tests/utils/mod.rs | rfdonnelly/sequence-rs | 9709af78dfde867810b132de4a3d4fa0e0b0c68f | [
"Apache-2.0",
"MIT"
] | null | null | null | parser/tests/utils/mod.rs | rfdonnelly/sequence-rs | 9709af78dfde867810b132de4a3d4fa0e0b0c68f | [
"Apache-2.0",
"MIT"
] | null | null | null | parser/tests/utils/mod.rs | rfdonnelly/sequence-rs | 9709af78dfde867810b132de4a3d4fa0e0b0c68f | [
"Apache-2.0",
"MIT"
] | null | null | null | #[allow(dead_code)]
pub fn parse(s: &str) -> String {
let parser = ::rvs_parser::Parser::new(Default::default());
format!("{:?}", parser.parse(s).unwrap())
}
#[allow(dead_code)]
pub fn parse_result(s: &str) -> Result<(), ::rvs_parser::error::Error> {
let parser = ::rvs_parser::Parser::new(Default::default());
parser.parse(s)?;
Ok(())
}
| 25.714286 | 72 | 0.602778 |
d59e0cbc2905e959338268b3cec6a4b2df401cdc | 5,205 | sql | SQL | apps/dolibarr/htdocs/install/mysql/data/llx_c_chargesociales.sql | verotribb/Dolibarr-Tesis | 7b855647b1a5802b173cfd869e3564b3fe34e123 | [
"Apache-2.0"
] | null | null | null | apps/dolibarr/htdocs/install/mysql/data/llx_c_chargesociales.sql | verotribb/Dolibarr-Tesis | 7b855647b1a5802b173cfd869e3564b3fe34e123 | [
"Apache-2.0"
] | 2 | 2020-07-18T14:04:27.000Z | 2021-05-10T17:34:59.000Z | apps/dolibarr/htdocs/install/mysql/data/llx_c_chargesociales.sql | verotribb/Dolibarr-Tesis | 7b855647b1a5802b173cfd869e3564b3fe34e123 | [
"Apache-2.0"
] | null | null | null | -- Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
-- Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
-- Copyright (C) 2004 Guillaume Delecourt <guillaume.delecourt@opensides.be>
-- Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com>
-- Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
--
--
-- Ne pas placer de commentaire en fin de ligne, ce fichier est parsé lors
-- de l'install et tous les sigles '--' sont supprimés.
--
--
-- Types de charges
--
--
-- France
--
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values ( 1, 'Allocations familiales', 1,1,'TAXFAM' ,'1');
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values ( 2, 'CSG Deductible', 1,1,'TAXCSGD' ,'1');
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values ( 3, 'CSG/CRDS NON Deductible',0,1,'TAXCSGND' ,'1');
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values ( 10, 'Taxe apprentissage', 0,1,'TAXAPP' ,'1');
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values ( 11, 'Taxe professionnelle', 0,1,'TAXPRO' ,'1');
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values ( 12, 'Cotisation fonciere des entreprises', 0,1,'TAXCFE' ,'1');
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values ( 13, 'Cotisation sur la valeur ajoutee des entreprises', 0,1,'TAXCVAE' ,'1');
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values ( 20, 'Impots locaux/fonciers', 0,1,'TAXFON' ,'1');
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values ( 25, 'Impots revenus', 0,1,'TAXREV' ,'1');
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values ( 30, 'Assurance Sante', 0,1,'TAXSECU' ,'1');
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values ( 40, 'Mutuelle', 0,1,'TAXMUT' ,'1');
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values ( 50, 'Assurance vieillesse', 0,1,'TAXRET' ,'1');
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values ( 60, 'Assurance Chomage', 0,1,'TAXCHOM' ,'1');
--
-- Belgique
--
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values (201, 'ONSS', 1,1,'TAXBEONSS' ,'2');
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values (210, 'Precompte professionnel', 1,1,'TAXBEPREPRO' ,'2');
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values (220, 'Prime existence', 1,1,'TAXBEPRIEXI' ,'2');
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values (230, 'Precompte immobilier', 1,1,'TAXBEPREIMMO','2');
--
-- Austria
--
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values (4101, 'Krankenversicherung', 1,1,'TAXATKV' ,'41');
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values (4102, 'Unfallversicherung', 1,1,'TAXATUV' ,'41');
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values (4103, 'Pensionsversicherung', 1,1,'TAXATPV' ,'41');
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values (4104, 'Arbeitslosenversicherung', 1,1,'TAXATAV' ,'41');
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values (4105, 'Insolvenzentgeltsicherungsfond', 1,1,'TAXATIESG' ,'41');
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values (4106, 'Wohnbauförderung', 1,1,'TAXATWF' ,'41');
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values (4107, 'Arbeiterkammerumlage', 1,1,'TAXATAK' ,'41');
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values (4108, 'Mitarbeitervorsorgekasse', 1,1,'TAXATMVK' ,'41');
insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values (4109, 'Familienlastenausgleichsfond', 1,1,'TAXATFLAF' ,'41');
| 74.357143 | 167 | 0.715082 |
4774543fc84a8165fb1a9c167a10792a9f73c3b7 | 3,585 | html | HTML | src/main/resources/templates/reception/echo/index.html | liuyouth/server-api | 1985e8380136cbe603d56be1f465c34332f7283e | [
"Apache-2.0"
] | null | null | null | src/main/resources/templates/reception/echo/index.html | liuyouth/server-api | 1985e8380136cbe603d56be1f465c34332f7283e | [
"Apache-2.0"
] | null | null | null | src/main/resources/templates/reception/echo/index.html | liuyouth/server-api | 1985e8380136cbe603d56be1f465c34332f7283e | [
"Apache-2.0"
] | null | null | null | <!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.springframework.org/schema/data/jaxb">
<head>
<title>Echo Music API | iolll.com</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="yes" name="apple-touch-fullscreen">
<meta content="telephone=no" name="format-detection">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<meta property="wb:webmaster" content="c51923015ca19eb1">
<meta name="author" content="m.life.iolll.com">
<meta name="copyright" content="Copyright ©m.life.iolll.com 版权所有">
<meta name="revisit-after" content="1 days">
<meta name="keywords" content="">
<meta name="description" content="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- <link rel="stylesheet" href="css/lib/swiper-3.3.1.min.css"> -->
<link rel="stylesheet" th:href="@{/css/phone.css}">
<link rel="stylesheet" href="./css/commodity.css">
<link rel="stylesheet" th:href="@{/css/backcolor.css}">
<link href="https://cdn.bootcss.com/photoswipe/4.1.2/photoswipe.css" rel="stylesheet">
<link href="https://cdn.bootcss.com/photoswipe/4.1.2/default-skin/default-skin.css" rel="stylesheet">
<style type="text/css">
*{
padding: 0;
margin: 0;
font-family: "微软雅黑";
}
</style>
</head>
<body>
<div id="header" class="header">
<div style="width:80%;float:left;">
<span class="logo"> nice Some </span>
</div>
<div style="line-height: 51px;">
<svg t="1523967334645" class="icon" style="width: 2em; height: 2em;vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2470" data-spm-anchor-id="a313x.7781069.0.i0"><path d="M896 42.666667H128C91.733333 42.666667 64 70.4 64 106.666667v810.666666c0 36.266667 27.733333 64 64 64h768c36.266667 0 64-27.733333 64-64V106.666667c0-36.266667-27.733333-64-64-64z m21.333333 874.666666c0 12.8-8.533333 21.333333-21.333333 21.333334H128c-12.8 0-21.333333-8.533333-21.333333-21.333334V106.666667c0-12.8 8.533333-21.333333 21.333333-21.333334h768c12.8 0 21.333333 8.533333 21.333333 21.333334v810.666666z m-160-640c-29.866667 0-53.333333 23.466667-53.333333 53.333334 0 17.066667 8.533333 32 21.333333 42.666666 0 87.466667-119.466667 160-213.333333 160s-213.333333-72.533333-213.333333-160c12.8-10.666667 21.333333-25.6 21.333333-42.666666 0-29.866667-23.466667-53.333333-53.333333-53.333334S213.333333 300.8 213.333333 330.666667c0 25.6 19.2 46.933333 42.666667 53.333333 8.533333 106.666667 140.8 192 256 192s247.466667-85.333333 256-192c25.6-4.266667 42.666667-25.6 42.666667-53.333333 0-29.866667-23.466667-53.333333-53.333334-53.333334z" fill="#ff5676" p-id="2471"></path></svg>
</div>
</div>
</div>
<div style="text-align:center;clear:both">
</div>
<div>
<div><input id="searchInput" placeholder="搜索id或者歌曲名字"></div>
<div>搜索结果区域</div>
<div>空区域(添加数据)</div>
</div>
<div class="clear"></div>
<div id="appList"></div>
</div>
<div class="footer"></div>
<script src="js/lib/jquery-2.1.1.min.js"></script>
<script src="js/lib/jquery.gradientify.min.js"></script>
<script src="js/lib/swiper-3.3.1.jquery.min.js"></script>
<script src="js/lib/jquery.nicescroll.js"></script>
<script src="js/lib/vue.js"></script>
<script type="text/javascript">
$(function(){
})
</script>
</body>
</html>
| 48.445946 | 1,268 | 0.682008 |
d5b18d54d787a71d88dbcd742ad937fcb1f146fe | 992 | h | C | PlayerSource/View/KJPlayerButton.h | yangKJ/KJPlayerDemo | 4d28d133a23d8dbf30ed50dc510a1bac7405ffb0 | [
"MIT"
] | 198 | 2019-07-22T07:04:17.000Z | 2022-03-29T01:36:15.000Z | PlayerSource/View/KJPlayerButton.h | yangKJ/KJPlayerDemo | 4d28d133a23d8dbf30ed50dc510a1bac7405ffb0 | [
"MIT"
] | 9 | 2019-10-15T02:53:46.000Z | 2022-03-17T05:27:13.000Z | PlayerSource/View/KJPlayerButton.h | yangKJ/KJPlayerDemo | 4d28d133a23d8dbf30ed50dc510a1bac7405ffb0 | [
"MIT"
] | 46 | 2019-07-26T04:00:06.000Z | 2022-03-24T07:58:45.000Z | //
// KJPlayerButton.h
// KJPlayerDemo
//
// Created by 杨科军 on 2021/2/21.
// Copyright © 2021 杨科军. All rights reserved.
// https://github.com/yangKJ/KJPlayerDemo
#import <UIKit/UIKit.h>
#import "KJRotateManager.h"
NS_ASSUME_NONNULL_BEGIN
/// 按钮类型
typedef NS_ENUM(NSUInteger, KJPlayerButtonType) {
KJPlayerButtonTypeBack = 0,/// 返回按钮
KJPlayerButtonTypeLock = 1,/// 锁屏按钮
KJPlayerButtonTypeCenterPlay = 2,/// 中间播放按钮
};
/// 播放按钮状态
typedef NS_ENUM(NSUInteger, KJPlayerPlayButtonType) {
KJPlayerPlayButtonTypePlaying,/// 播放中
KJPlayerPlayButtonTypePausing,/// 暂停
KJPlayerPlayButtonTypeReplay, /// 播放结束,重播
};
@interface KJPlayerButton : UIButton
/// 主色调
@property (nonatomic,strong) UIColor *mainColor;
/// 按钮类型
@property (nonatomic,assign) KJPlayerButtonType type;
/// 中间播放按钮状态
@property (nonatomic,assign) KJPlayerPlayButtonType playType;
/// 是否为锁屏状态
@property (nonatomic,assign) BOOL isLocked;
/// 隐藏锁屏按钮
- (void)kj_hiddenLockButton;
@end
NS_ASSUME_NONNULL_END
| 24.195122 | 61 | 0.742944 |
7ae60c3a41a964e094a7dae73cc268dc8efb903f | 16,723 | rs | Rust | powerpc/src/instruction/instruction_tests.rs | mvanbem/decompiler | 1dbdcab54103eb72a845318f1cc2b472fae4a4ae | [
"MIT"
] | null | null | null | powerpc/src/instruction/instruction_tests.rs | mvanbem/decompiler | 1dbdcab54103eb72a845318f1cc2b472fae4a4ae | [
"MIT"
] | null | null | null | powerpc/src/instruction/instruction_tests.rs | mvanbem/decompiler | 1dbdcab54103eb72a845318f1cc2b472fae4a4ae | [
"MIT"
] | null | null | null | use crate::EncodedInstruction;
const TABLE: &[(u32, &str)] = &[
//
// === CMPLI (CMPLWI) ===
// Opcode 10
//
// - all zeros
(0b001010_000_0_0_00000_0000000000000000, "cmplwi r0, 0"),
// - unsigned immediate
(0b001010_000_0_0_00000_1111111111111111, "cmplwi r0, 0xffff"),
// - register A
(0b001010_000_0_0_11111_0000000000000000, "cmplwi r31, 0"),
// - L flag
(0b001010_000_0_1_00000_0000000000000000, "FAIL"),
// - reserved bit 9
(0b001010_000_1_0_00000_0000000000000000, "FAIL"),
// - condition register field D
(0b001010_111_0_0_00000_0000000000000000, "cmplwi cr7, r0, 0"),
// - all ones
(
0b001010_111_0_0_11111_1111111111111111,
"cmplwi cr7, r31, 0xffff",
),
//
// === CMPI (CMPWI) ===
// Opcode 11
//
// - all zeros
(0b001011_000_0_0_00000_0000000000000000, "cmpwi r0, 0"),
// - signed immediate
(0b001011_000_0_0_00000_1111111111111111, "cmpwi r0, -1"),
// - register A
(0b001011_000_0_0_11111_0000000000000000, "cmpwi r31, 0"),
// - L flag
(0b001011_000_0_1_00000_0000000000000000, "FAIL"),
// - reserved bit 9
(0b001011_000_1_0_00000_0000000000000000, "FAIL"),
// - condition register field D
(0b001011_111_0_0_00000_0000000000000000, "cmpwi cr7, r0, 0"),
// - all ones
(
0b001011_111_0_0_11111_1111111111111111,
"cmpwi cr7, r31, -1",
),
//
// === ADDI (LI) ===
// Opcode 14
//
// - all zeros
(0b001110_00000_00000_0000000000000000, "li r0, 0"),
// - signed immediate
(0b001110_00000_00000_1111111111111111, "li r0, -1"),
// - register A
(0b001110_00000_11111_0000000000000000, "addi r0, r31, 0"),
// - register D
(0b001110_11111_00000_0000000000000000, "li r31, 0"),
// - all ones
(0b001110_11111_11111_1111111111111111, "addi r31, r31, -1"),
//
// === ADDIS ===
// Opcode 15
//
// - all zeros
(0b001111_00000_00000_0000000000000000, "addis r0, 0, 0"),
// - signed immediate
(0b001111_00000_00000_1111111111111111, "addis r0, 0, -1"),
// - register A
(0b001111_00000_11111_0000000000000000, "addis r0, r31, 0"),
// - register D
(0b001111_11111_00000_0000000000000000, "addis r31, 0, 0"),
// - all ones
(0b001111_11111_11111_1111111111111111, "addis r31, r31, -1"),
//
// === BCx ===
// Opcode 16
//
// - all zeros
(0b010000_00000_00000_00000000000000_0_0, "bdnznl 0x08000000"),
// - link flag
(
0b010000_00000_00000_00000000000000_0_1,
"bdnznll 0x08000000",
),
// - absolute flag
(
0b010000_00000_00000_00000000000000_1_0,
"bdnznla 0x00000000",
),
// - target address
(0b010000_00000_00000_11111111111111_0_0, "bdnznl 0x07fffffc"),
// - BI operand, condition
(0b010000_00000_00011_00000000000000_0_0, "bdnzns 0x08000000"),
// - BI operand, condition register field
(
0b010000_00000_11100_00000000000000_0_0,
"bdnznl cr7, 0x08000000",
),
// - BO operand
(0b010000_11111_00000_00000000000000_0_0, "b 0x08000000"),
// - all ones
(0b010000_11111_11111_11111111111111_1_1, "bla 0xfffffffc"),
// - all eight simple conditional branches
(0b010000_01100_00000_00010000000000_0_0, "blt 0x08001000"),
(0b010000_01100_00001_00010000000000_0_0, "bgt 0x08001000"),
(0b010000_01100_00010_00010000000000_0_0, "beq 0x08001000"),
(0b010000_01100_00011_00010000000000_0_0, "bso 0x08001000"),
(0b010000_00100_00000_00010000000000_0_0, "bnl 0x08001000"),
(0b010000_00100_00001_00010000000000_0_0, "bng 0x08001000"),
(0b010000_00100_00010_00010000000000_0_0, "bne 0x08001000"),
(0b010000_00100_00011_00010000000000_0_0, "bns 0x08001000"),
// - use every feature
(
0b010000_01000_10110_00010010001101_1_1,
"bdnzeqla cr5, 0x00001234",
),
//
// === Bx ===
// Opcode 18
//
// - all zeros
(0b010010_000000000000000000000000_0_0, "b 0x08000000"),
// - link flag
(0b010010_000000000000000000000000_0_1, "bl 0x08000000"),
// - absolute flag
(0b010010_000000000000000000000000_1_0, "ba 0x00000000"),
// - target address
(0b010010_111111111111111111111111_0_0, "b 0x07fffffc"),
// - all ones
(0b010010_111111111111111111111111_1_1, "bla 0xfffffffc"),
//
// === BCLRx ===
// Opcode 19
// Extended opcode 16
//
// - all zeros
(0b010011_00000_00000_00000_0000010000_0, "bdnznllr"),
// - link flag
(0b010011_00000_00000_00000_0000010000_1, "bdnznllrl"),
// reserved bits 16..=20
(0b010011_00000_00000_00001_0000010000_1, "FAIL"),
(0b010011_00000_00000_00010_0000010000_1, "FAIL"),
(0b010011_00000_00000_00100_0000010000_1, "FAIL"),
(0b010011_00000_00000_01000_0000010000_1, "FAIL"),
(0b010011_00000_00000_10000_0000010000_1, "FAIL"),
// - BI operand, condition
(0b010011_00000_00011_00000_0000010000_0, "bdnznslr"),
// - BI operand, condition register field
(0b010011_00000_11100_00000_0000010000_0, "bdnznllr cr7"),
// - BO operand
(0b010011_11111_00000_00000_0000010000_0, "blr"),
// - all ones
(0b010011_11111_11111_00000_0000010000_1, "blrl"),
// - all eight simple conditional branches
(0b010011_01100_00000_00000_0000010000_0, "bltlr"),
(0b010011_01100_00001_00000_0000010000_0, "bgtlr"),
(0b010011_01100_00010_00000_0000010000_0, "beqlr"),
(0b010011_01100_00011_00000_0000010000_0, "bsolr"),
(0b010011_00100_00000_00000_0000010000_0, "bnllr"),
(0b010011_00100_00001_00000_0000010000_0, "bnglr"),
(0b010011_00100_00010_00000_0000010000_0, "bnelr"),
(0b010011_00100_00011_00000_0000010000_0, "bnslr"),
// - use every feature
(0b010011_01000_10110_00000_0000010000_1, "bdnzeqlrl cr5"),
//
// === CRXOR ===
// Opcode 19
// Extended opcode 193
//
// - all zeros
(0b010011_00000_00000_00000_0011000001_0, "crxor lt, lt, lt"),
// - reserved bit 31
(0b010011_00000_00000_00000_0011000001_1, "FAIL"),
// - crbB operand
(
0b010011_00000_00000_11111_0011000001_0,
"crxor lt, lt, cr7*4+so",
),
// - crbA operand
(
0b010011_00000_11111_00000_0011000001_0,
"crxor lt, cr7*4+so, lt",
),
// - crbD operand
(
0b010011_11111_00000_00000_0011000001_0,
"crxor cr7*4+so, lt, lt",
),
// - all ones
(
0b010011_11111_11111_11111_0011000001_0,
"crxor cr7*4+so, cr7*4+so, cr7*4+so",
),
//
// === RLWINM ===
// Opcode 21
//
// - all zeros
(
0b010101_00000_00000_00000_00000_00000_0,
"rlwinm r0, r0, 0, 0, 0",
),
// - record bit
(
0b010101_00000_00000_00000_00000_00000_1,
"rlwinm. r0, r0, 0, 0, 0",
),
// - ME operand
(
0b010101_00000_00000_00000_00000_11111_0,
"rlwinm r0, r0, 0, 0, 31",
),
// - MB operand
(
0b010101_00000_00000_00000_11111_00000_0,
"rlwinm r0, r0, 0, 31, 0",
),
// - SH operand
(
0b010101_00000_00000_11111_00000_00000_0,
"rlwinm r0, r0, 31, 0, 0",
),
// - A register
(
0b010101_00000_11111_00000_00000_00000_0,
"rlwinm r31, r0, 0, 0, 0",
),
// - S register
(
0b010101_11111_00000_00000_00000_00000_0,
"rlwinm r0, r31, 0, 0, 0",
),
// - all ones
(
0b010101_11111_11111_11111_11111_11111_1,
"rlwinm. r31, r31, 31, 31, 31",
),
//
// === CMPL (CMPLW) ===
// Opcode 31
// Extended opcode 32
//
// - all zeros
(0b011111_000_0_0_00000_00000_0000100000_0, "cmplw r0, r0"),
// - reserved bit 31
(0b011111_000_0_0_00000_00000_0000100000_1, "FAIL"),
// - register B
(0b011111_000_0_0_00000_11111_0000100000_0, "cmplw r0, r31"),
// - register A
(0b011111_000_0_0_11111_00000_0000100000_0, "cmplw r31, r0"),
// - L flag
(0b011111_000_0_1_00000_00000_0000100000_0, "FAIL"),
// - reserved bit 9
(0b011111_000_1_0_00000_00000_0000100000_0, "FAIL"),
// - condition register field D
(
0b011111_111_0_0_00000_00000_0000100000_0,
"cmplw cr7, r0, r0",
),
// - all ones
(
0b011111_111_0_0_11111_11111_0000100000_0,
"cmplw cr7, r31, r31",
),
//
// === ADDZE ===
// Opcode 31
// Extended opcode 202
//
// - all zeros
(0b011111_00000_00000_00000_0_011001010_0, "addze r0, r0"),
// - record bit
(0b011111_00000_00000_00000_0_011001010_1, "addze. r0, r0"),
// - OE operand
(0b011111_00000_00000_00000_1_011001010_0, "addzeo r0, r0"),
// - reserved bits 16..20
(0b011111_00000_00000_00001_0_011001010_0, "FAIL"),
(0b011111_00000_00000_00010_0_011001010_0, "FAIL"),
(0b011111_00000_00000_00100_0_011001010_0, "FAIL"),
(0b011111_00000_00000_01000_0_011001010_0, "FAIL"),
(0b011111_00000_00000_10000_0_011001010_0, "FAIL"),
// - register A
(0b011111_00000_11111_00000_0_011001010_0, "addze r0, r31"),
// - register D
(0b011111_11111_00000_00000_0_011001010_0, "addze r31, r0"),
// - all ones
(0b011111_11111_11111_00000_1_011001010_1, "addzeo. r31, r31"),
//
// === MFSPR ===
// Opcode 31
// Extended opcode 339
//
// - all variants with r0
(0b011111_00000_00001_00000_0101010011_0, "mfxer r0"),
(0b011111_00000_01000_00000_0101010011_0, "mflr r0"),
(0b011111_00000_01001_00000_0101010011_0, "mfctr r0"),
(0b011111_00000_10001_11100_0101010011_0, "mfgqr1 r0"),
(0b011111_00000_10010_11100_0101010011_0, "mfgqr2 r0"),
(0b011111_00000_10011_11100_0101010011_0, "mfgqr3 r0"),
(0b011111_00000_10100_11100_0101010011_0, "mfgqr4 r0"),
(0b011111_00000_10101_11100_0101010011_0, "mfgqr5 r0"),
(0b011111_00000_10110_11100_0101010011_0, "mfgqr6 r0"),
(0b011111_00000_10111_11100_0101010011_0, "mfgqr7 r0"),
// - reserved bit 31
(0b011111_00000_00001_00000_0101010011_1, "FAIL"),
// - register D
(0b011111_11111_00001_00000_0101010011_0, "mfxer r31"),
// - spr operand, illegal value
(0b011111_00000_00000_00000_0101010011_0, "FAIL"),
(0b011111_00000_00001_00001_0101010011_0, "FAIL"),
//
// === OR (MR) ===
// Opcode 31
// Extended opcode 444
//
// - all zeros
(0b011111_00000_00000_00000_0110111100_0, "mr r0, r0"),
// - record bit
(0b011111_00000_00000_00000_0110111100_1, "mr. r0, r0"),
// - register B
(0b011111_00000_00000_11111_0110111100_0, "or r0, r0, r31"),
// - register A
(0b011111_00000_11111_00000_0110111100_0, "mr r31, r0"),
// - register S
(0b011111_11111_00000_00000_0110111100_0, "or r0, r31, r0"),
// - use every feature, S = B
(0b011111_00010_00001_00010_0110111100_1, "mr. r1, r2"),
// - use every feature, S != B
(0b011111_00010_00001_00011_0110111100_1, "or. r1, r2, r3"),
//
// === MTSPR ===
// Opcode 31
// Extended opcode 467
//
// - all variants with r0
(0b011111_00000_00001_00000_0111010011_0, "mtxer r0"),
(0b011111_00000_01000_00000_0111010011_0, "mtlr r0"),
(0b011111_00000_01001_00000_0111010011_0, "mtctr r0"),
// - reserved bit 31
(0b011111_00000_00001_00000_0111010011_1, "FAIL"),
// - register D
(0b011111_11111_00001_00000_0111010011_0, "mtxer r31"),
// - spr operand, illegal value
(0b011111_00000_00000_00000_0111010011_0, "FAIL"),
(0b011111_00000_00001_00001_0111010011_0, "FAIL"),
//
// === SRAWI ===
// Opcode 31
// Extended opcode 824
//
// - all zeros
(0b011111_00000_00000_00000_1100111000_0, "srawi r0, r0, 0"),
// - record bit
(0b011111_00000_00000_00000_1100111000_1, "srawi. r0, r0, 0"),
// - shift amount
(0b011111_00000_00000_11111_1100111000_0, "srawi r0, r0, 31"),
// - register A
(0b011111_00000_11111_00000_1100111000_0, "srawi r31, r0, 0"),
// - register S
(0b011111_11111_00000_00000_1100111000_0, "srawi r0, r31, 0"),
// - all ones
(
0b011111_11111_11111_11111_1100111000_1,
"srawi. r31, r31, 31",
),
//
// === LWZ ===
// Opcode 32
//
// - all zeros
(0b100000_00000_00000_0000000000000000, "lwz r0, (0)"),
// - signed immediate
(0b100000_00000_00000_1111111111111111, "lwz r0, -1(0)"),
// - register A
(0b100000_00000_11111_0000000000000000, "lwz r0, (r31)"),
// - register D
(0b100000_11111_00000_0000000000000000, "lwz r31, (0)"),
// - all ones
(0b100000_11111_11111_1111111111111111, "lwz r31, -1(r31)"),
//
// === LBZ ===
// Opcode 34
//
// - all zeros
(0b100010_00000_00000_0000000000000000, "lbz r0, (0)"),
// - signed immediate
(0b100010_00000_00000_1111111111111111, "lbz r0, -1(0)"),
// - register A
(0b100010_00000_11111_0000000000000000, "lbz r0, (r31)"),
// - register D
(0b100010_11111_00000_0000000000000000, "lbz r31, (0)"),
// - all ones
(0b100010_11111_11111_1111111111111111, "lbz r31, -1(r31)"),
//
// === STW ===
// Opcode 36
//
// - all zeros
(0b100100_00000_00000_0000000000000000, "stw r0, (0)"),
// - signed immediate
(0b100100_00000_00000_1111111111111111, "stw r0, -1(0)"),
// - register A
(0b100100_00000_11111_0000000000000000, "stw r0, (r31)"),
// - register S
(0b100100_11111_00000_0000000000000000, "stw r31, (0)"),
// - all ones
(0b100100_11111_11111_1111111111111111, "stw r31, -1(r31)"),
//
// === STWU ===
// Opcode 37
//
// - all zeros
(0b100101_00000_00001_0000000000000000, "stwu r0, (r1)"),
// - signed immediate
(0b100101_00000_00001_1111111111111111, "stwu r0, -1(r1)"),
// - register A
(0b100101_00000_11111_0000000000000000, "stwu r0, (r31)"),
// - register A, illegal value
(0b100101_00000_00000_0000000000000000, "FAIL"),
// - register S
(0b100101_11111_00001_0000000000000000, "stwu r31, (r1)"),
// - all ones
(0b100101_11111_11111_1111111111111111, "stwu r31, -1(r31)"),
//
// === LHA ===
// Opcode 42
//
// - all zeros
(0b101010_00000_00000_0000000000000000, "lha r0, (0)"),
// - signed immediate
(0b101010_00000_00000_1111111111111111, "lha r0, -1(0)"),
// - register A
(0b101010_00000_11111_0000000000000000, "lha r0, (r31)"),
// - register D
(0b101010_11111_00000_0000000000000000, "lha r31, (0)"),
// - all ones
(0b101010_11111_11111_1111111111111111, "lha r31, -1(r31)"),
//
// === STMW ===
// Opcode 47
//
// - all zeros
(0b101111_00000_00000_0000000000000000, "stmw r0, (0)"),
// - signed immediate
(0b101111_00000_00000_1111111111111111, "stmw r0, -1(0)"),
// - register A
(0b101111_00000_11111_0000000000000000, "stmw r0, (r31)"),
// - register S
(0b101111_11111_00000_0000000000000000, "stmw r31, (0)"),
// - all ones
(0b101111_11111_11111_1111111111111111, "stmw r31, -1(r31)"),
];
#[test]
fn to_assembly() {
let mut any_errors = false;
for row in TABLE {
let (decoded, expected_assembly) =
match (EncodedInstruction(row.0).parse(0x08000000), row.1) {
(Ok(decoded), "FAIL") => {
// Unexpected success.
any_errors = true;
eprintln!(
"unexpected success parsing 0b{:032b}. result: {:?}",
row.0, decoded,
);
continue;
}
(Ok(decoded), expected_assembly) => {
// Expected success.
(decoded, expected_assembly)
}
(Err(_), "FAIL") => {
// Expected failure.
continue;
}
(Err(e), expected_assembly) => {
// Unexpected failure
any_errors = true;
eprintln!(
"failed to parse 0b{:032b} (was expecting {:?}): {}",
row.0, expected_assembly, e
);
continue;
}
};
let assembly = format!("{}", decoded);
if assembly != expected_assembly {
any_errors = true;
eprintln!(
"assembly for 0b{:032b}, {:?}: want {:?}, but got {:?}",
row.0, decoded, expected_assembly, assembly,
);
continue;
}
}
if any_errors {
panic!("one or more table test cases failed");
}
}
| 33.180556 | 77 | 0.619207 |
6501e436cf727b0f646b61fcf716e2f64d47d65c | 1,131 | py | Python | hai_tests/test_event_emitter.py | valohai/hai | f49c4eae2eb74b1738699e32b4b2aeb0f4d922dd | [
"MIT"
] | 2 | 2018-10-03T11:13:06.000Z | 2020-08-07T12:44:22.000Z | hai_tests/test_event_emitter.py | valohai/hai | f49c4eae2eb74b1738699e32b4b2aeb0f4d922dd | [
"MIT"
] | 16 | 2018-02-07T11:08:53.000Z | 2021-11-26T09:21:57.000Z | hai_tests/test_event_emitter.py | valohai/hai | f49c4eae2eb74b1738699e32b4b2aeb0f4d922dd | [
"MIT"
] | null | null | null | import pytest
from hai.event_emitter import EventEmitter
class Thing(EventEmitter):
event_types = {'one', 'two'}
@pytest.mark.parametrize('omni', (False, True))
def test_event_emitter(omni):
t = Thing()
events = []
def handle(sender, **args):
assert sender is t
events.append(args)
if omni:
t.on('*', handle)
else:
t.on('one', handle)
t.emit('one')
t.emit('two')
t.off('one', handle)
t.emit('one', {'oh': 'no'})
if omni:
assert events == [
{'event': 'one'},
{'event': 'two'},
{'event': 'one', 'oh': 'no'},
]
else:
assert events == [
{'event': 'one'},
]
def test_event_emitter_exceptions():
t = Thing()
def handle(**args):
raise OSError('oh no')
t.on('*', handle)
t.emit('one')
with pytest.raises(IOError):
t.emit('one', quiet=False)
def test_event_emitter_unknown_event_types():
t = Thing()
with pytest.raises(ValueError):
t.on('hullo', None)
with pytest.raises(ValueError):
t.emit('hello')
| 18.85 | 47 | 0.528736 |
cb995f329c005757a28e51fab6ce1a1ae261f937 | 3,732 | swift | Swift | OnionMobileClientDSL/DSLUI/DSLView.swift | shevakuilin/OnionMobileClientDSL | 796cb4c4c629cd3522c9d782f02efacbed237e4e | [
"MIT"
] | 1 | 2021-12-28T08:14:08.000Z | 2021-12-28T08:14:08.000Z | OnionMobileClientDSL/DSLUI/DSLView.swift | shevakuilin/OnionMobileClientDSL | 796cb4c4c629cd3522c9d782f02efacbed237e4e | [
"MIT"
] | null | null | null | OnionMobileClientDSL/DSLUI/DSLView.swift | shevakuilin/OnionMobileClientDSL | 796cb4c4c629cd3522c9d782f02efacbed237e4e | [
"MIT"
] | null | null | null | //
// DSLView.swift
// OnionMobileClientDSL
//
// 支持DSL的UIView控件
//
// Created by XIANG KUILIN on 2022/1/11.
//
import UIKit
import YC_YogaKit
class DSLView: UIView {
public var dataModel: OMCDData! // 数据模型
fileprivate var attributeSet: OMCDAttributeSet! // DSL属性集
override init(frame: CGRect) {
super.init(frame: frame)
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
/// 初始化元素
/// - Parameters: set DSL属性集
public func initElements(set: OMCDAttributeSet) {
// 保存DSL属性集
attributeSet = set
// 根据DSL属性集生成视图
setViewAttribute()
flexboxLayout()
bindAction()
bindData()
}
}
private extension DSLView {
/// 设置视图属性
private func setViewAttribute() {
self.backgroundColor = attributeSet.viewStyle.backgroundColor
self.alpha = CGFloat(attributeSet.viewStyle.alpha)
self.layer.borderColor = attributeSet.viewStyle.borderColor.cgColor
self.layer.borderWidth = CGFloat(attributeSet.viewStyle.borderWidth)
self.layer.masksToBounds = CGFloat(attributeSet.viewStyle.cornerRadius) > 0 ? true:false
self.layer.cornerRadius = CGFloat(attributeSet.viewStyle.cornerRadius)
}
/// 基于Flexbox进行布局
private func flexboxLayout() {
self.configureLayout { layout in
layout.isEnabled = true
layout.flexDirection = self.attributeSet.flexStyle.flexDirection
layout.justifyContent = self.attributeSet.flexStyle.justifyContent
layout.alignItems = self.attributeSet.flexStyle.alignItems
layout.alignSelf = self.attributeSet.flexStyle.alignSelf
layout.flexGrow = CGFloat(self.attributeSet.flexStyle.flexGrowFloat)
layout.flexShrink = CGFloat(self.attributeSet.flexStyle.flexShrinkFloat)
layout.flexBasis = self.attributeSet.flexStyle.flexBasisPercent
layout.display = self.attributeSet.flexStyle.display
layout.height = YGValue(self.attributeSet.container.layoutHeight["value"] as! CGFloat)
layout.width = YGValue(self.attributeSet.container.layoutWidth["value"] as! CGFloat)
}
self.yoga.applyLayout(preservingOrigin: false)
}
/// 绑定交互事件
private func bindAction() {
// 点击事件
if attributeSet.viewAction.action == "CLICK" {
self.isUserInteractionEnabled = true
let tap = UITapGestureRecognizer(target: self, action: #selector(clickAction))
self.addGestureRecognizer(tap)
} else if attributeSet.viewAction.action == "TOUCH_MOVE" {
self.isUserInteractionEnabled = true
let pan = UIPanGestureRecognizer(target: self, action: #selector(drag(sender:)))
self.addGestureRecognizer(pan)
}
}
/// 绑定数据
private func bindData() {
dataModel = attributeSet.data
}
}
private extension DSLView {
// 点击跳转
@objc
private func clickAction() {
let extra = attributeSet.viewAction.extra
guard let url: String = extra["url"] as? String else {
return
}
guard let theURL = URL(string: url) else {
return
}
// 模拟跳转到Safari
UIApplication.shared.open(theURL, options: [:], completionHandler: nil)
}
// 拖拽
@objc
private func drag(sender: UIPanGestureRecognizer) {
if sender.state == .changed {
let offset = sender.translation(in: self)
sender.view?.center = CGPoint(x: self.center.x + offset.x, y: self.center.y + offset.y)
sender.setTranslation(.zero, in: self)
}
}
}
| 32.736842 | 99 | 0.638264 |
7bde4b375a5340d914f6074a385113f5b4e05f48 | 1,374 | css | CSS | login/style.css | aoj4life/MR | 2e113c0c737356f958ae6911ba46718edb143148 | [
"MIT"
] | null | null | null | login/style.css | aoj4life/MR | 2e113c0c737356f958ae6911ba46718edb143148 | [
"MIT"
] | null | null | null | login/style.css | aoj4life/MR | 2e113c0c737356f958ae6911ba46718edb143148 | [
"MIT"
] | null | null | null |
body {
/*padding-top: 40px;
padding-bottom: 40px;*/
background-color: #eee;
}
.form-signin {
max-width: 470px;
padding: 15px;
margin: 0 auto;
}
.form-signin .form-signin-heading,
.form-signin .checkbox {
margin-bottom: 10px;
}
.form-signin .checkbox {
font-weight: normal;
}
.form-signin .form-control {
position: relative;
height: auto;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 10px;
font-size: 16px;
}
.form-signin .form-control:focus {
z-index: 2;
}
.form-signin input[type="email"] {
margin-bottom: -1px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.form-signin input[type="password"] {
margin-bottom: -1px;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
#error_msg{
width: 50%;
margin: 5px auto;
height: 30px;
border: 1px solid #ff0000;
background: #ffb9b8;
color: #ff0000;
text-align: center;
padding-top: 10px;
}
#error_msg{
width: 100%;
margin-top: 700px;
height: 50px;
border: 1px solid #ff0000;
border-radius: 10px;
background: #ffb9b8;
color: #000;
text-align: center;
padding-top: 10px;
}
#error_smsg{
width: 100%;
margin: auto;
height: 50px;
border: 1px solid #ff0000;
border-radius: 10px;
background: #99ff00;
color: #000;
text-align: center;
padding-top: 10px;
} | 17.392405 | 37 | 0.655022 |
11eee7839f26a68242471b3cdb81d4fb04551ae1 | 5,788 | kt | Kotlin | kotlinextensions/src/main/kotlin/com/extensions/binding/DimenBindings.kt | SimformSolutionsPvtLtd/Kotlin-Extensions | 211b47986e3a7993f85ca0a0ce9ff3141f3ae140 | [
"Apache-2.0"
] | 6 | 2018-08-06T04:16:59.000Z | 2021-07-02T01:17:44.000Z | kotlinextensions/src/main/kotlin/com/extensions/binding/DimenBindings.kt | Krunal-Kevadiya/Kotlin-Extension | 6b556c47887cd2ded327783b63a92f76aee5cffc | [
"Apache-2.0"
] | null | null | null | kotlinextensions/src/main/kotlin/com/extensions/binding/DimenBindings.kt | Krunal-Kevadiya/Kotlin-Extension | 6b556c47887cd2ded327783b63a92f76aee5cffc | [
"Apache-2.0"
] | 1 | 2018-08-06T04:17:29.000Z | 2018-08-06T04:17:29.000Z | package com.extensions.binding
import android.app.Activity
import android.app.Dialog
import android.app.Fragment
import android.content.Context
import android.support.annotation.DimenRes
import android.support.annotation.RestrictTo
import android.view.View
import com.extensions.binding.util.Optional
import com.extensions.binding.util.Required
import com.extensions.binding.util.contextProvider
import com.extensions.binding.util.getDimension
import com.extensions.binding.util.getSafeDimension
import kotlin.properties.ReadOnlyProperty
/**
* View
*/
fun View.dimen(@DimenRes dimenRes :Int, dimension :DimensionType = DimensionType.PX) :ReadOnlyProperty<View, Float> = requiredDimen(contextProvider, dimenRes, dimension)
fun View.dimenOptional(@DimenRes dimenRes :Int, dimension :DimensionType = DimensionType.PX) :ReadOnlyProperty<View, Float?> = optionalDimen(contextProvider, dimenRes, dimension)
fun View.dimens(@DimenRes vararg dimenRes :Int, dimension :DimensionType = DimensionType.PX) :ReadOnlyProperty<View, List<Float>> = requiredDimens(contextProvider, dimenRes, dimension)
fun View.dimensOptional(@DimenRes vararg dimenRes :Int, dimension :DimensionType = DimensionType.PX) :ReadOnlyProperty<View, List<Float?>> = optionalDimens(contextProvider, dimenRes, dimension)
/**
* Activity
*/
fun Activity.dimen(@DimenRes dimenRes :Int, dimension :DimensionType = DimensionType.PX) :ReadOnlyProperty<Activity, Float> = requiredDimen(contextProvider, dimenRes, dimension)
fun Activity.dimenOptional(@DimenRes dimenRes :Int, dimension :DimensionType = DimensionType.PX) :ReadOnlyProperty<Activity, Float?> = optionalDimen(contextProvider, dimenRes, dimension)
fun Activity.dimens(@DimenRes vararg dimenRes :Int, dimension :DimensionType = DimensionType.PX) :ReadOnlyProperty<Activity, List<Float>> = requiredDimens(contextProvider, dimenRes, dimension)
fun Activity.dimensOptional(@DimenRes vararg dimenRes :Int, dimension :DimensionType = DimensionType.PX) :ReadOnlyProperty<Activity, List<Float?>> = optionalDimens(contextProvider, dimenRes, dimension)
/**
* Fragment
*/
fun Fragment.dimen(@DimenRes dimenRes :Int, dimension :DimensionType = DimensionType.PX) :ReadOnlyProperty<Fragment, Float> = requiredDimen(contextProvider, dimenRes, dimension)
fun Fragment.dimenOptional(@DimenRes dimenRes :Int, dimension :DimensionType = DimensionType.PX) :ReadOnlyProperty<Fragment, Float?> = optionalDimen(contextProvider, dimenRes, dimension)
fun Fragment.dimens(@DimenRes vararg dimenRes :Int, dimension :DimensionType = DimensionType.PX) :ReadOnlyProperty<Fragment, List<Float>> = requiredDimens(contextProvider, dimenRes, dimension)
fun Fragment.dimensOptional(@DimenRes vararg dimenRes :Int, dimension :DimensionType = DimensionType.PX) :ReadOnlyProperty<Fragment, List<Float?>> = optionalDimens(contextProvider, dimenRes, dimension)
/**
* Dialog
*/
fun Dialog.dimen(@DimenRes dimenRes :Int, dimension :DimensionType = DimensionType.PX) :ReadOnlyProperty<Dialog, Float> = requiredDimen(contextProvider, dimenRes, dimension)
fun Dialog.dimenOptional(@DimenRes dimenRes :Int, dimension :DimensionType = DimensionType.PX) :ReadOnlyProperty<Dialog, Float?> = optionalDimen(contextProvider, dimenRes, dimension)
fun Dialog.dimens(@DimenRes vararg dimenRes :Int, dimension :DimensionType = DimensionType.PX) :ReadOnlyProperty<Dialog, List<Float>> = requiredDimens(contextProvider, dimenRes, dimension)
fun Dialog.dimensOptional(@DimenRes vararg dimenRes :Int, dimension :DimensionType = DimensionType.PX) :ReadOnlyProperty<Dialog, List<Float?>> = optionalDimens(contextProvider, dimenRes, dimension)
/**
* ContextProvider
*/
fun ContextProvider.dimen(@DimenRes dimenRes :Int, dimension :DimensionType = DimensionType.PX) :ReadOnlyProperty<ContextProvider, Float> = requiredDimen(this::provideContext, dimenRes, dimension)
fun ContextProvider.dimenOptional(@DimenRes dimenRes :Int, dimension :DimensionType = DimensionType.PX) :ReadOnlyProperty<ContextProvider, Float?> = optionalDimen(this::provideContext, dimenRes, dimension)
fun ContextProvider.dimens(@DimenRes vararg dimenRes :Int, dimension :DimensionType = DimensionType.PX) :ReadOnlyProperty<ContextProvider, List<Float>> = requiredDimens(this::provideContext, dimenRes, dimension)
fun ContextProvider.dimensOptional(@DimenRes vararg dimenRes :Int, dimension :DimensionType = DimensionType.PX) :ReadOnlyProperty<ContextProvider, List<Float?>> = optionalDimens(this::provideContext, dimenRes, dimension)
/**
* Getters
*/
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
inline fun <R> requiredDimen(crossinline contextProvider :() -> Context?,
@DimenRes dimenRes :Int,
dimension :DimensionType) :ReadOnlyProperty<R, Float> {
return Required {contextProvider()!!.getDimension(dimenRes, dimension)}
}
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
inline fun <R> optionalDimen(crossinline contextProvider :() -> Context?,
@DimenRes dimenRes :Int,
dimension :DimensionType) :ReadOnlyProperty<R, Float?> {
return Optional {contextProvider()!!.getSafeDimension(dimenRes, dimension)}
}
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
inline fun <R> requiredDimens(crossinline contextProvider :() -> Context?,
@DimenRes dimenRes :IntArray,
dimension :DimensionType) :ReadOnlyProperty<R, List<Float>> {
return Required {
val context = contextProvider()
dimenRes.map {id -> context!!.getDimension(id, dimension)}
}
}
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
inline fun <R> optionalDimens(crossinline contextProvider :() -> Context?,
@DimenRes dimenRes :IntArray,
dimension :DimensionType) :ReadOnlyProperty<R, List<Float?>> {
return Required {
val context = contextProvider()
dimenRes.map {id -> context!!.getSafeDimension(id, dimension)}
}
}
| 62.236559 | 220 | 0.793711 |
0bbc95b421ce089454bc123454b4e0ec603c3da3 | 1,143 | kt | Kotlin | app/src/main/java/com/arjanvlek/oxygenupdater/enums/Theme.kt | iGotYourBackMr/oxygen-updater | 884766371e62969831f2933ba790bbec4c2c1613 | [
"MIT"
] | null | null | null | app/src/main/java/com/arjanvlek/oxygenupdater/enums/Theme.kt | iGotYourBackMr/oxygen-updater | 884766371e62969831f2933ba790bbec4c2c1613 | [
"MIT"
] | null | null | null | app/src/main/java/com/arjanvlek/oxygenupdater/enums/Theme.kt | iGotYourBackMr/oxygen-updater | 884766371e62969831f2933ba790bbec4c2c1613 | [
"MIT"
] | null | null | null | package com.arjanvlek.oxygenupdater.enums
/**
* Integer values for app and OnePlus' system themes.
*
* OnePlus-specific themes are translated into app-specific themes by value.
*
* Note:<br></br>
* These integers are duplicated in `integers.xml` but are specified here to allow easy access and comparison throughout the app.
* Why: it's easier to do `Theme.LIGHT`, instead of `context.getResources().getInteger(R.integer.R.theme_light_value)`
*
* Read through the comments in `integers.xml` to understand why XML values are present as well
*
* @author [Adhiraj Singh Chauhan](https://github.com/adhirajsinghchauhan)
* @see ThemeUtils.OEM_BLACK_MODE
*/
internal enum class Theme(private val value: Int) {
LIGHT(0),
DARK(1),
SYSTEM(2),
AUTO(3);
companion object {
private val map = values().associateBy { it.value }
/**
* Returns a theme based on value. If value isn't between [0, 3], default to [SYSTEM]
*
* @param value the integer value
*
* @return [Theme]
*/
operator fun get(value: Int): Theme = map[value] ?: SYSTEM
}
}
| 30.891892 | 129 | 0.659668 |
5fc980d3612cf0982d0a140fdeb3b1036ad763d2 | 356 | h | C | PhilipsGoEasyLibrary.framework/Headers/PhilipsGerneralDefinition.h | iOSbug/PhilipsGoEasyLibrary | 0728b0eb8f2d5ac58804c06302bbf762ed7ca2f1 | [
"MIT"
] | null | null | null | PhilipsGoEasyLibrary.framework/Headers/PhilipsGerneralDefinition.h | iOSbug/PhilipsGoEasyLibrary | 0728b0eb8f2d5ac58804c06302bbf762ed7ca2f1 | [
"MIT"
] | null | null | null | PhilipsGoEasyLibrary.framework/Headers/PhilipsGerneralDefinition.h | iOSbug/PhilipsGoEasyLibrary | 0728b0eb8f2d5ac58804c06302bbf762ed7ca2f1 | [
"MIT"
] | null | null | null | //
// PHLGerneralDefinition.h
// PHLLibrary
//
// Created by Tianbao Wang on 2020/9/8.
// Copyright © 2020 Tianbao Wang. All rights reserved.
//
#ifndef PhilipsGerneralDefinition_h
#define PhilipsGerneralDefinition_h
#import "PhilipsCallbackResult.h"
typedef void (^CallbackHandler)(PhilipsCallbackResult *res);
#endif /* PHLGerneralDefinition_h */
| 22.25 | 60 | 0.766854 |
716c5f1ed388d1368b098c609b2baef9fbcf8b59 | 273 | sql | SQL | SQL Queries/OperationsManager/Alerts_ByRepeat.sql | v-bldrum/SCOM-Scripts-and-SQL | 55cbabc0d86b9709847fbb9f5322406b31596674 | [
"MIT"
] | 6 | 2020-10-28T14:45:53.000Z | 2021-05-21T16:41:56.000Z | SQL Queries/OperationsManager/Alerts_ByRepeat.sql | v-bldrum/SCOM-Scripts-and-SQL | 55cbabc0d86b9709847fbb9f5322406b31596674 | [
"MIT"
] | null | null | null | SQL Queries/OperationsManager/Alerts_ByRepeat.sql | v-bldrum/SCOM-Scripts-and-SQL | 55cbabc0d86b9709847fbb9f5322406b31596674 | [
"MIT"
] | 3 | 2020-10-28T14:45:58.000Z | 2021-01-24T06:08:14.000Z | SELECT TOP 20 SUM(RepeatCount+1) AS RepeatCount, AlertStringName, AlertStringDescription, MonitoringRuleId, Name
FROM Alertview WITH (NOLOCK)
WHERE Timeraised is not NULL
GROUP BY AlertStringName, AlertStringDescription, MonitoringRuleId, Name
ORDER BY RepeatCount DESC | 54.6 | 113 | 0.838828 |
5b43cea309334beab99c7d606fdb81ae663cd6e7 | 418 | h | C | CommonTools/Utils/src/ExpressionPtr.h | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 1 | 2020-02-07T11:20:02.000Z | 2020-02-07T11:20:02.000Z | CommonTools/Utils/src/ExpressionPtr.h | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 7 | 2016-07-17T02:34:54.000Z | 2019-08-13T07:58:37.000Z | CommonTools/Utils/src/ExpressionPtr.h | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 2 | 2019-09-27T08:33:22.000Z | 2019-11-14T10:52:30.000Z | #ifndef Parser_ExpressionPtr_h
#define Parser_ExpressionPtr_h
/* \class reco::parser::ExpressionPtr
*
* Shared pointer to Expression
*
* \author Luca Lista, INFN
*
* \version $Revision: 1.2 $
*
*/
#include <boost/shared_ptr.hpp>
namespace reco {
namespace parser {
struct ExpressionBase;
typedef boost::shared_ptr<ExpressionBase> ExpressionPtr;
} // namespace parser
} // namespace reco
#endif
| 19 | 60 | 0.717703 |
6138c2f089496809b1e90ea366422d544b9757cc | 340 | sql | SQL | ex7.sql | dcorking/sql-hard-way-pluto | c27f0111e28c4e149d9093730ca49596371f1381 | [
"Zed"
] | null | null | null | ex7.sql | dcorking/sql-hard-way-pluto | c27f0111e28c4e149d9093730ca49596371f1381 | [
"Zed"
] | null | null | null | ex7.sql | dcorking/sql-hard-way-pluto | c27f0111e28c4e149d9093730ca49596371f1381 | [
"Zed"
] | null | null | null | -- dead pets?
SELECT name, age FROM pet WHERE dead = 1;
-- poor robot
DELETE FROM pet WHERE dead = 1;
/* but I didn't delete the join table rows */
-- is he gone?
SELECT * FROM pet;
-- resurrection
INSERT INTO pet VALUES (1, "Gigantor", "Robot", 1, 0);
-- Life!
SELECT * FROM pet;
-- but only because we haven't learnt UPDATE yet
| 17.894737 | 54 | 0.655882 |
e75a14d6fb0dc303b073eb646a22e11c2949e9d6 | 866 | js | JavaScript | src/components/navigation/Mobile.styled.js | khwkang/scholars_ways | 37caf875526f343af9d0e7ab96437df016873757 | [
"MIT"
] | 1 | 2020-07-28T22:08:29.000Z | 2020-07-28T22:08:29.000Z | src/components/navigation/Mobile.styled.js | khwkang/scholars_ways | 37caf875526f343af9d0e7ab96437df016873757 | [
"MIT"
] | 3 | 2018-08-12T04:34:02.000Z | 2021-05-09T17:09:41.000Z | src/components/navigation/Mobile.styled.js | khwkang/scholars_ways | 37caf875526f343af9d0e7ab96437df016873757 | [
"MIT"
] | 1 | 2018-08-11T20:30:57.000Z | 2018-08-11T20:30:57.000Z | import styled from 'react-emotion'
import t from '../../theme'
export const Container = styled('div')`
background-color: ${t.c.nav};
`
export const HamburgerMenuContainer = styled('div')`
cursor: pointer;
position: absolute;
z-index: 30;
right: 1.5rem;
top: 1.5rem;
${t.mq.l} {
display: none;
}
`
export const TopBar = styled('div')`
color: ${t.c.white};
position: relative;
${t.mq.l} {
display: none;
}
`
export const TopBarLogo = styled('img')`
max-height: 70px;
padding: 10px;
`
export const TopBarText = styled('p')`
display: inline-block;
font-size: 1.5rem;
position: absolute;
top: -5px;
padding-left: 0.7rem;
color: ${t.c.white};
`
export const MobileNavContainer = styled('div')`
padding-left: ${t.s(2)};
background: #2a2828;
padding-bottom: 30px;
display: ${p => (p.isOpen ? 'block' : 'none')};
`
| 19.244444 | 52 | 0.630485 |
dcbeaf094f90aa5d9f62dc0a8d991e9e21fc11bc | 91 | sql | SQL | src/test/resources/sql/insert/9a18190c.sql | Shuttl-Tech/antlr_psql | fcf83192300abe723f3fd3709aff5b0c8118ad12 | [
"MIT"
] | 66 | 2018-06-15T11:34:03.000Z | 2022-03-16T09:24:49.000Z | src/test/resources/sql/insert/9a18190c.sql | Shuttl-Tech/antlr_psql | fcf83192300abe723f3fd3709aff5b0c8118ad12 | [
"MIT"
] | 13 | 2019-03-19T11:56:28.000Z | 2020-08-05T04:20:50.000Z | src/test/resources/sql/insert/9a18190c.sql | Shuttl-Tech/antlr_psql | fcf83192300abe723f3fd3709aff5b0c8118ad12 | [
"MIT"
] | 28 | 2019-01-05T19:59:02.000Z | 2022-03-24T11:55:50.000Z | -- file:numeric.sql ln:316 expect:true
INSERT INTO num_exp_add VALUES (7,3,'-83028480.69')
| 30.333333 | 51 | 0.747253 |
bfae5e50a79c94096277e9d66c666b5ac8fe1eda | 458 | rs | Rust | src/multirust-dist/src/lib.rs | brson/multirust-rs-old-tmp | e53433af7c2cb888e354abb669e7a708df6b1355 | [
"Apache-2.0",
"MIT"
] | 1 | 2016-04-02T11:55:14.000Z | 2016-04-02T11:55:14.000Z | src/multirust-dist/src/lib.rs | brson/multirust-rs-old-tmp | e53433af7c2cb888e354abb669e7a708df6b1355 | [
"Apache-2.0",
"MIT"
] | 1 | 2016-02-27T16:39:53.000Z | 2016-02-27T16:39:53.000Z | src/multirust-dist/src/lib.rs | brson/multirust-rs-old-tmp | e53433af7c2cb888e354abb669e7a708df6b1355 | [
"Apache-2.0",
"MIT"
] | null | null | null | extern crate hyper;
extern crate regex;
extern crate openssl;
extern crate itertools;
extern crate tempdir;
extern crate walkdir;
extern crate toml;
extern crate flate2;
extern crate tar;
#[macro_use]
extern crate multirust_utils;
pub use errors::{Error, Notification, NotifyHandler};
pub mod temp;
pub mod dist;
pub mod errors;
pub mod prefix;
pub mod component;
pub mod manifestation;
pub mod download;
pub mod manifest;
pub mod config;
mod toml_utils;
| 17.615385 | 53 | 0.786026 |
5fbfb71ca3d91f8677ebb04612937c19ecef4839 | 14,513 | c | C | drivers/gpu/drm/panel/panel-dsi-cm.c | Server2356/Sun-Kernel | 63cc54a6948ba572388f829c1fd641ffde0803d8 | [
"MIT"
] | 5 | 2020-07-08T01:35:16.000Z | 2021-04-12T16:35:29.000Z | kernel/drivers/gpu/drm/panel/panel-dsi-cm.c | SFIP/SFIP | e428a425d2d0e287f23d49f3dd583617ebd2e4a3 | [
"Zlib"
] | null | null | null | kernel/drivers/gpu/drm/panel/panel-dsi-cm.c | SFIP/SFIP | e428a425d2d0e287f23d49f3dd583617ebd2e4a3 | [
"Zlib"
] | null | null | null | // SPDX-License-Identifier: GPL-2.0-only
/*
* Generic DSI Command Mode panel driver
*
* Copyright (C) 2013 Texas Instruments Incorporated - https://www.ti.com/
* Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
*/
#include <linux/backlight.h>
#include <linux/delay.h>
#include <linux/gpio/consumer.h>
#include <linux/jiffies.h>
#include <linux/module.h>
#include <linux/of_device.h>
#include <linux/regulator/consumer.h>
#include <drm/drm_connector.h>
#include <drm/drm_mipi_dsi.h>
#include <drm/drm_modes.h>
#include <drm/drm_panel.h>
#include <video/mipi_display.h>
#define DCS_GET_ID1 0xda
#define DCS_GET_ID2 0xdb
#define DCS_GET_ID3 0xdc
#define DCS_REGULATOR_SUPPLY_NUM 2
static const struct of_device_id dsicm_of_match[];
struct dsic_panel_data {
u32 xres;
u32 yres;
u32 refresh;
u32 width_mm;
u32 height_mm;
u32 max_hs_rate;
u32 max_lp_rate;
bool te_support;
};
struct panel_drv_data {
struct mipi_dsi_device *dsi;
struct drm_panel panel;
struct drm_display_mode mode;
struct mutex lock;
struct backlight_device *bldev;
struct backlight_device *extbldev;
unsigned long hw_guard_end; /* next value of jiffies when we can
* issue the next sleep in/out command
*/
unsigned long hw_guard_wait; /* max guard time in jiffies */
const struct dsic_panel_data *panel_data;
struct gpio_desc *reset_gpio;
struct regulator_bulk_data supplies[DCS_REGULATOR_SUPPLY_NUM];
bool use_dsi_backlight;
/* runtime variables */
bool enabled;
bool intro_printed;
};
static inline struct panel_drv_data *panel_to_ddata(struct drm_panel *panel)
{
return container_of(panel, struct panel_drv_data, panel);
}
static void dsicm_bl_power(struct panel_drv_data *ddata, bool enable)
{
struct backlight_device *backlight;
if (ddata->bldev)
backlight = ddata->bldev;
else if (ddata->extbldev)
backlight = ddata->extbldev;
else
return;
if (enable) {
backlight->props.fb_blank = FB_BLANK_UNBLANK;
backlight->props.state = ~(BL_CORE_FBBLANK | BL_CORE_SUSPENDED);
backlight->props.power = FB_BLANK_UNBLANK;
} else {
backlight->props.fb_blank = FB_BLANK_NORMAL;
backlight->props.power = FB_BLANK_POWERDOWN;
backlight->props.state |= BL_CORE_FBBLANK | BL_CORE_SUSPENDED;
}
backlight_update_status(backlight);
}
static void hw_guard_start(struct panel_drv_data *ddata, int guard_msec)
{
ddata->hw_guard_wait = msecs_to_jiffies(guard_msec);
ddata->hw_guard_end = jiffies + ddata->hw_guard_wait;
}
static void hw_guard_wait(struct panel_drv_data *ddata)
{
unsigned long wait = ddata->hw_guard_end - jiffies;
if ((long)wait > 0 && wait <= ddata->hw_guard_wait) {
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(wait);
}
}
static int dsicm_dcs_read_1(struct panel_drv_data *ddata, u8 dcs_cmd, u8 *data)
{
return mipi_dsi_dcs_read(ddata->dsi, dcs_cmd, data, 1);
}
static int dsicm_dcs_write_1(struct panel_drv_data *ddata, u8 dcs_cmd, u8 param)
{
return mipi_dsi_dcs_write(ddata->dsi, dcs_cmd, ¶m, 1);
}
static int dsicm_sleep_in(struct panel_drv_data *ddata)
{
int r;
hw_guard_wait(ddata);
r = mipi_dsi_dcs_enter_sleep_mode(ddata->dsi);
if (r)
return r;
hw_guard_start(ddata, 120);
usleep_range(5000, 10000);
return 0;
}
static int dsicm_sleep_out(struct panel_drv_data *ddata)
{
int r;
hw_guard_wait(ddata);
r = mipi_dsi_dcs_exit_sleep_mode(ddata->dsi);
if (r)
return r;
hw_guard_start(ddata, 120);
usleep_range(5000, 10000);
return 0;
}
static int dsicm_get_id(struct panel_drv_data *ddata, u8 *id1, u8 *id2, u8 *id3)
{
int r;
r = dsicm_dcs_read_1(ddata, DCS_GET_ID1, id1);
if (r)
return r;
r = dsicm_dcs_read_1(ddata, DCS_GET_ID2, id2);
if (r)
return r;
r = dsicm_dcs_read_1(ddata, DCS_GET_ID3, id3);
if (r)
return r;
return 0;
}
static int dsicm_set_update_window(struct panel_drv_data *ddata)
{
struct mipi_dsi_device *dsi = ddata->dsi;
int r;
r = mipi_dsi_dcs_set_column_address(dsi, 0, ddata->mode.hdisplay - 1);
if (r < 0)
return r;
r = mipi_dsi_dcs_set_page_address(dsi, 0, ddata->mode.vdisplay - 1);
if (r < 0)
return r;
return 0;
}
static int dsicm_bl_update_status(struct backlight_device *dev)
{
struct panel_drv_data *ddata = dev_get_drvdata(&dev->dev);
int r = 0;
int level;
if (dev->props.fb_blank == FB_BLANK_UNBLANK &&
dev->props.power == FB_BLANK_UNBLANK)
level = dev->props.brightness;
else
level = 0;
dev_dbg(&ddata->dsi->dev, "update brightness to %d\n", level);
mutex_lock(&ddata->lock);
if (ddata->enabled)
r = dsicm_dcs_write_1(ddata, MIPI_DCS_SET_DISPLAY_BRIGHTNESS,
level);
mutex_unlock(&ddata->lock);
return r;
}
static int dsicm_bl_get_intensity(struct backlight_device *dev)
{
if (dev->props.fb_blank == FB_BLANK_UNBLANK &&
dev->props.power == FB_BLANK_UNBLANK)
return dev->props.brightness;
return 0;
}
static const struct backlight_ops dsicm_bl_ops = {
.get_brightness = dsicm_bl_get_intensity,
.update_status = dsicm_bl_update_status,
};
static ssize_t num_dsi_errors_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct panel_drv_data *ddata = dev_get_drvdata(dev);
u8 errors = 0;
int r = -ENODEV;
mutex_lock(&ddata->lock);
if (ddata->enabled)
r = dsicm_dcs_read_1(ddata, MIPI_DCS_GET_ERROR_COUNT_ON_DSI, &errors);
mutex_unlock(&ddata->lock);
if (r)
return r;
return snprintf(buf, PAGE_SIZE, "%d\n", errors);
}
static ssize_t hw_revision_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct panel_drv_data *ddata = dev_get_drvdata(dev);
u8 id1, id2, id3;
int r = -ENODEV;
mutex_lock(&ddata->lock);
if (ddata->enabled)
r = dsicm_get_id(ddata, &id1, &id2, &id3);
mutex_unlock(&ddata->lock);
if (r)
return r;
return snprintf(buf, PAGE_SIZE, "%02x.%02x.%02x\n", id1, id2, id3);
}
static DEVICE_ATTR_RO(num_dsi_errors);
static DEVICE_ATTR_RO(hw_revision);
static struct attribute *dsicm_attrs[] = {
&dev_attr_num_dsi_errors.attr,
&dev_attr_hw_revision.attr,
NULL,
};
static const struct attribute_group dsicm_attr_group = {
.attrs = dsicm_attrs,
};
static void dsicm_hw_reset(struct panel_drv_data *ddata)
{
gpiod_set_value(ddata->reset_gpio, 1);
udelay(10);
/* reset the panel */
gpiod_set_value(ddata->reset_gpio, 0);
/* assert reset */
udelay(10);
gpiod_set_value(ddata->reset_gpio, 1);
/* wait after releasing reset */
usleep_range(5000, 10000);
}
static int dsicm_power_on(struct panel_drv_data *ddata)
{
u8 id1, id2, id3;
int r;
dsicm_hw_reset(ddata);
ddata->dsi->mode_flags |= MIPI_DSI_MODE_LPM;
r = dsicm_sleep_out(ddata);
if (r)
goto err;
r = dsicm_get_id(ddata, &id1, &id2, &id3);
if (r)
goto err;
r = dsicm_dcs_write_1(ddata, MIPI_DCS_SET_DISPLAY_BRIGHTNESS, 0xff);
if (r)
goto err;
r = dsicm_dcs_write_1(ddata, MIPI_DCS_WRITE_CONTROL_DISPLAY,
(1<<2) | (1<<5)); /* BL | BCTRL */
if (r)
goto err;
r = mipi_dsi_dcs_set_pixel_format(ddata->dsi, MIPI_DCS_PIXEL_FMT_24BIT);
if (r)
goto err;
r = dsicm_set_update_window(ddata);
if (r)
goto err;
r = mipi_dsi_dcs_set_display_on(ddata->dsi);
if (r)
goto err;
if (ddata->panel_data->te_support) {
r = mipi_dsi_dcs_set_tear_on(ddata->dsi, MIPI_DSI_DCS_TEAR_MODE_VBLANK);
if (r)
goto err;
}
/* possible panel bug */
msleep(100);
ddata->enabled = true;
if (!ddata->intro_printed) {
dev_info(&ddata->dsi->dev, "panel revision %02x.%02x.%02x\n",
id1, id2, id3);
ddata->intro_printed = true;
}
ddata->dsi->mode_flags &= ~MIPI_DSI_MODE_LPM;
return 0;
err:
dev_err(&ddata->dsi->dev, "error while enabling panel, issuing HW reset\n");
dsicm_hw_reset(ddata);
return r;
}
static int dsicm_power_off(struct panel_drv_data *ddata)
{
int r;
ddata->enabled = false;
r = mipi_dsi_dcs_set_display_off(ddata->dsi);
if (!r)
r = dsicm_sleep_in(ddata);
if (r) {
dev_err(&ddata->dsi->dev,
"error disabling panel, issuing HW reset\n");
dsicm_hw_reset(ddata);
}
return r;
}
static int dsicm_prepare(struct drm_panel *panel)
{
struct panel_drv_data *ddata = panel_to_ddata(panel);
int r;
r = regulator_bulk_enable(ARRAY_SIZE(ddata->supplies), ddata->supplies);
if (r)
dev_err(&ddata->dsi->dev, "failed to enable supplies: %d\n", r);
return r;
}
static int dsicm_enable(struct drm_panel *panel)
{
struct panel_drv_data *ddata = panel_to_ddata(panel);
int r;
mutex_lock(&ddata->lock);
r = dsicm_power_on(ddata);
if (r)
goto err;
mutex_unlock(&ddata->lock);
dsicm_bl_power(ddata, true);
return 0;
err:
dev_err(&ddata->dsi->dev, "enable failed (%d)\n", r);
mutex_unlock(&ddata->lock);
return r;
}
static int dsicm_unprepare(struct drm_panel *panel)
{
struct panel_drv_data *ddata = panel_to_ddata(panel);
int r;
r = regulator_bulk_disable(ARRAY_SIZE(ddata->supplies), ddata->supplies);
if (r)
dev_err(&ddata->dsi->dev, "failed to disable supplies: %d\n", r);
return r;
}
static int dsicm_disable(struct drm_panel *panel)
{
struct panel_drv_data *ddata = panel_to_ddata(panel);
int r;
dsicm_bl_power(ddata, false);
mutex_lock(&ddata->lock);
r = dsicm_power_off(ddata);
mutex_unlock(&ddata->lock);
return r;
}
static int dsicm_get_modes(struct drm_panel *panel,
struct drm_connector *connector)
{
struct panel_drv_data *ddata = panel_to_ddata(panel);
struct drm_display_mode *mode;
mode = drm_mode_duplicate(connector->dev, &ddata->mode);
if (!mode) {
dev_err(&ddata->dsi->dev, "failed to add mode %ux%ux@%u kHz\n",
ddata->mode.hdisplay, ddata->mode.vdisplay,
ddata->mode.clock);
return -ENOMEM;
}
connector->display_info.width_mm = ddata->panel_data->width_mm;
connector->display_info.height_mm = ddata->panel_data->height_mm;
drm_mode_probed_add(connector, mode);
return 1;
}
static const struct drm_panel_funcs dsicm_panel_funcs = {
.unprepare = dsicm_unprepare,
.disable = dsicm_disable,
.prepare = dsicm_prepare,
.enable = dsicm_enable,
.get_modes = dsicm_get_modes,
};
static int dsicm_probe_of(struct mipi_dsi_device *dsi)
{
struct backlight_device *backlight;
struct panel_drv_data *ddata = mipi_dsi_get_drvdata(dsi);
int err;
struct drm_display_mode *mode = &ddata->mode;
ddata->reset_gpio = devm_gpiod_get(&dsi->dev, "reset", GPIOD_OUT_LOW);
if (IS_ERR(ddata->reset_gpio)) {
err = PTR_ERR(ddata->reset_gpio);
dev_err(&dsi->dev, "reset gpio request failed: %d", err);
return err;
}
mode->hdisplay = mode->hsync_start = mode->hsync_end = mode->htotal =
ddata->panel_data->xres;
mode->vdisplay = mode->vsync_start = mode->vsync_end = mode->vtotal =
ddata->panel_data->yres;
mode->clock = ddata->panel_data->xres * ddata->panel_data->yres *
ddata->panel_data->refresh / 1000;
mode->width_mm = ddata->panel_data->width_mm;
mode->height_mm = ddata->panel_data->height_mm;
mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
drm_mode_set_name(mode);
ddata->supplies[0].supply = "vpnl";
ddata->supplies[1].supply = "vddi";
err = devm_regulator_bulk_get(&dsi->dev, ARRAY_SIZE(ddata->supplies),
ddata->supplies);
if (err)
return err;
backlight = devm_of_find_backlight(&dsi->dev);
if (IS_ERR(backlight))
return PTR_ERR(backlight);
/* If no backlight device is found assume native backlight support */
if (backlight)
ddata->extbldev = backlight;
else
ddata->use_dsi_backlight = true;
return 0;
}
static int dsicm_probe(struct mipi_dsi_device *dsi)
{
struct panel_drv_data *ddata;
struct backlight_device *bldev = NULL;
struct device *dev = &dsi->dev;
int r;
dev_dbg(dev, "probe\n");
ddata = devm_kzalloc(dev, sizeof(*ddata), GFP_KERNEL);
if (!ddata)
return -ENOMEM;
mipi_dsi_set_drvdata(dsi, ddata);
ddata->dsi = dsi;
ddata->panel_data = of_device_get_match_data(dev);
if (!ddata->panel_data)
return -ENODEV;
r = dsicm_probe_of(dsi);
if (r)
return r;
mutex_init(&ddata->lock);
dsicm_hw_reset(ddata);
drm_panel_init(&ddata->panel, dev, &dsicm_panel_funcs,
DRM_MODE_CONNECTOR_DSI);
if (ddata->use_dsi_backlight) {
struct backlight_properties props = { 0 };
props.max_brightness = 255;
props.type = BACKLIGHT_RAW;
bldev = devm_backlight_device_register(dev, dev_name(dev),
dev, ddata, &dsicm_bl_ops, &props);
if (IS_ERR(bldev)) {
r = PTR_ERR(bldev);
goto err_bl;
}
ddata->bldev = bldev;
}
r = sysfs_create_group(&dev->kobj, &dsicm_attr_group);
if (r) {
dev_err(dev, "failed to create sysfs files\n");
goto err_bl;
}
dsi->lanes = 2;
dsi->format = MIPI_DSI_FMT_RGB888;
dsi->mode_flags = MIPI_DSI_CLOCK_NON_CONTINUOUS |
MIPI_DSI_MODE_EOT_PACKET;
dsi->hs_rate = ddata->panel_data->max_hs_rate;
dsi->lp_rate = ddata->panel_data->max_lp_rate;
drm_panel_add(&ddata->panel);
r = mipi_dsi_attach(dsi);
if (r < 0)
goto err_dsi_attach;
return 0;
err_dsi_attach:
drm_panel_remove(&ddata->panel);
sysfs_remove_group(&dsi->dev.kobj, &dsicm_attr_group);
err_bl:
if (ddata->extbldev)
put_device(&ddata->extbldev->dev);
return r;
}
static int dsicm_remove(struct mipi_dsi_device *dsi)
{
struct panel_drv_data *ddata = mipi_dsi_get_drvdata(dsi);
dev_dbg(&dsi->dev, "remove\n");
mipi_dsi_detach(dsi);
drm_panel_remove(&ddata->panel);
sysfs_remove_group(&dsi->dev.kobj, &dsicm_attr_group);
if (ddata->extbldev)
put_device(&ddata->extbldev->dev);
return 0;
}
static const struct dsic_panel_data taal_data = {
.xres = 864,
.yres = 480,
.refresh = 60,
.width_mm = 0,
.height_mm = 0,
.max_hs_rate = 300000000,
.max_lp_rate = 10000000,
.te_support = true,
};
static const struct dsic_panel_data himalaya_data = {
.xres = 480,
.yres = 864,
.refresh = 60,
.width_mm = 49,
.height_mm = 88,
.max_hs_rate = 300000000,
.max_lp_rate = 10000000,
.te_support = false,
};
static const struct dsic_panel_data droid4_data = {
.xres = 540,
.yres = 960,
.refresh = 60,
.width_mm = 50,
.height_mm = 89,
.max_hs_rate = 300000000,
.max_lp_rate = 10000000,
.te_support = false,
};
static const struct of_device_id dsicm_of_match[] = {
{ .compatible = "tpo,taal", .data = &taal_data },
{ .compatible = "nokia,himalaya", &himalaya_data },
{ .compatible = "motorola,droid4-panel", &droid4_data },
{},
};
MODULE_DEVICE_TABLE(of, dsicm_of_match);
static struct mipi_dsi_driver dsicm_driver = {
.probe = dsicm_probe,
.remove = dsicm_remove,
.driver = {
.name = "panel-dsi-cm",
.of_match_table = dsicm_of_match,
},
};
module_mipi_dsi_driver(dsicm_driver);
MODULE_AUTHOR("Tomi Valkeinen <tomi.valkeinen@ti.com>");
MODULE_DESCRIPTION("Generic DSI Command Mode Panel Driver");
MODULE_LICENSE("GPL");
| 21.596726 | 80 | 0.7197 |
bb4571f812dec08efe775630af3ad03d9f5b11bd | 621 | swift | Swift | Package.swift | atelier-socle/CoreUIFrameworkRepositoryTemplate | 03514f8029c9955b054616998f59f41daaf43b67 | [
"MIT"
] | 3 | 2020-04-26T14:01:41.000Z | 2020-04-27T04:17:24.000Z | Package.swift | atelier-socle/CoreUIFrameworkRepositoryTemplate | 03514f8029c9955b054616998f59f41daaf43b67 | [
"MIT"
] | 1 | 2020-04-26T14:04:33.000Z | 2020-04-26T14:04:33.000Z | Package.swift | atelier-socle/CoreUIFrameworkRepositoryTemplate | 03514f8029c9955b054616998f59f41daaf43b67 | [
"MIT"
] | null | null | null | // swift-tools-version:5.1
import PackageDescription
let package = Package(name: "MyCoreUIFramework",
platforms: [.macOS(.v10_15),
.iOS(.v13),
.tvOS(.v13),
.watchOS(.v6)],
products: [.library(name: "MyCoreUIFramework",
targets: ["MyCoreUIFramework"])],
targets: [.target(name: "MyCoreUIFramework",
path: "Sources")],
swiftLanguageVersions: [.v5])
| 41.4 | 75 | 0.404187 |
a9bf880a327b11b55b769c74189dfcc7d881ed65 | 357 | asm | Assembly | sbsext/utq/procdef.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | sbsext/utq/procdef.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | sbsext/utq/procdef.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | ; link in extensions 1988 Tony Tebby Qjump
section procs
xdef ut_procdef
xref ut_reassert
include 'dev8_keys_qlv'
;+++
; Links and re-asserts the procedures pointd to by a1.
;
; d2 s
; a1 c s pointer to procedure table
;---
ut_procdef
movem.l a1/a2,-(sp)
move.w sb.inipr,a2
jsr (a2)
movem.l (sp)+,a1/a2
; ut_reassert here !!!
end
| 14.875 | 54 | 0.666667 |
750fa996c0f20bfa09485ea4bdeb13f8e3c54d03 | 1,109 | h | C | ReactNativeFrontend/ios/Pods/RCT-Folly/folly/detail/AtFork.h | Harshitha91/Tmdb-react-native-node | e06e3f25a7ee6946ef07a1f524fdf62e48424293 | [
"Apache-2.0"
] | 19,046 | 2015-01-01T17:01:10.000Z | 2022-03-31T23:01:43.000Z | ReactNativeFrontend/ios/Pods/RCT-Folly/folly/detail/AtFork.h | Harshitha91/Tmdb-react-native-node | e06e3f25a7ee6946ef07a1f524fdf62e48424293 | [
"Apache-2.0"
] | 1,493 | 2015-01-11T15:47:13.000Z | 2022-03-28T18:13:58.000Z | ReactNativeFrontend/ios/Pods/RCT-Folly/folly/detail/AtFork.h | Harshitha91/Tmdb-react-native-node | e06e3f25a7ee6946ef07a1f524fdf62e48424293 | [
"Apache-2.0"
] | 4,818 | 2015-01-01T12:28:16.000Z | 2022-03-31T16:22:10.000Z | /*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <sys/types.h>
#include <folly/Function.h>
namespace folly {
namespace detail {
struct AtFork {
static void init();
static void registerHandler(
void const* handle,
folly::Function<bool()> prepare,
folly::Function<void()> parent,
folly::Function<void()> child);
static void unregisterHandler(void const* handle);
using fork_t = pid_t();
static pid_t forkInstrumented(fork_t forkFn);
};
} // namespace detail
} // namespace folly
| 26.404762 | 75 | 0.712353 |
bc3f8ad06b2ae9b317bb070a8a72a178ca04419d | 312 | lua | Lua | test_gdb/xmake.lua | huguanghui/CommonLib_Linux | 6ba81c0530fe9a8e2cdc31f4f700d721188fa137 | [
"MIT"
] | 2 | 2020-09-23T11:40:38.000Z | 2020-12-21T03:33:32.000Z | test_gdb/xmake.lua | huguanghui/CommonLib_Linux | 6ba81c0530fe9a8e2cdc31f4f700d721188fa137 | [
"MIT"
] | null | null | null | test_gdb/xmake.lua | huguanghui/CommonLib_Linux | 6ba81c0530fe9a8e2cdc31f4f700d721188fa137 | [
"MIT"
] | 2 | 2019-09-01T11:47:45.000Z | 2020-09-23T11:40:41.000Z | set_kind("binary")
add_cxxflags("-std=c++11")
set_optimize("faster")
set_warnings("all")
set_targetdir("./target")
add_includedirs("./include")
add_linkdirs("./lib")
add_cxflags("-g3")
add_syslinks("pthread", "dl")
after_build(function ()
os.rm("build")
end)
target("gdb_1")
add_files("gdb_1.cc")
| 17.333333 | 29 | 0.682692 |
33026e3d3385ab0a61779b22eebf7f1ae1b53d97 | 3,047 | py | Python | pyleecan/Methods/Slot/HoleM51/_comp_point_coordinate.py | IrakozeFD/pyleecan | 5a93bd98755d880176c1ce8ac90f36ca1b907055 | [
"Apache-2.0"
] | 95 | 2019-01-23T04:19:45.000Z | 2022-03-17T18:22:10.000Z | pyleecan/Methods/Slot/HoleM51/_comp_point_coordinate.py | IrakozeFD/pyleecan | 5a93bd98755d880176c1ce8ac90f36ca1b907055 | [
"Apache-2.0"
] | 366 | 2019-02-20T07:15:08.000Z | 2022-03-31T13:37:23.000Z | pyleecan/Methods/Slot/HoleM51/_comp_point_coordinate.py | IrakozeFD/pyleecan | 5a93bd98755d880176c1ce8ac90f36ca1b907055 | [
"Apache-2.0"
] | 74 | 2019-01-24T01:47:31.000Z | 2022-02-25T05:44:42.000Z | from numpy import exp, pi, cos, sin, tan
from ....Functions.Geometry.inter_line_circle import inter_line_circle
def _comp_point_coordinate(self):
"""Compute the point coordinates needed to plot the Slot.
Parameters
----------
self : HoleM51
A HoleM51 object
Returns
-------
point_dict: dict
A dict of the slot coordinates
"""
Rext = self.get_Rext()
# comp point coordinate (in complex)
alpha = self.comp_alpha()
Wslot = 2 * sin(self.W1 / 2) * (Rext - self.H1)
L = 0.5 * (Wslot - self.W0) / cos(alpha) # ||P2,P5||
# Center of the hole
Z0 = Rext - self.H0
Z2 = Z0 + 1j * self.W0 / 2
Z25 = Z0 - 1j * self.W0 / 2
Z15 = Z25 - self.H2
Z1 = Z2 - 1j * self.W2
Z26 = Z1 - 1j * self.W3
Z12 = Z2 - self.H2
Z13 = Z12 - 1j * self.W2
Z14 = Z13 - 1j * self.W3
Z11 = Z12 + 1j * tan(alpha / 2) * self.H2
Z16 = Z15 - 1j * tan(alpha / 2) * self.H2
# Draw the left side with center P2, and X axis =(P2,P5), Y axis=(P2,P10)
Z3 = self.W4 * exp(1j * (pi / 2 - alpha)) + Z2
Z4 = (self.W4 + self.W5) * exp(1j * (pi / 2 - alpha)) + Z2
Z5 = (Rext - self.H1) * exp(1j * self.W1 / 2)
Z10 = (1j * self.H2) * exp(1j * (pi / 2 - alpha)) + Z2
Z9 = (1j * self.H2 + self.W4) * exp(1j * (pi / 2 - alpha)) + Z2
Z8 = (1j * self.H2 + self.W4 + self.W5) * exp(1j * (pi / 2 - alpha)) + Z2
Z7 = (1j * self.H2 + L) * exp(1j * (pi / 2 - alpha)) + Z2
# Draw the right side with center P25, X axis (P25,P23), Y axis(P25,P17)
Z24 = self.W6 * exp(-1j * (pi / 2 - alpha)) + Z25
Z23 = (self.W6 + self.W7) * exp(-1j * (pi / 2 - alpha)) + Z25
Z22 = (Rext - self.H1) * exp(-1j * self.W1 / 2)
Z17 = (-1j * self.H2) * exp(-1j * (pi / 2 - alpha)) + Z25
Z18 = (-1j * self.H2 + self.W6) * exp(-1j * (pi / 2 - alpha)) + Z25
Z19 = (-1j * self.H2 + self.W6 + self.W7) * exp(-1j * (pi / 2 - alpha)) + Z25
Z20 = (-1j * self.H2 + L) * exp(-1j * (pi / 2 - alpha)) + Z25
# Z6 is the intersection of the line [Z7,Z10] and Circle centre
# (0,0) radius Rext - H1
Zint = inter_line_circle(Z7, Z10, Rext - self.H1)
# Select the point with Re(Z) > 0
if Zint[0].real > 0:
Z6 = Zint[0]
else:
Z6 = Zint[1]
Z21 = Z6.conjugate()
point_dict = dict()
point_dict["Z1"] = Z1
point_dict["Z2"] = Z2
point_dict["Z3"] = Z3
point_dict["Z4"] = Z4
point_dict["Z5"] = Z5
point_dict["Z6"] = Z6
point_dict["Z7"] = Z7
point_dict["Z8"] = Z8
point_dict["Z9"] = Z9
point_dict["Z10"] = Z10
point_dict["Z11"] = Z11
point_dict["Z12"] = Z12
point_dict["Z13"] = Z13
point_dict["Z14"] = Z14
point_dict["Z15"] = Z15
point_dict["Z16"] = Z16
point_dict["Z17"] = Z17
point_dict["Z18"] = Z18
point_dict["Z19"] = Z19
point_dict["Z20"] = Z20
point_dict["Z21"] = Z21
point_dict["Z22"] = Z22
point_dict["Z23"] = Z23
point_dict["Z24"] = Z24
point_dict["Z25"] = Z25
point_dict["Z26"] = Z26
return point_dict
| 31.091837 | 81 | 0.535609 |
95674824525de2ac70d44d252b61ad13ae543c84 | 988 | kt | Kotlin | src/main/kotlin/com/nexsabre/hardwarereservationtool/server/api/v1/Rules.kt | NexSabre/hardware-reservation-tool | 120f5f8049fcec11e4de2805518bf838eab0b8c4 | [
"Apache-2.0"
] | null | null | null | src/main/kotlin/com/nexsabre/hardwarereservationtool/server/api/v1/Rules.kt | NexSabre/hardware-reservation-tool | 120f5f8049fcec11e4de2805518bf838eab0b8c4 | [
"Apache-2.0"
] | 1 | 2020-12-08T17:37:45.000Z | 2020-12-08T17:37:45.000Z | src/main/kotlin/com/nexsabre/hardwarereservationtool/server/api/v1/Rules.kt | NexSabre/hardware-reservation-tool | 120f5f8049fcec11e4de2805518bf838eab0b8c4 | [
"Apache-2.0"
] | null | null | null | package com.nexsabre.hardwarereservationtool.server.api.v1
import com.nexsabre.hardwarereservationtool.server.configuration.Config
import com.nexsabre.hardwarereservationtool.server.configuration.Configuration
import com.nexsabre.hardwarereservationtool.server.helpers.mask
import io.swagger.v3.oas.annotations.Operation
import io.swagger.v3.oas.annotations.tags.Tag
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController
@RestController
@RequestMapping("/api/v1/rules")
class Rules {
private var config = Configuration().all()
@GetMapping
@Operation(
summary = "Return a dict with rules for this specific instance",
description = "It also contains a information about database and configuration for the server"
)
@Tag(name = "rules")
fun rules(): Config {
config.mask()
return config
}
}
| 34.068966 | 106 | 0.769231 |
7314f3a027f970ba46d7e21196801da55aba0e6a | 1,245 | asm | Assembly | programs/oeis/122/A122795.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/122/A122795.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/122/A122795.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A122795: Connell (5,3)-sum sequence (partial sums of the (5,3)-Connell sequence)
; 1,3,10,22,39,57,80,108,141,179,222,270,319,373,432,496,565,639,718,802,891,985,1080,1180,1285,1395,1510,1630,1755,1885,2020,2160,2305,2455,2610,2766,2927,3093,3264,3440,3621,3807,3998,4194,4395,4601,4812,5028,5249,5475,5706,5938,6175,6417,6664,6916,7173,7435,7702,7974,8251,8533,8820,9112,9409,9711,10018,10330,10647,10969
mov $14,$0
mov $16,$0
add $16,1
lpb $16,1
clr $0,14
mov $0,$14
sub $16,1
sub $0,$16
mov $11,$0
mov $13,$0
add $13,1
lpb $13,1
mov $0,$11
sub $13,1
sub $0,$13
mov $7,$0
mov $9,2
lpb $9,1
mov $0,$7
sub $9,1
add $0,$9
sub $0,1
mov $2,$0
lpb $2,1
mov $5,10
lpb $4,1
mov $1,$2
sub $4,$4
mov $5,$0
lpe
add $0,$1
lpb $5,1
sub $0,2
trn $4,1
add $4,4
trn $5,$4
lpe
sub $2,$1
lpe
mov $1,$0
mov $10,$9
lpb $10,1
mov $8,$1
sub $10,1
lpe
lpe
lpb $7,1
mov $7,0
trn $8,$1
lpe
mov $1,$8
div $1,2
mul $1,4
add $1,1
add $12,$1
lpe
add $15,$12
lpe
mov $1,$15
| 19.761905 | 324 | 0.493976 |
160d4578f2e3d0582723768dfb791d7fcfc989d3 | 623 | ts | TypeScript | src/modules/tipo-documento/tipo-documento.module.ts | asanchez1610/api-personas-core01 | 2a8e71e264599cd51d3f752feec6eeadf3fa6893 | [
"MIT"
] | null | null | null | src/modules/tipo-documento/tipo-documento.module.ts | asanchez1610/api-personas-core01 | 2a8e71e264599cd51d3f752feec6eeadf3fa6893 | [
"MIT"
] | 4 | 2021-03-09T20:08:27.000Z | 2022-01-22T09:30:12.000Z | src/modules/tipo-documento/tipo-documento.module.ts | asanchez1610/api-personas-core01 | 2a8e71e264599cd51d3f752feec6eeadf3fa6893 | [
"MIT"
] | null | null | null | import { Module } from '@nestjs/common';
import { DatabaseModule } from '../../config/database/database.module';
import { TipoDocumentoController } from '../../controllers/tipo-documento/tipo-documento.controller';
import { TipoDocumentoService } from '../../services/tipo-documento/tipo-documento.service';
import { TipoDocumentoProvider } from '../../models/providers/tipoDocumento.provider';
@Module({
imports: [DatabaseModule],
controllers: [TipoDocumentoController],
providers: [TipoDocumentoService, ...TipoDocumentoProvider],
exports: [TipoDocumentoService]
})
export class TipoDocumentoModule { }
| 41.533333 | 101 | 0.747994 |
e6801ba8bf9cb071f9c45f364a698dd3e48079d9 | 8,481 | sql | SQL | laporan_bencana.sql | rizalhamdana/PSI | 667ab67a19cfb0a086fcd5fb58598ebf8fffbfee | [
"MIT"
] | null | null | null | laporan_bencana.sql | rizalhamdana/PSI | 667ab67a19cfb0a086fcd5fb58598ebf8fffbfee | [
"MIT"
] | null | null | null | laporan_bencana.sql | rizalhamdana/PSI | 667ab67a19cfb0a086fcd5fb58598ebf8fffbfee | [
"MIT"
] | null | null | null | -- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 02, 2018 at 01:59 PM
-- Server version: 10.1.21-MariaDB
-- PHP Version: 7.1.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `laporan_bencana`
--
-- --------------------------------------------------------
--
-- Table structure for table `bencana`
--
CREATE TABLE `bencana` (
`id_bencana` int(11) NOT NULL,
`nama_bencana` varchar(100) NOT NULL,
`tanggal_bencana` date NOT NULL,
`id_wilayah` int(11) NOT NULL,
`jenis_bencana` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `bencana`
--
INSERT INTO `bencana` (`id_bencana`, `nama_bencana`, `tanggal_bencana`, `id_wilayah`, `jenis_bencana`) VALUES
(21, 'Erupsi Gunung Merapi', '2018-06-20', 2, 'Letusan Gunung Api'),
(22, 'Gempa Bumi', '2018-06-18', 4, 'Gempa Bumi'),
(24, 'Tanah Longsor', '2017-11-07', 4, 'Tanah Longsor');
-- --------------------------------------------------------
--
-- Table structure for table `jenisbencana`
--
CREATE TABLE `jenisbencana` (
`jenis_bencana` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `jenisbencana`
--
INSERT INTO `jenisbencana` (`jenis_bencana`) VALUES
('Letusan Gunung Api'),
('Gempa Bumi'),
('Banjir'),
('Tanah Longsor');
-- --------------------------------------------------------
--
-- Table structure for table `kerusakan`
--
CREATE TABLE `kerusakan` (
`id_kerusakan` int(11) NOT NULL,
`jenis_kerusakan` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `kerusakan`
--
INSERT INTO `kerusakan` (`id_kerusakan`, `jenis_kerusakan`) VALUES
(1, 'Rusak Ringan'),
(2, 'Rusak Sedang'),
(3, 'Rusak Berat');
-- --------------------------------------------------------
--
-- Table structure for table `laporan`
--
CREATE TABLE `laporan` (
`id_pengguna` int(11) NOT NULL,
`id_wilayah` int(11) NOT NULL,
`id_bencana` int(11) NOT NULL,
`id_kerusakan` int(11) NOT NULL,
`objek` varchar(50) NOT NULL,
`tanggal_laporan` datetime NOT NULL,
`id_laporan` int(11) NOT NULL,
`lokasi` text NOT NULL,
`persen_rusak_struktur` int(11) NOT NULL,
`persen_rusak_penunjang` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `laporan`
--
INSERT INTO `laporan` (`id_pengguna`, `id_wilayah`, `id_bencana`, `id_kerusakan`, `objek`, `tanggal_laporan`, `id_laporan`, `lokasi`, `persen_rusak_struktur`, `persen_rusak_penunjang`) VALUES
(12, 2, 21, 2, 'Rumah', '2018-06-26 00:30:49', 1, 'asksaklaskl', 40, 50),
(12, 2, 21, 3, 'Rumah', '2018-06-26 00:31:36', 2, 'sadsad', 70, 80),
(12, 2, 21, 1, 'Rumah', '2018-07-02 18:30:26', 3, 'asjsja', 30, 10),
(12, 2, 21, 2, 'Fasilitas Peribadatan', '2018-07-02 18:58:48', 4, 'dasds', 60, 40);
-- --------------------------------------------------------
--
-- Table structure for table `pengguna`
--
CREATE TABLE `pengguna` (
`id_pengguna` int(11) NOT NULL,
`username` varchar(20) NOT NULL,
`password` varchar(100) NOT NULL,
`nama_pengguna` varchar(30) NOT NULL,
`status_pengguna` int(11) NOT NULL,
`id_wilayah` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `pengguna`
--
INSERT INTO `pengguna` (`id_pengguna`, `username`, `password`, `nama_pengguna`, `status_pengguna`, `id_wilayah`) VALUES
(1, 'admin', '21232f297a57a5a743894a0e4a801fc3', 'administrator', 1, 1),
(12, 'rizalhamdan', '9ce389a88d98f56fa50e777e60c4ad9f', 'Rizal Hamdan Arigusti', 2, 2);
-- --------------------------------------------------------
--
-- Table structure for table `rules_kerusakan`
--
CREATE TABLE `rules_kerusakan` (
`id_rules` int(11) NOT NULL,
`kondisi1` varchar(50) NOT NULL,
`kondisi2` varchar(50) NOT NULL,
`hasil` varchar(50) NOT NULL,
`id_kerusakan` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `rules_kerusakan`
--
INSERT INTO `rules_kerusakan` (`id_rules`, `kondisi1`, `kondisi2`, `hasil`, `id_kerusakan`) VALUES
(55, 'BERAT', 'BERAT', 'RENDAH', 1),
(56, 'BERAT', 'SEDANG', 'RENDAH', 1),
(57, 'BERAT', 'RINGAN', 'RENDAH', 1),
(58, 'SEDANG', 'BERAT', 'RENDAH', 1),
(59, 'SEDANG', 'SEDANG', 'RENDAH', 1),
(60, 'SEDANG', 'RINGAN', 'RENDAH', 1),
(61, 'RINGAN', 'BERAT', 'TINGGI', 1),
(62, 'RINGAN', 'SEDANG', 'TINGGI', 1),
(63, 'RINGAN', 'RINGAN', 'TINGGI', 1),
(64, 'BERAT', 'BERAT', 'RENDAH', 2),
(65, 'BERAT', 'SEDANG', 'RENDAH', 2),
(66, 'BERAT', 'RINGAN', 'RENDAH', 2),
(67, 'SEDANG', 'BERAT', 'TINGGI', 2),
(68, 'SEDANG', 'SEDANG', 'TINGGI', 2),
(69, 'SEDANG', 'RINGAN', 'TINGGI', 2),
(70, 'RINGAN', 'BERAT', 'RENDAH', 2),
(71, 'RINGAN', 'SEDANG', 'RENDAH', 2),
(72, 'RINGAN', 'RINGAN', 'RENDAH', 2),
(73, 'BERAT', 'BERAT', 'TINGGI', 3),
(74, 'BERAT', 'SEDANG', 'TINGGI', 3),
(75, 'BERAT', 'RINGAN', 'TINGGI', 3),
(76, 'SEDANG', 'BERAT', 'RENDAH', 3),
(77, 'SEDANG', 'SEDANG', 'RENDAH', 3),
(78, 'SEDANG', 'RINGAN', 'RENDAH', 3),
(79, 'RINGAN', 'BERAT', 'RENDAH', 3),
(80, 'RINGAN', 'SEDANG', 'RENDAH', 3),
(81, 'RINGAN', 'RINGAN', 'RENDAH', 3);
-- --------------------------------------------------------
--
-- Table structure for table `wilayah`
--
CREATE TABLE `wilayah` (
`id_wilayah` int(11) NOT NULL,
`nama_wilayah` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `wilayah`
--
INSERT INTO `wilayah` (`id_wilayah`, `nama_wilayah`) VALUES
(1, 'Kantor Pusat'),
(2, 'D.I Yogyakarta'),
(4, 'DKI Jakarta'),
(5, 'Jawa Tengah');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `bencana`
--
ALTER TABLE `bencana`
ADD PRIMARY KEY (`id_bencana`),
ADD KEY `id_wilayah` (`id_wilayah`);
--
-- Indexes for table `kerusakan`
--
ALTER TABLE `kerusakan`
ADD PRIMARY KEY (`id_kerusakan`);
--
-- Indexes for table `laporan`
--
ALTER TABLE `laporan`
ADD PRIMARY KEY (`id_laporan`),
ADD KEY `id_pengguna` (`id_pengguna`),
ADD KEY `id_wilayah` (`id_wilayah`),
ADD KEY `id_bencana` (`id_bencana`),
ADD KEY `id_kerusakan` (`id_kerusakan`);
--
-- Indexes for table `pengguna`
--
ALTER TABLE `pengguna`
ADD PRIMARY KEY (`id_pengguna`),
ADD KEY `id_wilayah` (`id_wilayah`);
--
-- Indexes for table `rules_kerusakan`
--
ALTER TABLE `rules_kerusakan`
ADD PRIMARY KEY (`id_rules`),
ADD KEY `id_kerusakan` (`id_kerusakan`);
--
-- Indexes for table `wilayah`
--
ALTER TABLE `wilayah`
ADD PRIMARY KEY (`id_wilayah`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `bencana`
--
ALTER TABLE `bencana`
MODIFY `id_bencana` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25;
--
-- AUTO_INCREMENT for table `laporan`
--
ALTER TABLE `laporan`
MODIFY `id_laporan` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `pengguna`
--
ALTER TABLE `pengguna`
MODIFY `id_pengguna` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT for table `rules_kerusakan`
--
ALTER TABLE `rules_kerusakan`
MODIFY `id_rules` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=82;
--
-- AUTO_INCREMENT for table `wilayah`
--
ALTER TABLE `wilayah`
MODIFY `id_wilayah` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `bencana`
--
ALTER TABLE `bencana`
ADD CONSTRAINT `bencana_ibfk_1` FOREIGN KEY (`id_wilayah`) REFERENCES `wilayah` (`id_wilayah`);
--
-- Constraints for table `laporan`
--
ALTER TABLE `laporan`
ADD CONSTRAINT `laporan_ibfk_1` FOREIGN KEY (`id_pengguna`) REFERENCES `pengguna` (`id_pengguna`),
ADD CONSTRAINT `laporan_ibfk_2` FOREIGN KEY (`id_wilayah`) REFERENCES `wilayah` (`id_wilayah`),
ADD CONSTRAINT `laporan_ibfk_4` FOREIGN KEY (`id_kerusakan`) REFERENCES `kerusakan` (`id_kerusakan`),
ADD CONSTRAINT `laporan_ibfk_5` FOREIGN KEY (`id_bencana`) REFERENCES `bencana` (`id_bencana`);
--
-- Constraints for table `pengguna`
--
ALTER TABLE `pengguna`
ADD CONSTRAINT `pengguna_ibfk_1` FOREIGN KEY (`id_wilayah`) REFERENCES `wilayah` (`id_wilayah`);
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| 27.358065 | 191 | 0.644735 |
56b52fa528196616a82e0eef791ab2a45788b012 | 6,933 | ts | TypeScript | src/client/app/pages/cluster/overview/overview.component.ts | winifredTomlinson/cloudTask | da822edf44da8722361f9a51ef497744b799b895 | [
"Apache-2.0"
] | null | null | null | src/client/app/pages/cluster/overview/overview.component.ts | winifredTomlinson/cloudTask | da822edf44da8722361f9a51ef497744b799b895 | [
"Apache-2.0"
] | null | null | null | src/client/app/pages/cluster/overview/overview.component.ts | winifredTomlinson/cloudTask | da822edf44da8722361f9a51ef497744b799b895 | [
"Apache-2.0"
] | null | null | null | import { Component } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { GroupService, ContainerService, LogService, ClusterService, HubService } from './../../../services';
declare let _: any;
declare let messager: any;
@Component({
selector: 'overview',
templateUrl: 'overview.component.html',
styleUrls: ['./overview.component.css']
})
export class ClusterOverviewPage {
private groupInfo: any = {};
private containerFilter: string;
private containers: Array<any> = [];
private filterContainers: Array<any> = [];
private filterContainerDone: boolean;
private currentContainers: Array<any> = [];
private containerPageOption: any;
private containerPageIndex: number = 1;
private pageSize: number = 15;
private rmContainerTarget: any;
private rmContainerModalOptions: any = {};
private reAssignTarget: any;
private reAssignConfirmModalOptions: any = {};
private selectTag: string;
private candidateTags: Array<any> = [];
private upgradeContainerTarget: any;
private upgradeContainerModalOptions: any = {};
constructor(
private _route: ActivatedRoute,
private _router: Router,
private _containerService: ContainerService,
private _groupService: GroupService,
private _logService: LogService,
private _clusterService: ClusterService,
private _hubService: HubService) {
}
ngOnInit() {
this.containerPageOption = {
"boundaryLinks": false,
"directionLinks": true,
"hidenLabel": true
};
let modalCommonOptions = {
title: 'WARN',
show: false,
closable: false
};
this.rmContainerModalOptions = _.cloneDeep(modalCommonOptions);
this.upgradeContainerModalOptions = _.cloneDeep(modalCommonOptions);
this.upgradeContainerModalOptions.title = "Upgrade";
this.upgradeContainerModalOptions.hideFooter = true;
this.reAssignConfirmModalOptions = _.cloneDeep(modalCommonOptions);
this._route.params.forEach(params => {
let groupId = params['groupId'];
this.groupInfo.ID = groupId;
this._groupService.getById(groupId)
.then(data => {
this.groupInfo = data;
this.getContainers();
})
});
}
private getContainers() {
this._clusterService.getClusterContainers(this.groupInfo.ID)
.then(data => {
data = data.Data.Containers || [];
this.containers = _.sortBy(data, 'Config.Name');
this.containers.forEach(item => {
item.Containers = item.Containers || [];
item.Containers = _.sortBy(item.Containers, ['IP', "HostName"]);
item.IpTables = {};
item.Running = 0;
item.Stopped = 0;
item.Containers.forEach((subItem: any) => {
if (!item.IpTables[subItem.IP]) item.IpTables[subItem.IP] = { Running: 0, Stopped: 0 };
let stateText = '';
if (subItem.Container.Status.Running) {
stateText = 'Running';
item.IpTables[subItem.IP].Running++;
item.Running++;
} else {
stateText = 'Stopped';
item.IpTables[subItem.IP].Stopped++;
item.Stopped++;
}
if (subItem.Container.Status.Restarting) {
stateText = 'Restarting';
}
if (subItem.Container.Status.Paused) {
stateText = 'Paused';
}
if (subItem.Container.Status.Dead) {
stateText = 'Dead';
}
subItem.Container.Status.StatusText = stateText;
});
});
this.filterContainer();
})
.catch(err => {
messager.error(err.message || "Get containers failed");
});
}
private filterContainerTimeout: any;
private filterContainer(value?: any) {
this.containerFilter = value || '';
if (this.filterContainerTimeout) {
clearTimeout(this.filterContainerTimeout);
}
this.filterContainerTimeout = setTimeout(() => {
let keyWord = this.containerFilter;
if (!keyWord) {
this.filterContainers = this.containers;
} else {
let regex = new RegExp(keyWord, 'i');
this.filterContainers = this.containers.filter(item => {
return regex.test(item.Config.Name);
})
}
this.setContainerPage(this.containerPageIndex);
this.filterContainerDone = true;
}, 100);
}
private setContainerPage(pageIndex: number) {
this.containerPageIndex = pageIndex;
if (!this.filterContainers) return;
let start = (pageIndex - 1) * this.pageSize;
let end = start + this.pageSize;
this.currentContainers = this.filterContainers.slice(start, end);
}
private getStatsCls(status: any) {
let cls = 'success';
if (status.Dead || !status.Running) {
cls = 'danger';
}
if (status.Paused || status.Restarting) {
cls = 'yellow';
}
return cls;
}
private operate(container: any, action: string) {
this._clusterService.operate(container.MetaId, action)
.then(data => {
messager.success('succeed');
this._logService.addLog(`${action} container ${container.Config.Name} on ${this.groupInfo.Name}`, 'Cluster', this.groupInfo.ID);
this.getContainers();
})
.catch(err => {
messager.error(err);
});
}
private showReAssignConfirm(target: any) {
this.reAssignTarget = target;
this.reAssignConfirmModalOptions.show = true;
}
private reAssign() {
messager.error('not implement');
}
private showRmContainerModal(container: any) {
this.rmContainerTarget = container;
this.rmContainerModalOptions.show = true;
}
private rmContainer() {
this.rmContainerModalOptions.show = false;
let name = this.rmContainerTarget.Config.Name;
this._clusterService.deleteContainer(this.rmContainerTarget.MetaId)
.then(data => {
this._logService.addLog(`Deleted container ${name} on ${this.groupInfo.Name}`, 'Cluster', this.groupInfo.ID);
this.getContainers();
})
.catch((err) => {
messager.error(err);
});
}
private showUpgradeModal(target: any) {
this.upgradeContainerTarget = target;
this.selectTag = '';
let imageName = this.upgradeContainerTarget.Config.Image.replace(`${this.groupInfo.RegistryAdd}/`, '');
imageName = imageName.split(':')[0];
this._hubService.getTags(this.groupInfo.RegistryLocation, imageName, true)
.then(data => {
this.candidateTags = data;
this.upgradeContainerModalOptions.formSubmitted = false;
this.upgradeContainerModalOptions.show = true;
})
.catch(err => {
messager.error("Get tags failed. Please try again.")
});
}
private upgrade(form: any) {
this.upgradeContainerModalOptions.formSubmitted = true;
if (form.invalid) return;
let newImage = `${this.upgradeContainerTarget.Config.Image.split(':')[0]}:${form.value.newTag}`;
this._clusterService.upgradeImage(this.upgradeContainerTarget.MetaId, form.value.newTag)
.then(res => {
messager.success('succeed');
this.upgradeContainerModalOptions.show = false;
this._logService.addLog(`Upgrade container ${this.upgradeContainerTarget.Config.Name} from ${this.upgradeContainerTarget.Config.Image} to ${newImage} on ${this.groupInfo.Name}`, 'Cluster', this.groupInfo.ID);
this.getContainers();
})
.catch(err => messager.error(err));
}
} | 30.54185 | 212 | 0.69162 |
a8b34ed1d9c798054ffa1c8d4e2ae300100fb020 | 434 | asm | Assembly | programs/oeis/109/A109474.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/109/A109474.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/109/A109474.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A109474: a(1)=1, a(2)=3; thereafter, a(n) = least positive integer > a(n-1) and not equal to a(i)+a(j)+a(k) for 1<=i<=j<=k<=n-1.
; 1,3,4,13,14,23,24,33,34,43,44,53,54,63,64,73,74,83,84,93,94,103,104,113,114,123,124,133,134,143,144,153,154,163,164,173,174,183,184,193,194,203,204,213,214,223,224,233,234,243,244,253,254,263,264,273,274,283,284
mov $1,1
mov $2,$0
lpb $0,1
sub $0,1
trn $0,1
add $2,2
mov $1,$2
add $2,6
lpe
| 33.384615 | 213 | 0.626728 |
bcae6bb5f4873ca59fda521a0850acfd8fe6723d | 1,254 | js | JavaScript | src/server-communication/signaling-server/negotiationState/helpers/updateStateInformation.js | Temasys/SkylinkJS | 4eca29fd18989a4c55563707aae017a3c8a2011f | [
"Apache-2.0"
] | 275 | 2015-01-11T13:38:11.000Z | 2021-09-23T13:28:06.000Z | src/server-communication/signaling-server/negotiationState/helpers/updateStateInformation.js | Temasys/SkylinkJS | 4eca29fd18989a4c55563707aae017a3c8a2011f | [
"Apache-2.0"
] | 173 | 2015-01-13T02:17:47.000Z | 2022-03-24T04:24:35.000Z | src/server-communication/signaling-server/negotiationState/helpers/updateStateInformation.js | Temasys/SkylinkJS | 4eca29fd18989a4c55563707aae017a3c8a2011f | [
"Apache-2.0"
] | 67 | 2015-01-27T04:41:57.000Z | 2021-09-14T10:38:07.000Z | import { DATA_CHANNEL_STATE } from '../../../../constants';
import Skylink from '../../../../index';
import PeerMedia from '../../../../peer-media';
const updateStateInformation = (state, message) => {
const updatedState = state;
const {
userInfo, rid, mid, mediaInfoList,
} = message;
const { room } = updatedState;
const updatedUserInfo = userInfo;
const targetMid = mid;
if (userInfo && typeof userInfo === 'object') {
updatedUserInfo.settings.data = !!(updatedState.peerDataChannels[targetMid] && updatedState.peerDataChannels[targetMid].main && updatedState.peerDataChannels[targetMid].main.channel && updatedState.peerDataChannels[targetMid].main.channel.readyState === DATA_CHANNEL_STATE.OPEN);
updatedState.peerInformations[targetMid].settings = updatedUserInfo.settings || {};
updatedState.peerInformations[targetMid].mediaStatus = updatedUserInfo.mediaStatus || {};
updatedState.peerInformations[targetMid].userData = updatedUserInfo.userData;
}
Skylink.setSkylinkState(updatedState, rid);
PeerMedia.setPeerMediaInfo(room, targetMid, mediaInfoList);
PeerMedia.deleteUnavailableMedia(room, targetMid); // mediaState can be unavailable during renegotiation
};
export default updateStateInformation;
| 44.785714 | 283 | 0.748006 |
b99e942d7f6127d38c465b2e0b0c5ca0461cd066 | 2,828 | h | C | phys.h | Lallassu/voxelengine_urho3d | 2926ea8816e19957e7f12aa3dc720b05b611aee6 | [
"MIT"
] | 110 | 2018-03-26T11:32:28.000Z | 2022-03-24T15:31:34.000Z | phys.h | Lallassu/voxelengine_urho3d | 2926ea8816e19957e7f12aa3dc720b05b611aee6 | [
"MIT"
] | null | null | null | phys.h | Lallassu/voxelengine_urho3d | 2926ea8816e19957e7f12aa3dc720b05b611aee6 | [
"MIT"
] | 21 | 2018-03-26T19:51:01.000Z | 2022-03-20T05:16:26.000Z | #ifndef __PHYS_H__
#define __PHYS_H__
#include <string>
#include <vector>
#include <iostream>
#include <math.h>
#include <Urho3D/Core/CoreEvents.h>
#include <Urho3D/Engine/Engine.h>
#include <Urho3D/Graphics/Graphics.h>
#include <Urho3D/Graphics/Light.h>
#include <Urho3D/Graphics/Material.h>
#include <Urho3D/Graphics/Model.h>
#include <Urho3D/Graphics/StaticModel.h>
#include <Urho3D/Graphics/Zone.h>
#include <Urho3D/Physics/CollisionShape.h>
#include <Urho3D/Physics/PhysicsWorld.h>
#include <Urho3D/Physics/RigidBody.h>
#include <Urho3D/Resource/ResourceCache.h>
#include <Urho3D/Scene/LogicComponent.h>
#include <Urho3D/Core/Timer.h>
#include <Urho3D/Graphics/ParticleEffect.h>
#include <Urho3D/Graphics/ParticleEmitter.h>
#include <Urho3D/Core/Timer.h>
#include "chunk.h"
#include "constants.h"
#include "utils.h"
using namespace Urho3D;
using namespace utils;
class SimplePhysBlock
{
public:
SimplePhysBlock(Context*);
~SimplePhysBlock();
bool IsFree();
Vector4 GetColor();
Vector3 GetPosition();
void Update(float time, float delta);
void Set(Vector3, Vector3, Vector3, int, int type);
bool IsActive();
bool IsTimeout();
void Disable();
void Bounce(Vector3 pos);
Node* node;
bool free;
private:
float end_time;
Timer fly_time;
Context* context;
StaticModel* model;
int type;
float life;
float gravity;
float mass;
float vy;
float vx;
float vz;
float fx;
float fy;
float fz;
float scale;
int ptype;
Vector3 color;
Chunk *chunk;
float damage;
};
// Blocks
class PhysBlock // public LogicComponent
{
//URHO3D_OBJECT(PhysBlock, LogicComponent);
static const int OBJECT_VELOCITY = 10;
public:
PhysBlock(Context*);
~PhysBlock();
void Set(Vector3, Vector3, Vector3);
Vector3 GetPosition();
Vector4 GetColor();
bool IsActive();
bool IsTimeout();
void Disable();
bool IsFree();
Node* node;
private:
bool free;
float end_time;
Context* context;
StaticModel* model;
RigidBody* body;
CollisionShape* shape;
};
// Pool
class PhysPool: public LogicComponent
{
URHO3D_OBJECT(PhysPool, LogicComponent);
public:
PhysPool(Context*, int, int);
~PhysPool();
void Update(float time, float delta);
void Add(Vector3, Vector3, Vector3);
void AddRelative(Node*, Vector3, Vector3, Vector3);
void AddSimpleRelative(Node*, Vector3, Vector3, Vector3, int power);
void AddSimple(Vector3, Vector3, Vector3, int power, int type);
int Size();
int SimpleSize();
PhysBlock* GetBlock(int);
SimplePhysBlock* GetSimpleBlock(int);
private:
unsigned int rr_block;
unsigned int rr_sblock;
std::vector<SimplePhysBlock*> simple_blocks;
std::vector<PhysBlock*> blocks;
};
#endif
| 22.09375 | 72 | 0.689887 |
58451f4ba97402b55f30a2b2297b7c46376c45f0 | 832 | rs | Rust | src/query/regex.rs | 0xflotus/Toshi | 9d60d944a8b76b9d47dd8c40efe9570f50a4156a | [
"MIT"
] | null | null | null | src/query/regex.rs | 0xflotus/Toshi | 9d60d944a8b76b9d47dd8c40efe9570f50a4156a | [
"MIT"
] | null | null | null | src/query/regex.rs | 0xflotus/Toshi | 9d60d944a8b76b9d47dd8c40efe9570f50a4156a | [
"MIT"
] | null | null | null | use crate::query::CreateQuery;
use crate::{Error, Result};
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use tantivy::query::{Query, RegexQuery as TantivyRegexQuery};
use tantivy::schema::Schema;
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct RegexQuery {
regexp: HashMap<String, String>,
}
impl CreateQuery for RegexQuery {
fn create_query(self, schema: &Schema) -> Result<Box<Query>> {
if let Some((k, v)) = self.regexp.into_iter().take(1).next() {
let field = schema
.get_field(&k)
.ok_or_else(|| Error::QueryError(format!("Field: {} does not exist", k)))?;
Ok(Box::new(TantivyRegexQuery::new(v, field)))
} else {
Err(Error::QueryError("Query generation failed".into()))
}
}
}
| 32 | 91 | 0.625 |
bb443cc7408d2679f37bb46ebe592fbd606fd902 | 57 | sql | SQL | db/migrations/45_add_not_nill_constraint_to_framework_to_codebase.down.sql | epmd-edp/admin-console | fe389bccf95f5cb48f0d5e11c50eb5f560b37311 | [
"Apache-2.0"
] | 3 | 2019-12-14T14:53:20.000Z | 2021-05-06T17:25:25.000Z | db/migrations/45_add_not_nill_constraint_to_framework_to_codebase.down.sql | epam/edp-admin-console | 33e9d7518f6a24ddea16e2df7f0fcac41a27dd17 | [
"Apache-2.0"
] | null | null | null | db/migrations/45_add_not_nill_constraint_to_framework_to_codebase.down.sql | epam/edp-admin-console | 33e9d7518f6a24ddea16e2df7f0fcac41a27dd17 | [
"Apache-2.0"
] | 4 | 2021-03-12T11:58:18.000Z | 2022-02-21T11:51:29.000Z | alter table codebase alter column framework set not null; | 57 | 57 | 0.842105 |
43d43e11681d7db77eb68c9eaa60d4d5ff0d0473 | 8,403 | go | Go | op-node/withdrawals/utils.go | ethereum-optimism/optipus | 0a3df2614af5e33692c36035f6d38a4aa8d20ce2 | [
"MIT"
] | 1 | 2020-02-06T22:41:11.000Z | 2020-02-06T22:41:11.000Z | op-node/withdrawals/utils.go | ethereum-optimism/optipus | 0a3df2614af5e33692c36035f6d38a4aa8d20ce2 | [
"MIT"
] | null | null | null | op-node/withdrawals/utils.go | ethereum-optimism/optipus | 0a3df2614af5e33692c36035f6d38a4aa8d20ce2 | [
"MIT"
] | null | null | null | package withdrawals
import (
"context"
"errors"
"fmt"
"math/big"
"time"
"github.com/ethereum-optimism/optimism/op-bindings/bindings"
"github.com/ethereum-optimism/optimism/op-node/predeploy"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/ethclient/gethclient"
"github.com/ethereum/go-ethereum/rlp"
"github.com/ethereum/go-ethereum/rpc"
)
// WaitForFinalizationPeriod waits until the timestamp has been submitted to the L2 Output Oracle on L1 and
// then waits for the finalization period to be up.
// This functions polls and can block for a very long time if used on mainnet.
// This returns the timestamp to use for the proof generation.
func WaitForFinalizationPeriod(ctx context.Context, client *ethclient.Client, portalAddr common.Address, timestamp uint64) (uint64, error) {
opts := &bind.CallOpts{Context: ctx}
timestampBig := new(big.Int).SetUint64(timestamp)
portal, err := bindings.NewOptimismPortalCaller(portalAddr, client)
if err != nil {
return 0, err
}
l2OOAddress, err := portal.L2ORACLE(opts)
if err != nil {
return 0, err
}
l2OO, err := bindings.NewL2OutputOracleCaller(l2OOAddress, client)
if err != nil {
return 0, err
}
finalizationPeriod, err := portal.FINALIZATIONPERIODSECONDS(opts)
if err != nil {
return 0, err
}
next, err := l2OO.LatestBlockTimestamp(opts)
if err != nil {
return 0, err
}
// Now poll
var ticker *time.Ticker
diff := new(big.Int).Sub(timestampBig, next)
if diff.Cmp(big.NewInt(60)) > 0 {
ticker = time.NewTicker(time.Minute)
} else {
ticker = time.NewTicker(time.Second)
}
loop:
for {
select {
case <-ticker.C:
next, err = l2OO.LatestBlockTimestamp(opts)
if err != nil {
return 0, err
}
// Already passed next
if next.Cmp(timestampBig) > 0 {
break loop
}
case <-ctx.Done():
return 0, ctx.Err()
}
}
// Now wait for it to be finalized
output, err := l2OO.GetL2Output(opts, next)
if err != nil {
return 0, err
}
targetTimestamp := new(big.Int).Add(output.Timestamp, finalizationPeriod)
targetTime := time.Unix(targetTimestamp.Int64(), 0)
// Assume clock is relatively correct
time.Sleep(time.Until(targetTime))
// Poll for L1 Block to have a time greater than the target time
ticker = time.NewTicker(time.Second)
for {
select {
case <-ticker.C:
header, err := client.HeaderByNumber(ctx, nil)
if err != nil {
return 0, err
}
if header.Time > targetTimestamp.Uint64() {
return next.Uint64(), nil
}
case <-ctx.Done():
return 0, ctx.Err()
}
}
}
type ProofClient interface {
TransactionReceipt(context.Context, common.Hash) (*types.Receipt, error)
GetProof(context.Context, common.Address, []string, *big.Int) (*gethclient.AccountResult, error)
}
type ec = *ethclient.Client
type gc = *gethclient.Client
type Client struct {
ec
gc
}
// Ensure that ProofClient and Client interfaces are valid
var _ ProofClient = &Client{}
// NewClient wraps a RPC client with both ethclient and gethclient methods.
// Implements ProofClient
func NewClient(client *rpc.Client) *Client {
return &Client{
ethclient.NewClient(client),
gethclient.New(client),
}
}
// FinalizedWithdrawalParameters is the set of paramets to pass to the FinalizedWithdrawal function
type FinalizedWithdrawalParameters struct {
Nonce *big.Int
Sender common.Address
Target common.Address
Value *big.Int
GasLimit *big.Int
Timestamp *big.Int
Data []byte
OutputRootProof bindings.WithdrawalVerifierOutputRootProof
WithdrawalProof []byte // RLP Encoded list of trie nodes to prove L2 storage
}
// FinalizeWithdrawalParameters queries L2 to generate all withdrawal parameters and proof necessary to finalize an withdrawal on L1.
// The header provided is very imporant. It should be a block (timestamp) for which there is a submitted output in the L2 Output Oracle
// contract. If not, the withdrawal will fail as it the storage proof cannot be verified if there is no submitted state root.
func FinalizeWithdrawalParameters(ctx context.Context, l2client ProofClient, txHash common.Hash, header *types.Header) (FinalizedWithdrawalParameters, error) {
// Transaction receipt
receipt, err := l2client.TransactionReceipt(ctx, txHash)
if err != nil {
return FinalizedWithdrawalParameters{}, err
}
// Parse the receipt
ev, err := ParseWithdrawalInitiated(receipt)
if err != nil {
return FinalizedWithdrawalParameters{}, err
}
// Generate then verify the withdrawal proof
withdrawalHash, err := WithdrawalHash(ev)
if err != nil {
return FinalizedWithdrawalParameters{}, err
}
slot := StorageSlotOfWithdrawalHash(withdrawalHash)
p, err := l2client.GetProof(ctx, predeploy.WithdrawalContractAddress, []string{slot.String()}, header.Number)
if err != nil {
return FinalizedWithdrawalParameters{}, err
}
// TODO: Could skip this step, but it's nice to double check it
err = VerifyProof(header.Root, p)
if err != nil {
return FinalizedWithdrawalParameters{}, err
}
if len(p.StorageProof) != 1 {
return FinalizedWithdrawalParameters{}, errors.New("invalid amount of storage proofs")
}
// Encode it as expected by the contract
trieNodes := make([][]byte, len(p.StorageProof[0].Proof))
for i, s := range p.StorageProof[0].Proof {
trieNodes[i] = common.FromHex(s)
}
withdrawalProof, err := rlp.EncodeToBytes(trieNodes)
if err != nil {
return FinalizedWithdrawalParameters{}, err
}
return FinalizedWithdrawalParameters{
Nonce: ev.Nonce,
Sender: ev.Sender,
Target: ev.Target,
Value: ev.Value,
GasLimit: ev.GasLimit,
Timestamp: new(big.Int).SetUint64(header.Time),
Data: ev.Data,
OutputRootProof: bindings.WithdrawalVerifierOutputRootProof{
Version: [32]byte{}, // Empty for version 1
StateRoot: header.Root,
WithdrawerStorageRoot: p.StorageHash,
LatestBlockhash: header.Hash(),
},
WithdrawalProof: withdrawalProof,
}, nil
}
// Standard ABI types copied from golang ABI tests
var (
Uint256Type, _ = abi.NewType("uint256", "", nil)
BytesType, _ = abi.NewType("bytes", "", nil)
AddressType, _ = abi.NewType("address", "", nil)
)
// WithdrawalHash computes the hash of the withdrawal that was stored in the L2 withdrawal contract state.
// TODO:
// - I don't like having to use the ABI Generated struct
// - There should be a better way to run the ABI encoding
// - These needs to be fuzzed against the solidity
func WithdrawalHash(ev *bindings.L2ToL1MessagePasserWithdrawalInitiated) (common.Hash, error) {
// abi.encode(nonce, msg.sender, _target, msg.value, _gasLimit, _data)
args := abi.Arguments{
{Name: "nonce", Type: Uint256Type},
{Name: "sender", Type: AddressType},
{Name: "target", Type: AddressType},
{Name: "value", Type: Uint256Type},
{Name: "gasLimit", Type: Uint256Type},
{Name: "data", Type: BytesType},
}
enc, err := args.Pack(ev.Nonce, ev.Sender, ev.Target, ev.Value, ev.GasLimit, ev.Data)
if err != nil {
return common.Hash{}, fmt.Errorf("failed to pack for withdrawal hash: %w", err)
}
return crypto.Keccak256Hash(enc), nil
}
// ParseWithdrawalInitiated parses
func ParseWithdrawalInitiated(receipt *types.Receipt) (*bindings.L2ToL1MessagePasserWithdrawalInitiated, error) {
contract, err := bindings.NewL2ToL1MessagePasser(common.Address{}, nil)
if err != nil {
return nil, err
}
if len(receipt.Logs) != 1 {
return nil, errors.New("invalid length of logs")
}
ev, err := contract.ParseWithdrawalInitiated(*receipt.Logs[0])
if err != nil {
return nil, fmt.Errorf("failed to parse log: %w", err)
}
return ev, nil
}
// StorageSlotOfWithdrawalHash determines the storage slot of the Withdrawer contract to look at
// given a WithdrawalHash
func StorageSlotOfWithdrawalHash(hash common.Hash) common.Hash {
// The withdrawals mapping is the second (0 indexed) storage element in the Withdrawer contract.
// To determine the storage slot, use keccak256(withdrawalHash ++ p)
// Where p is the 32 byte value of the storage slot and ++ is concatenation
buf := make([]byte, 64)
copy(buf, hash[:])
buf[63] = 1
return crypto.Keccak256Hash(buf)
}
| 31.709434 | 159 | 0.719148 |
3c0c2d82a9f6c86b603ee366ce30d2d141a448cf | 1,313 | kt | Kotlin | packages/webservice/models/src/main/kotlin/com/yahoo/navi/ws/models/checks/DefaultAuthorCheck.kt | DekusDenial/framework | 46531c57fbc86dde3d2179aa199debce4db5522f | [
"MIT"
] | null | null | null | packages/webservice/models/src/main/kotlin/com/yahoo/navi/ws/models/checks/DefaultAuthorCheck.kt | DekusDenial/framework | 46531c57fbc86dde3d2179aa199debce4db5522f | [
"MIT"
] | null | null | null | packages/webservice/models/src/main/kotlin/com/yahoo/navi/ws/models/checks/DefaultAuthorCheck.kt | DekusDenial/framework | 46531c57fbc86dde3d2179aa199debce4db5522f | [
"MIT"
] | null | null | null | /**
* Copyright 2020, Yahoo Holdings Inc.
* Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms.
*/
package com.yahoo.navi.ws.models.checks
import com.yahoo.elide.core.Path
import com.yahoo.elide.core.filter.Operator
import com.yahoo.elide.core.filter.predicates.FilterPredicate
import com.yahoo.elide.core.security.RequestScope
import com.yahoo.elide.core.security.checks.FilterExpressionCheck
import com.yahoo.elide.core.type.ClassType.STRING_TYPE
import com.yahoo.elide.core.type.Type
import com.yahoo.elide.core.utils.TypeHelper.getClassType
import com.yahoo.navi.ws.models.beans.HasAuthor
import com.yahoo.navi.ws.models.beans.User
open class DefaultAuthorCheck : FilterExpressionCheck<HasAuthor>() {
companion object {
const val IS_AUTHOR = "is author"
}
override fun getFilterExpression(entityClass: Type<*>, requestScope: RequestScope): FilterPredicate {
val userClassType = getClassType(User::class.java)
val hasAuthorPath = Path.PathElement(entityClass, userClassType, "author")
val userPath = Path.PathElement(userClassType, STRING_TYPE, "id")
val path = Path(listOf(hasAuthorPath, userPath))
val value = listOf(requestScope.user.name)
return FilterPredicate(path, Operator.IN, value)
}
}
| 42.354839 | 105 | 0.763899 |
0beed44001c896723e1ba67a134f0796ec7a66d8 | 834 | js | JavaScript | v4/webpack.config.js | davidcostadev/webpack-compare | 931573f99c35f950007b7f74c6565041c66a438d | [
"MIT"
] | null | null | null | v4/webpack.config.js | davidcostadev/webpack-compare | 931573f99c35f950007b7f74c6565041c66a438d | [
"MIT"
] | null | null | null | v4/webpack.config.js | davidcostadev/webpack-compare | 931573f99c35f950007b7f74c6565041c66a438d | [
"MIT"
] | null | null | null | const path = require('path');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
module.exports = {
mode: 'development',
entry: {
one: './src/one.js',
two: './src/two.js',
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'public'),
},
plugins: [
new BundleAnalyzerPlugin(),
],
optimization: {
splitChunks: {
chunks: "all",
cacheGroups: {
vendor: { //v2
name: 'vendor',
test: /[\\/]node_modules[\\/]/,
chunks: 'initial',
priority: -10
},
default: {
name: 'commons',
chunks: 'initial',
minChunks: 2,
priority: -20,
reuseExistingChunk: true,
enforce: true,
minSize: 0,
}
}
}
}
} | 21.384615 | 85 | 0.503597 |
c4207e4781288257f57a09d7d7f781a0c8d20846 | 702 | h | C | Karathen-IOS/karathen/Network/request/CCFindPageRequest.h | karathen/Karathen-iOS | 4154af142405793d10e2b24ab9635ed779540244 | [
"MIT"
] | 2 | 2019-05-23T04:22:42.000Z | 2020-12-25T00:26:07.000Z | Karathen-IOS/karathen/Network/request/CCFindPageRequest.h | karathen/Karathen-iOS | 4154af142405793d10e2b24ab9635ed779540244 | [
"MIT"
] | null | null | null | Karathen-IOS/karathen/Network/request/CCFindPageRequest.h | karathen/Karathen-iOS | 4154af142405793d10e2b24ab9635ed779540244 | [
"MIT"
] | 1 | 2019-07-10T07:22:50.000Z | 2019-07-10T07:22:50.000Z | //
// CCFindPageRequest.h
// Karathen
//
// Created by Karathen on 2018/8/8.
// Copyright © 2018年 raistone. All rights reserved.
//
#import "CCRequest.h"
@class CCFindPageSingle, CCFindPageModel;
@interface CCFindPageRequest : CCRequest
@property (nonatomic, strong) NSArray *dataArray;
- (void)requsetCompletion:(void(^)(void))completion;
@end
@interface CCFindPageModel : NSObject
@property (nonatomic, strong) NSString *title;
@property (nonatomic, strong) NSArray <CCFindPageSingle *> *content;
@end
@interface CCFindPageSingle : NSObject
@property (nonatomic, strong) NSString *link;
@property (nonatomic, strong) NSString *name;
@property (nonatomic, strong) NSString *pic;
@end
| 19.5 | 68 | 0.74359 |
0cd35d400b8ba8d38cccab4e5289309cd18ed0ce | 2,773 | py | Python | src/bot/lib/economy/economy.py | rdunc/rybot | ec3bf6159e095b53e69f6f81af9f10739c180b42 | [
"MIT"
] | 1 | 2016-01-11T02:10:05.000Z | 2016-01-11T02:10:05.000Z | src/bot/lib/economy/economy.py | rdunc/RyBot | ec3bf6159e095b53e69f6f81af9f10739c180b42 | [
"MIT"
] | null | null | null | src/bot/lib/economy/economy.py | rdunc/RyBot | ec3bf6159e095b53e69f6f81af9f10739c180b42 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import requests, json, threading, sys
import collections, os, time
from bot.lib.economy import EconomyInit
from bot.lib.core.benchmark import Benchmark
from bot.lib.core.log import Log
from bot.helpers.color_helper import ColorHelper
from bot.helpers.rybot_helper import RyBotHelper
from collections import Counter
class Economy(EconomyInit):
"""Give all offline and online chatters points."""
def give_points(self):
config = self.config
debug = config["debug"]
point_timer = config["give_points_timer"]
api_chatters_url = config["twitch_chatters_url"]
economy_path = "db/" + self.channel + "/economy.json"
try:
twitch_request = requests.get(api_chatters_url + self.channel + "/chatters")
chatters_json = twitch_request.json()
if debug:
time_1 = Benchmark.start()
with open(economy_path, "r") as of:
file_chatters = of.read()
of.close()
if len(file_chatters) > 0:
file_chatters = json.loads(file_chatters)
if debug:
Log.economy("Current file chatters count: {0}".format(len(file_chatters)))
api_chatters = chatters_json["chatters"]["viewers"]
chatters_dictionary = {}
for i in api_chatters:
chatters_dictionary[i] = 1
if debug:
Log.economy("1 point was added to: {0}".format(i))
if len(file_chatters) > 0:
merged_chatters = [chatters_dictionary, file_chatters]
merged_chatters = sum((Counter(dict(i)) for i in merged_chatters), Counter())
else:
merged_chatters = chatters_dictionary
with open(economy_path, "w") as of:
json.dump(merged_chatters, of)
of.close()
Log.economy("1 point was added to {0} {1}".format(len(merged_chatters), RyBotHelper.pluralize(len(merged_chatters), "chatter")))
if debug:
Log.economy("Current chatters from API: {0}".format(len(chatters_dictionary)))
Benchmark.stop(time_1)
except json.decoder.JSONDecodeError:
Log.error("Problem decoding the JSON. Unable to distribute points.")
except requests.exceptions.ConnectionError:
Log.error("Unable to connect to the Twitch API.")
except TypeError:
Log.error("Error finding the viewers.")
except FileNotFoundError:
Log.error("Economy file not found. Unable to distribute points.")
| 39.056338 | 141 | 0.582402 |
dd1d15c63d20ab4ba5f2ff970c96c873c680b549 | 1,318 | swift | Swift | App/isowordsUITests/OnboardingTests.swift | bitrise-io/isowords | 5dc3a8445482a0b27c852df0e72a6d65900ef884 | [
"PostgreSQL"
] | null | null | null | App/isowordsUITests/OnboardingTests.swift | bitrise-io/isowords | 5dc3a8445482a0b27c852df0e72a6d65900ef884 | [
"PostgreSQL"
] | null | null | null | App/isowordsUITests/OnboardingTests.swift | bitrise-io/isowords | 5dc3a8445482a0b27c852df0e72a6d65900ef884 | [
"PostgreSQL"
] | null | null | null | //
// OnboardingTests.swift
// isowordsUITests
//
// Created by Shams Ahmed on 12/07/2021.
//
import XCTest
extension isowordsUITests {
// MARK: - Tests
func testOnboarding_intro() throws {
let app = XCUIApplication()
if app.state == .notRunning {
app.launch()
}
sleep(5)
// next
let button = app.buttons.element(boundBy: 1)
// next
button.tap()
sleep(2)
//next
button.tap()
sleep(2)
// press letter
app.otherElements.element(boundBy: 2).tap()
sleep(1)
skipOnboarding()
// scroll down
app.scrollViews.firstMatch.swipeUp()
app.scrollViews.firstMatch.swipeUp()
sleep(15)
}
// MARK: - Helper
func skipOnboarding() {
let app = XCUIApplication()
sleep(2)
// skip
app.buttons["Skip"].tap()
sleep(5)
// confirm - Yes, skip
app.buttons["Yes, skip"].tap()
// random press
app.otherElements.firstMatch.tap()
// Get started
app.buttons.firstMatch.tap()
sleep(2)
}
}
| 18.305556 | 52 | 0.462822 |
ae450a25d34234d6f9e19a620b77792d44b73b8c | 350 | sql | SQL | GastosDB/alter_20121006.sql | pedroren/gastosappvue | 96205f2c43965c019adc377bb941960493271721 | [
"MIT"
] | null | null | null | GastosDB/alter_20121006.sql | pedroren/gastosappvue | 96205f2c43965c019adc377bb941960493271721 | [
"MIT"
] | null | null | null | GastosDB/alter_20121006.sql | pedroren/gastosappvue | 96205f2c43965c019adc377bb941960493271721 | [
"MIT"
] | null | null | null | USE gastosdb
go
CREATE TABLE Facturas(
FacturaID INT IDENTITY(1,1) PRIMARY KEY,
Nombre NVARCHAR(100) NULL,
DescripFrecuenteId INT NULL,
Frecuencia CHAR(1) NOT NULL DEFAULT 'M',
Dia SMALLINT NOT NULL,
Mes SMALLINT NULL,
ProxFecha DATETIME,
UltFecha DATETIME NULL,
UltMonto DECIMAL(18,2) NULL,
Activo BIT NOT NULL DEFAULT 1,
UsuarioId int NOT NULL)
GO | 21.875 | 40 | 0.791429 |
e76f9b9cbcc111d6ea595aa691dbd647ab333907 | 1,603 | js | JavaScript | code/js/devtools.js | avrahamappel/laravel-testtools | 0b7fa69d0fd5cf5592439712c7679330a1bf34c6 | [
"MIT"
] | 531 | 2016-03-21T16:21:37.000Z | 2022-02-17T05:00:27.000Z | code/js/devtools.js | avrahamappel/laravel-testtools | 0b7fa69d0fd5cf5592439712c7679330a1bf34c6 | [
"MIT"
] | 25 | 2016-03-21T19:21:48.000Z | 2019-04-12T06:56:22.000Z | code/js/devtools.js | avrahamappel/laravel-testtools | 0b7fa69d0fd5cf5592439712c7679330a1bf34c6 | [
"MIT"
] | 54 | 2016-03-22T09:46:56.000Z | 2021-06-04T00:01:42.000Z | // Create a connection to the background page
var backgroundPageConnection = chrome.runtime.connect({
name: "panel"
});
var tab_id = chrome.devtools.inspectedWindow.tabId;
backgroundPageConnection.postMessage({
name: 'init',
tabId: chrome.devtools.inspectedWindow.tabId
});
chrome.devtools.panels.create("Laravel TestTools", null, "../html/panel.html", function(extensionPanel) {
var _window;
var steps;
extensionPanel.onShown.addListener(function tmp(panelWindow) {
extensionPanel.onShown.removeListener(tmp); // Run once
_window = panelWindow;
_window._postMessage = function(obj) {
backgroundPageConnection.postMessage({
"name": "postMessage",
"tabId": tab_id,
"object": obj
});
};
// Initialize
if (steps) {
_window.setSteps(steps);
} else {
_window._postMessage({
"method": "getSteps"
});
}
chrome.devtools.inspectedWindow.eval(
"window.location.pathname",
function(result) {
_window.setPathname(result);
}
);
});
backgroundPageConnection.onMessage.addListener(function (message) {
if (message.factories) {
backgroundPageConnection.postMessage({
"name": "setFactories",
"tabId": tab_id,
"factories": message.factories
});
} else {
if (_window) {
_window.setSteps(message);
} else {
steps = message;
}
}
});
}
);
| 25.046875 | 105 | 0.570805 |
5a3ec7a97d702339f4e24a1c4b8affe81204fc2f | 3,157 | swift | Swift | ios/Classes/SwiftAppCenterBundleSdkPlugin.swift | leovu/flutter_appcenter_bundle | 4c8a66f428202debcfbb5306f81cc233d22cd285 | [
"MIT"
] | 1 | 2021-04-23T04:21:48.000Z | 2021-04-23T04:21:48.000Z | ios/Classes/SwiftAppCenterBundleSdkPlugin.swift | leovu/flutter_appcenter_bundle | 4c8a66f428202debcfbb5306f81cc233d22cd285 | [
"MIT"
] | 1 | 2021-06-09T07:23:39.000Z | 2021-06-09T07:23:39.000Z | ios/Classes/SwiftAppCenterBundleSdkPlugin.swift | leovu/flutter_appcenter_bundle | 4c8a66f428202debcfbb5306f81cc233d22cd285 | [
"MIT"
] | 1 | 2021-06-09T07:20:35.000Z | 2021-06-09T07:20:35.000Z | import Flutter
import UIKit
import AppCenter
import AppCenterAnalytics
import AppCenterCrashes
import AppCenterDistribute
public class SwiftAppCenterBundleSdkPlugin: NSObject, FlutterPlugin {
public static func register(with registrar: FlutterPluginRegistrar) {
let channel = FlutterMethodChannel(name: "it.sarni.flutter_flutter_appcenter_bundle", binaryMessenger: registrar.messenger())
let instance = SwiftAppCenterBundleSdkPlugin()
registrar.addMethodCallDelegate(instance, channel: channel)
}
public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
debugPrint(call.method)
switch call.method {
case "start":
guard let args:[String: Any] = (call.arguments as? [String: Any]) else {
result(FlutterError(code: "400", message: "Bad arguments", details: "iOS could not recognize flutter arguments in method: (start)") )
return
}
let secret = args["secret"] as! String
let usePrivateTrack = args["usePrivateTrack"] as! Bool
if (usePrivateTrack) {
Distribute.updateTrack = .private
}
AppCenter.logLevel = .verbose
AppCenter.start(withAppSecret: secret, services:[
Analytics.self,
Crashes.self,
Distribute.self,
])
case "trackEvent":
trackEvent(call: call, result: result)
return
case "isDistributeEnabled":
result(Distribute.enabled)
return
case "getInstallId":
result(AppCenter.installId.uuidString)
return
case "configureDistribute":
Distribute.enabled = call.arguments as! Bool
case "configureDistributeDebug":
result(nil)
return
case "disableAutomaticCheckForUpdate":
Distribute.disableAutomaticCheckForUpdate()
case "checkForUpdate":
Distribute.checkForUpdate()
case "isCrashesEnabled":
result(Crashes.enabled)
return
case "configureCrashes":
Crashes.enabled = (call.arguments as! Bool)
case "isAnalyticsEnabled":
result(Analytics.enabled)
return
case "configureAnalytics":
Analytics.enabled = (call.arguments as! Bool)
default:
result(FlutterMethodNotImplemented);
return
}
result(nil);
}
private func trackEvent(call: FlutterMethodCall, result: FlutterResult) {
guard let args:[String: Any] = (call.arguments as? [String: Any]) else {
result(FlutterError(code: "400", message: "Bad arguments", details: "iOS could not recognize flutter arguments in method: (trackEvent)") )
return
}
let name = args["name"] as? String
let properties = args["properties"] as? [String: String]
if(name != nil) {
Analytics.trackEvent(name!, withProperties: properties)
}
result(nil)
}
}
| 36.287356 | 154 | 0.601204 |
9bec09717a6d91f036b3ae7ad06673dcdd2274bb | 7,512 | sql | SQL | blood_donor.sql | Anamika990/E-Blood-Donor-Project | b45ab9792b79521bfb6ec2228cfeca61aeef1d40 | [
"MIT"
] | null | null | null | blood_donor.sql | Anamika990/E-Blood-Donor-Project | b45ab9792b79521bfb6ec2228cfeca61aeef1d40 | [
"MIT"
] | null | null | null | blood_donor.sql | Anamika990/E-Blood-Donor-Project | b45ab9792b79521bfb6ec2228cfeca61aeef1d40 | [
"MIT"
] | null | null | null | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 03, 2019 at 06:35 PM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.2.16
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `blood_donor`
--
-- --------------------------------------------------------
--
-- Table structure for table `admin`
--
CREATE TABLE `admin` (
`id` int(11) NOT NULL,
`name` varchar(250) NOT NULL,
`password` varchar(250) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `admin`
--
INSERT INTO `admin` (`id`, `name`, `password`) VALUES
(1, 'Tushar Ahmed', '1234');
-- --------------------------------------------------------
--
-- Table structure for table `bloodrequestinfo`
--
CREATE TABLE `bloodrequestinfo` (
`id` int(11) NOT NULL,
`name` varchar(250) NOT NULL,
`phonenumber` varchar(250) NOT NULL,
`bloodgroup` varchar(250) NOT NULL,
`bloodamount` int(11) NOT NULL,
`patientlocation` varchar(250) NOT NULL,
`patientdistrict` varchar(250) NOT NULL,
`donationdate` date NOT NULL,
`moremessage` varchar(250) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `bloodrequestinfo`
--
INSERT INTO `bloodrequestinfo` (`id`, `name`, `phonenumber`, `bloodgroup`, `bloodamount`, `patientlocation`, `patientdistrict`, `donationdate`, `moremessage`) VALUES
(1, 'Tushar Ahmed', '01627560336', 'O positive(+)', 2, 'square hospital, prantopath', 'Dhaka', '2019-07-29', 'Argent needed Place contact me!'),
(2, 'Masud Rana', '01726456735', 'B positive(+)', 2, 'square hospital, prantopath', 'Dhaka', '2019-07-31', 'Urgently needed blood. So, contact me!'),
(3, 'tushar ahmed', '01627560336', 'O positive(+)', 2, '', '', '0000-00-00', ''),
(4, 'Mehedi Hasan', '01726456735', 'B negative(-)', 1, 'square hospital, prantopath', 'Bramonbaria', '2019-07-31', 'Urgently needed. place contract me '),
(5, 'Arman hossani', '01726456735', 'B positive(+)', 1, 'Labid hospital, kolabagan', 'Dhaka', '2019-08-02', 'Urgently needed blood!'),
(6, 'Mehedi Hasan', '01726456735', 'B negative(-)', 1, 'Labid hospital, kolabagan', 'Cumilla', '2019-08-24', 'Urgently needed!'),
(7, 'komol ', '01726456735', 'A positive(+)', 1, 'square hospital, prantopath', 'Mymansing', '2019-09-05', 'Urgently needed A+ blood');
-- --------------------------------------------------------
--
-- Table structure for table `donorinfo`
--
CREATE TABLE `donorinfo` (
`id` int(11) NOT NULL,
`name` varchar(250) NOT NULL,
`phonenumber` varchar(250) NOT NULL,
`bloodgroup` varchar(250) NOT NULL,
`email` varchar(250) NOT NULL,
`address` varchar(250) NOT NULL,
`bloodamount` int(11) NOT NULL,
`password` varchar(250) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `donorinfo`
--
INSERT INTO `donorinfo` (`id`, `name`, `phonenumber`, `bloodgroup`, `email`, `address`, `bloodamount`, `password`) VALUES
(1, 'tushar', '01627560336', 'O positive(+)', 'tusharahmed16135@gmail.com', 'cumilla', 2, ''),
(2, 'Mehedi Hasan', '01627456323', 'A positive(+)', 'mehedi23@gmail.com', 'cumilla', 2, ''),
(3, 'Ashik', '01837564773', 'B positive(+)', 'ashik3@gmail.com', 'Dhaka', 1, ''),
(4, 'pranto', '01526345623', 'A negative(-)', 'pranto25@gmail.com', 'chittagong', 1, ''),
(5, 'Masud Rana', '08978653521', 'B negative(-)', 'masud@gmail.com', 'Rongpur', 2, ''),
(6, 'ali', '01627560336', 'B positive(+)', 'ali@gmail.com', 'Nator', 1, ''),
(7, 'alam', '01726456735', 'A negative(-)', 'alam@gmail.com', 'Rongpur', 1, ''),
(8, 'alam', '01627560336', 'A negative(-)', 'alam@gmail.com', 'chittagong', 2, ''),
(9, 'sagor', '01726456735', 'A negative(-)', 'sagor@gmail.com', 'chittagong', 1, ''),
(10, 'salek', '01627456323', 'A positive(+)', 'salek@gmail.com', 'Dhaka', 2, ''),
(11, 'sujib', '01526345623', 'A positive(+)', 'sujib@gmail.com', 'Dhaka', 1, ''),
(12, 'arman', '01627456323', 'B negative(-)', 'arman@gmail.com', 'Rongpur', 1, ''),
(13, 'alif', '01726456735', 'A positive(+)', 'alif@gmail.com', 'Nator', 2, ''),
(14, 'aksh', '01726456735', 'B negative(-)', 'ashik3@gmail.com', 'cumilla', 2, ''),
(15, 'Mehedi Hasan', '01837564773', 'B positive(+)', 'mehedi23@gmail.com', 'chittagong', 1, ''),
(16, 'tushar ahmed', '01726456735', 'B positive(+)', 'tusharahmed16135@gmail.com', 'chittagong', 1, ''),
(17, 'akbar', '01526345623', 'AB negative(-)', 'akbar@gmail.com', 'chittagong', 1, ''),
(18, 'nurul', '01627456323', 'AB positive(+)', 'nurul@gmail.com', 'Dhaka', 2, ''),
(19, 'Toiob ', '01627560336', 'O negative(-)', 'toiob34@gmail.com', 'cumilla', 1, ''),
(20, 'Tushar Khan', '01627560336', 'O positive(+)', 'tusharahmed16135@gmail.com', 'Muradnagare, Cumilla', 1, '81dc9bdb52d04dc20036dbd8313ed055'),
(21, 'Arman', '01726456735', 'A positive(+)', 'arman@gmail.com', 'Dhanmondi, Dhaka', 2, '202cb962ac59075b964b07152d234b70'),
(22, 'mridula', '01627560336', 'A negative(-)', 'mridula@gmail.com', 'Dhanmondi, Dhaka', 1, '202cb962ac59075b964b07152d234b70'),
(23, 'Sanjida', '01726456735', 'O positive(+)', 'akter35-2218@diu.edu.bd', 'Dhanmondi, Dhaka', 1, '81dc9bdb52d04dc20036dbd8313ed055'),
(24, 'komol', '01627456323', 'B negative(-)', 'komol@gmail.com', 'Dhanmondi, Dhaka', 3, '81dc9bdb52d04dc20036dbd8313ed055');
-- --------------------------------------------------------
--
-- Table structure for table `registrationinfo`
--
CREATE TABLE `registrationinfo` (
`id` int(11) NOT NULL,
`name` varchar(250) NOT NULL,
`email` varchar(250) NOT NULL,
`phone` varchar(250) NOT NULL,
`password` varchar(250) NOT NULL,
`address` varchar(250) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `registrationinfo`
--
INSERT INTO `registrationinfo` (`id`, `name`, `email`, `phone`, `password`, `address`) VALUES
(1, 'Tushar Ahmed', 'tusharahmed16135@gmail.com', '01627560336', '81dc9bdb52d04dc20036dbd8313ed055', 'Cumilla'),
(2, 'Rabbi', 'Rabbi@gamil.com', '01627560336', '81dc9bdb52d04dc20036dbd8313ed055', 'Cumilla');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `admin`
--
ALTER TABLE `admin`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `bloodrequestinfo`
--
ALTER TABLE `bloodrequestinfo`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `donorinfo`
--
ALTER TABLE `donorinfo`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `registrationinfo`
--
ALTER TABLE `registrationinfo`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `admin`
--
ALTER TABLE `admin`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `bloodrequestinfo`
--
ALTER TABLE `bloodrequestinfo`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT for table `donorinfo`
--
ALTER TABLE `donorinfo`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25;
--
-- AUTO_INCREMENT for table `registrationinfo`
--
ALTER TABLE `registrationinfo`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| 36.643902 | 165 | 0.647231 |
bf8d951716de36f372fea6f872f6413a033de805 | 150 | kt | Kotlin | test/src/main/kotlin/iokotest/kotest/extensions/robolectric/MainApplication.kt | matsudamper/kotest-extensions-robolectric | ed8ac0e158c950db1eb1a6710fa0edb4e43d2de6 | [
"Apache-2.0"
] | 3 | 2021-03-11T17:48:32.000Z | 2021-04-22T19:06:22.000Z | test/src/main/kotlin/iokotest/kotest/extensions/robolectric/MainApplication.kt | matsudamper/kotest-extensions-robolectric | ed8ac0e158c950db1eb1a6710fa0edb4e43d2de6 | [
"Apache-2.0"
] | 8 | 2021-06-29T02:20:00.000Z | 2022-02-04T06:30:17.000Z | test/src/main/kotlin/iokotest/kotest/extensions/robolectric/MainApplication.kt | matsudamper/kotest-extensions-robolectric | ed8ac0e158c950db1eb1a6710fa0edb4e43d2de6 | [
"Apache-2.0"
] | 3 | 2021-05-26T10:52:32.000Z | 2021-11-08T11:32:56.000Z | package iokotest.kotest.extensions.robolectric
import androidx.multidex.MultiDexApplication
class MainApplication : MultiDexApplication() {
}
| 21.428571 | 48 | 0.813333 |
defa0facf42ec4b32c8cc7a0c408874bb47484cf | 3,418 | rs | Rust | Rust/20211215.rs | lsartory/adventofcode.com | 30f90eb0ae5ca572f2b582f254c66a99cb9bfb70 | [
"MIT"
] | null | null | null | Rust/20211215.rs | lsartory/adventofcode.com | 30f90eb0ae5ca572f2b582f254c66a99cb9bfb70 | [
"MIT"
] | null | null | null | Rust/20211215.rs | lsartory/adventofcode.com | 30f90eb0ae5ca572f2b582f254c66a99cb9bfb70 | [
"MIT"
] | null | null | null | use std::io::{BufRead, BufReader, Error, ErrorKind, Result};
/***********************************************/
const INPUT_FILE:&str = "20211215.txt";
/***********************************************/
fn read_input(filename: &str) -> Result<Vec<String>> {
BufReader::new(std::fs::File::open(filename)?)
.lines()
.map(|line| line?.trim().parse().map_err(|e| Error::new(ErrorKind::InvalidData, e)))
.collect()
}
/***********************************************/
fn parse_input(input: Vec<String>) -> Vec<Vec<u32>> {
input.iter().map(|line| line.chars().map(|c| c.to_digit(10).unwrap_or(u32::MAX)).collect()).collect()
}
/***********************************************/
fn part_1(input: &[Vec<u32>]) {
let mut q = Vec::new();
let mut dist = input.to_owned();
let dist_map = dist.as_mut_slice();
let height = dist_map.len();
let width = if height > 0 { dist_map[0].len() } else { 0 };
for y in 0 .. height {
for x in 0 .. width {
dist_map[y][x] = u32::MAX;
q.push((x, y));
}
}
dist_map[0][0] = 0;
while !q.is_empty() {
let v = q.iter().enumerate().map(|p| (p.1.0, p.1.1, dist_map[p.1.1][p.1.0], p.0)).min_by(|a, b| a.2.cmp(&b.2)).unwrap_or((0, 0, 0, 0));
q.swap_remove(v.3);
for u in q.iter().filter(|a| a.0 == v.0 && ((v.1 > 0 && a.1 == v.1 - 1) || (v.1 < height && a.1 == v.1 + 1)) || a.1 == v.1 && ((v.0 > 0 && a.0 == v.0 - 1) || (v.0 < width && a.0 == v.0 + 1))) {
dist_map[u.1][u.0] = dist_map[u.1][u.0].min(dist_map[v.1][v.0] + input[u.1][u.0]);
}
print!("\r{:5} / {:5}", width * height - q.len(), width * height);
}
print!("\r ");
println!("\rPart 1: {}", dist_map[height - 1][width - 1]);
}
fn part_2(input: &[Vec<u32>]) {
let mut height = input.len();
let mut width = if height > 0 { input[0].len() } else { 0 };
let mut new_map = Vec::new();
for y in 0 .. height * 5 {
let mut row = Vec::new();
for x in 0 .. width * 5 {
row.push(((input[y % height][x % width] - 1 + (x / width) as u32 + (y / height) as u32) % 9) + 1);
}
new_map.push(row);
}
width *= 5;
height *= 5;
let mut q = Vec::new();
let mut dist = new_map.clone();
let dist_map = dist.as_mut_slice();
for y in 0 .. height {
for x in 0 .. width {
dist_map[y][x] = u32::MAX;
q.push((x, y));
}
}
dist_map[0][0] = 0;
while !q.is_empty() {
let v = q.iter().enumerate().map(|p| (p.1.0, p.1.1, dist_map[p.1.1][p.1.0], p.0)).min_by(|a, b| a.2.cmp(&b.2)).unwrap_or((0, 0, 0, 0));
q.swap_remove(v.3);
for u in q.iter().filter(|a| a.0 == v.0 && ((v.1 > 0 && a.1 == v.1 - 1) || (v.1 < height && a.1 == v.1 + 1)) || a.1 == v.1 && ((v.0 > 0 && a.0 == v.0 - 1) || (v.0 < width && a.0 == v.0 + 1))) {
dist_map[u.1][u.0] = dist_map[u.1][u.0].min(dist_map[v.1][v.0] + new_map[u.1][u.0]);
}
print!("\r{:6} / {:6}", width * height - q.len(), width * height);
}
print!("\r ");
println!("\rPart 2: {}", dist_map[height - 1][width - 1]);
}
/***********************************************/
fn main() {
let input = parse_input(read_input(INPUT_FILE).expect(&format!("Could not read {}", INPUT_FILE)));
part_1(&input);
part_2(&input);
}
| 36.361702 | 201 | 0.446752 |
e76fd99f32af10dfc6d1d3671dba7092a43042ba | 8,536 | js | JavaScript | pages/profile.js | dmaeoka/RAN_material | b9091078b3781cfa2fe8804071cc75cf30c683eb | [
"RSA-MD"
] | null | null | null | pages/profile.js | dmaeoka/RAN_material | b9091078b3781cfa2fe8804071cc75cf30c683eb | [
"RSA-MD"
] | null | null | null | pages/profile.js | dmaeoka/RAN_material | b9091078b3781cfa2fe8804071cc75cf30c683eb | [
"RSA-MD"
] | null | null | null | // /* eslint-disable */
import NoSSR from 'react-no-ssr';
import Head from 'next/head';
import classNames from 'classnames';
import withStyles from '@material-ui/core/styles/withStyles';
import Camera from '@material-ui/icons/Camera';
import Palette from '@material-ui/icons/Palette';
import Favorite from '@material-ui/icons/Favorite';
import App from '../components/App';
import Header from '../components/Header';
import HeaderLinks from '../components/Header/HeaderLinks';
import Parallax from '../components/Parallax';
import Footer from '../components/Footer';
import Button from '../components/CustomButtons';
import GridContainer from '../components/Grid/GridContainer';
import GridItem from '../components/Grid/GridItem';
import NavPills from '../components/NavPills';
import withData from '../libraries/withData';
import withRoot from '../libraries/withRoot';
import profilePageStyle from '../assets/jss/material-kit-react/views/profilePage';
const ProfilePage = props => {
const { classes, ...rest } = props; // eslint-disable-line
const imageClasses = classNames(
classes.imgRaised,
classes.imgRoundedCircle,
classes.imgFluid
);
const navImageClasses = classNames(classes.imgRounded, classes.imgGallery);
return (
<App>
<Head>
<title>profile</title>
</Head>
<Header
color="transparent"
brand="Material Kit React"
rightLinks={<HeaderLinks />}
fixed
changeColorOnScroll={{
height: 200,
color: 'white'
}}
{...rest}
/>
<NoSSR>
<Parallax small filter image="/static/img/profile-bg.jpg" />
</NoSSR>
<div className={classNames(classes.main, classes.mainRaised)}>
<div>
<div className={classes.container}>
<GridContainer justify="center">
<GridItem xs={12} sm={12} md={6}>
<div className={classes.profile}>
<div>
<img
src="/static/img/faces/christian.jpg"
alt="..."
className={imageClasses}
/>
</div>
<div className={classes.name}>
<h3 className={classes.title}>Christian Louboutin</h3>
<h6>DESIGNER</h6>
<Button justIcon link className={classes.margin5}>
<i className="fab fa-twitter" />
</Button>
<Button justIcon link className={classes.margin5}>
<i className="fab fa-instagram" />
</Button>
<Button justIcon link className={classes.margin5}>
<i className="fab fa-facebook" />
</Button>
</div>
</div>
</GridItem>
</GridContainer>
<div className={classes.description}>
<p>
An artist of considerable range, Chet Faker — the name taken by
Melbourne-raised, Brooklyn-based Nick Murphy — writes, performs
and records all of his own music, giving it a warm, intimate
feel with a solid groove structure.{' '}
</p>
</div>
<GridContainer justify="center">
<GridItem xs={12} sm={12} md={8} className={classes.navWrapper}>
<NavPills
alignCenter
color="primary"
tabs={[
{
tabButton: 'Studio',
tabIcon: Camera,
tabContent: (
<GridContainer justify="center">
<GridItem xs={12} sm={12} md={4}>
<img
alt="..."
src="/static/img/examples/studio-1.jpg"
className={navImageClasses}
/>
<img
alt="..."
src="/static/img/examples/studio-2.jpg"
className={navImageClasses}
/>
</GridItem>
<GridItem xs={12} sm={12} md={4}>
<img
alt="..."
src="/static/img/examples/studio-5.jpg"
className={navImageClasses}
/>
<img
alt="..."
src="/static/img/examples/studio-4.jpg"
className={navImageClasses}
/>
</GridItem>
</GridContainer>
)
},
{
tabButton: 'Work',
tabIcon: Palette,
tabContent: (
<GridContainer justify="center">
<GridItem xs={12} sm={12} md={4}>
<img
alt="..."
src="/static/img/examples/olu-eletu.jpg"
className={navImageClasses}
/>
<img
alt="..."
src="/static/img/examples/clem-onojeghuo.jpg"
className={navImageClasses}
/>
<img
alt="..."
src="/static/img/examples/cynthia-del-rio.jpg"
className={navImageClasses}
/>
</GridItem>
<GridItem xs={12} sm={12} md={4}>
<img
alt="..."
src="/static/img/examples/mariya-georgieva.jpg "
className={navImageClasses}
/>
<img
alt="..."
src="/static/img/examples/clem-onojegaw.jpg"
className={navImageClasses}
/>
</GridItem>
</GridContainer>
)
},
{
tabButton: 'Favorite',
tabIcon: Favorite,
tabContent: (
<GridContainer justify="center">
<GridItem xs={12} sm={12} md={4}>
<img
alt="..."
src="/static/img/examples/mariya-georgieva.jpg"
className={navImageClasses}
/>
<img
alt="..."
src="/static/img/examples/studio-3.jpg"
className={navImageClasses}
/>
</GridItem>
<GridItem xs={12} sm={12} md={4}>
<img
alt="..."
src="/static/img/examples/clem-onojeghuo.jpg"
className={navImageClasses}
/>
<img
alt="..."
src="/static/img/examples/olu-eletu.jpg"
className={navImageClasses}
/>
<img
alt="..."
src="/static/img/examples/studio-1.jpg"
className={navImageClasses}
/>
</GridItem>
</GridContainer>
)
}
]}
/>
</GridItem>
</GridContainer>
</div>
</div>
</div>
<Footer />
</App>
);
};
export default withData(withRoot(withStyles(profilePageStyle)(ProfilePage)));
| 40.264151 | 82 | 0.394447 |
cf40ab5fef10a46c44e8eae26e8d2a2d7dc1a857 | 207 | css | CSS | compiler/style.css | healer-op/Healer.Codes | 0ee21b8343d4ebe5cc7c2db619c9e15ae30420ce | [
"MIT"
] | 1 | 2022-01-04T06:23:55.000Z | 2022-01-04T06:23:55.000Z | compiler/style.css | healer-op/Healer.Codes | 0ee21b8343d4ebe5cc7c2db619c9e15ae30420ce | [
"MIT"
] | null | null | null | compiler/style.css | healer-op/Healer.Codes | 0ee21b8343d4ebe5cc7c2db619c9e15ae30420ce | [
"MIT"
] | 1 | 2022-01-19T06:32:34.000Z | 2022-01-19T06:32:34.000Z | *{
color: white;
background-color: rgb(34, 34, 34);
font-family: 'Nanum Gothic Coding', monospace;
font-size: small;
border-color:rgb(94, 94, 94);
}
#source{
height: 40%;
} | 18.818182 | 51 | 0.565217 |
07fcc506d9e3fb2e58eabbfacd9047ebc07dc49e | 2,482 | c | C | Library/NuEdu/src/NuEdu-Basic01_ADC_Knob.c | TeYenWu/AD5933_Keil | 41024aa9a84a90f90b855afde0526e25efafedf5 | [
"Apache-2.0"
] | 1 | 2020-12-26T13:24:56.000Z | 2020-12-26T13:24:56.000Z | Library/NuEdu/src/NuEdu-Basic01_ADC_Knob.c | TeYenWu/AD5933_Keil | 41024aa9a84a90f90b855afde0526e25efafedf5 | [
"Apache-2.0"
] | null | null | null | Library/NuEdu/src/NuEdu-Basic01_ADC_Knob.c | TeYenWu/AD5933_Keil | 41024aa9a84a90f90b855afde0526e25efafedf5 | [
"Apache-2.0"
] | null | null | null | #include <stdio.h>
#include "M451Series.h"
#include "NuEdu-Basic01_ADC_Knob.h"
volatile uint32_t g_u32AdcIntFlag;
void Open_ADC_Knob(void)
{
/* Enable EADC module clock */
CLK_EnableModuleClock(EADC_MODULE);
/* EADC clock source is HCLK(72MHz), set divider to 8, ADC clock is 72/8 MHz */
CLK_SetModuleClock(EADC_MODULE, 0, CLK_CLKDIV0_EADC(8));
/* Configure the GPB9 for ADC analog input pins. */
SYS->GPB_MFPH &= ~(SYS_GPB_MFPH_PB9MFP_Msk | SYS_GPB_MFPH_PB10MFP_Msk);
SYS->GPB_MFPH |= SYS_GPB_MFPH_PB9MFP_EADC_CH6 | SYS_GPB_MFPH_PB10MFP_EADC_CH7;
/* Disable the GPB9 digital input path to avoid the leakage current. */
GPIO_DISABLE_DIGITAL_PATH(PB, BIT9);
GPIO_DISABLE_DIGITAL_PATH(PB, BIT10);
/* Set the ADC internal sampling time, input mode as single-end and enable the A/D converter */
EADC_Open(EADC, EADC_CTL_DIFFEN_SINGLE_END);
EADC_SetInternalSampleTime(EADC, 6);
/* Configure the sample module 0 for analog input channel 6 and software trigger source.*/
EADC_ConfigSampleModule(EADC, 0, EADC_SOFTWARE_TRIGGER, 6);
EADC_ConfigSampleModule(EADC, 1, EADC_SOFTWARE_TRIGGER, 7);
EADC_ENABLE_SAMPLE_MODULE_INT(EADC, 0, 0x1);//Enable sample module 0 interrupt.
EADC_ENABLE_SAMPLE_MODULE_INT(EADC, 1, 0x2);//Enable sample module 0 interrupt.
/* Clear the A/D ADINT0 interrupt flag for safe */
EADC_CLR_INT_FLAG(EADC, 0x3);
/* Enable the sample module 0 interrupt. */
EADC_ENABLE_INT(EADC, 0x3);//Enable sample module A/D ADINT0 interrupt.
}
uint32_t Get_ADC_Knob(void)
{
uint32_t ADC_Raw_Data;
/* Clear the A/D ADI NT0 interrupt flag */
EADC_CLR_INT_FLAG(EADC, 0x1);
//Trigger sample module 0 to start A/D conversion
EADC_START_CONV(EADC, 0x1);
/* Wait ADC interrupt (g_u32AdcIntFlag will be set at IRQ_Handler function) */
while(EADC_GET_INT_FLAG(EADC, 0x1) == 0);
ADC_Raw_Data = EADC_GET_CONV_DATA(EADC, 0);
return ADC_Raw_Data;
}
uint32_t Get_ADC_PWMDAC(void)
{
uint32_t ADC_Raw_Data;
/* Clear the A/D ADI NT0 interrupt flag */
EADC_CLR_INT_FLAG(EADC, 0x2);
//Trigger sample module 0 to start A/D conversion
EADC_START_CONV(EADC, 0x2);
/* Wait ADC interrupt (g_u32AdcIntFlag will be set at IRQ_Handler function) */
while(EADC_GET_INT_FLAG(EADC, 0x2) == 0);
ADC_Raw_Data = EADC_GET_CONV_DATA(EADC, 1);
return ADC_Raw_Data;
}
| 34 | 100 | 0.702659 |
6e0f0f51b0afe0eb6964609d7bc9c6fde6884bca | 28,542 | html | HTML | docs/api/com/solacesystems/jms/encoding/InteropTest.html | yanleipo/sol-jms-10.8.1 | a644d6396016dd68c2aa90896fd25805d0e4b6e7 | [
"Apache-2.0"
] | null | null | null | docs/api/com/solacesystems/jms/encoding/InteropTest.html | yanleipo/sol-jms-10.8.1 | a644d6396016dd68c2aa90896fd25805d0e4b6e7 | [
"Apache-2.0"
] | null | null | null | docs/api/com/solacesystems/jms/encoding/InteropTest.html | yanleipo/sol-jms-10.8.1 | a644d6396016dd68c2aa90896fd25805d0e4b6e7 | [
"Apache-2.0"
] | null | null | null | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_79) on Wed Apr 29 13:23:44 EDT 2020 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>InteropTest (Solace JMS API v10.8.1)</title>
<meta name="date" content="2020-04-29">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="InteropTest (Solace JMS API v10.8.1)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/InteropTest.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/solacesystems/jms/encoding/DefaultJMSEncoder.html" title="class in com.solacesystems.jms.encoding"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../com/solacesystems/jms/encoding/InteropTestEncoder.html" title="class in com.solacesystems.jms.encoding"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/solacesystems/jms/encoding/InteropTest.html" target="_top">Frames</a></li>
<li><a href="InteropTest.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li><a href="#field_summary">Field</a> | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#field_detail">Field</a> | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.solacesystems.jms.encoding</div>
<h2 title="Class InteropTest" class="title">Class InteropTest</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>com.solacesystems.jms.encoding.InteropTest</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="strong">InteropTest</span>
extends <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../com/solacesystems/jms/encoding/InteropTest.html#IgnoreGeneratedSendTimestamps">IgnoreGeneratedSendTimestamps</a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/solacesystems/jms/encoding/InteropTest.html#TestNoPropertyKey">TestNoPropertyKey</a></strong></code> </td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../com/solacesystems/jms/encoding/InteropTest.html#InteropTest()">InteropTest</a></strong>()</code> </td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="../../../../javax/jms/Message.html" title="interface in javax.jms">Message</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/solacesystems/jms/encoding/InteropTest.html#createJMSMessage(javax.jms.Session,%20javax.jms.MessageProducer,%20com.solacesystems.jcsmp.impl.sdt.JMSInteropTest)">createJMSMessage</a></strong>(<a href="../../../../javax/jms/Session.html" title="interface in javax.jms">Session</a> session,
<a href="../../../../javax/jms/MessageProducer.html" title="interface in javax.jms">MessageProducer</a> producer,
<a href="../../../../com/solacesystems/jcsmp/impl/sdt/JMSInteropTest.html" title="class in com.solacesystems.jcsmp.impl.sdt">JMSInteropTest</a> test)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="../../../../javax/jms/Message.html" title="interface in javax.jms">Message</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/solacesystems/jms/encoding/InteropTest.html#createMessageByNumber(javax.jms.Session,%20javax.jms.MessageProducer,%20java.lang.Integer)">createMessageByNumber</a></strong>(<a href="../../../../javax/jms/Session.html" title="interface in javax.jms">Session</a> session,
<a href="../../../../javax/jms/MessageProducer.html" title="interface in javax.jms">MessageProducer</a> producer,
<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a> msgId)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/solacesystems/jms/encoding/InteropTest.html#testBytesValues(byte[],%20javax.jms.BytesMessage,%20int)">testBytesValues</a></strong>(byte[] expected,
<a href="../../../../javax/jms/BytesMessage.html" title="interface in javax.jms">BytesMessage</a> received,
int testNo)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/solacesystems/jms/encoding/InteropTest.html#testMapValues(com.solacesystems.jcsmp.SDTMap,%20javax.jms.MapMessage,%20int)">testMapValues</a></strong>(<a href="../../../../com/solacesystems/jcsmp/SDTMap.html" title="interface in com.solacesystems.jcsmp">SDTMap</a> expected,
<a href="../../../../javax/jms/MapMessage.html" title="interface in javax.jms">MapMessage</a> received,
int testNo)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/solacesystems/jms/encoding/InteropTest.html#testMessageTypes(com.solacesystems.jcsmp.impl.sdt.JMSInteropTest,%20javax.jms.Message)">testMessageTypes</a></strong>(<a href="../../../../com/solacesystems/jcsmp/impl/sdt/JMSInteropTest.html" title="class in com.solacesystems.jcsmp.impl.sdt">JMSInteropTest</a> test,
<a href="../../../../javax/jms/Message.html" title="interface in javax.jms">Message</a> received)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/solacesystems/jms/encoding/InteropTest.html#testObjectValues(java.lang.Object,%20javax.jms.ObjectMessage,%20int)">testObjectValues</a></strong>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> expected,
<a href="../../../../javax/jms/ObjectMessage.html" title="interface in javax.jms">ObjectMessage</a> received,
int testNo)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/solacesystems/jms/encoding/InteropTest.html#testProperties(com.solacesystems.jcsmp.impl.sdt.JMSInteropTest,%20javax.jms.Message,%20int)">testProperties</a></strong>(<a href="../../../../com/solacesystems/jcsmp/impl/sdt/JMSInteropTest.html" title="class in com.solacesystems.jcsmp.impl.sdt">JMSInteropTest</a> test,
<a href="../../../../javax/jms/Message.html" title="interface in javax.jms">Message</a> received,
int testNo)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/solacesystems/jms/encoding/InteropTest.html#testReplyTo(com.solacesystems.jcsmp.Destination,%20javax.jms.Destination,%20int)">testReplyTo</a></strong>(<a href="../../../../com/solacesystems/jcsmp/Destination.html" title="interface in com.solacesystems.jcsmp">Destination</a> expected,
<a href="../../../../javax/jms/Destination.html" title="interface in javax.jms">Destination</a> received,
int testNo)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../com/solacesystems/jms/encoding/InteropTest.html#testStreamValues(com.solacesystems.jcsmp.SDTStream,%20javax.jms.StreamMessage,%20int)">testStreamValues</a></strong>(<a href="../../../../com/solacesystems/jcsmp/SDTStream.html" title="interface in com.solacesystems.jcsmp">SDTStream</a> expected,
<a href="../../../../javax/jms/StreamMessage.html" title="interface in javax.jms">StreamMessage</a> received,
int testNo)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../com/solacesystems/jms/encoding/InteropTest.html#validateRecvMsg(javax.jms.Message)">validateRecvMsg</a></strong>(<a href="../../../../javax/jms/Message.html" title="interface in javax.jms">Message</a> msg)</code> </td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long,%20int)" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="IgnoreGeneratedSendTimestamps">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>IgnoreGeneratedSendTimestamps</h4>
<pre>public static boolean IgnoreGeneratedSendTimestamps</pre>
</li>
</ul>
<a name="TestNoPropertyKey">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>TestNoPropertyKey</h4>
<pre>public static final <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> TestNoPropertyKey</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../constant-values.html#com.solacesystems.jms.encoding.InteropTest.TestNoPropertyKey">Constant Field Values</a></dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="InteropTest()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>InteropTest</h4>
<pre>public InteropTest()</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="validateRecvMsg(javax.jms.Message)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>validateRecvMsg</h4>
<pre>public static int validateRecvMsg(<a href="../../../../javax/jms/Message.html" title="interface in javax.jms">Message</a> msg)
throws <a href="../../../../com/solacesystems/jcsmp/SDTException.html" title="class in com.solacesystems.jcsmp">SDTException</a></pre>
<dl><dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../com/solacesystems/jcsmp/SDTException.html" title="class in com.solacesystems.jcsmp">SDTException</a></code></dd></dl>
</li>
</ul>
<a name="testMessageTypes(com.solacesystems.jcsmp.impl.sdt.JMSInteropTest, javax.jms.Message)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>testMessageTypes</h4>
<pre>public static void testMessageTypes(<a href="../../../../com/solacesystems/jcsmp/impl/sdt/JMSInteropTest.html" title="class in com.solacesystems.jcsmp.impl.sdt">JMSInteropTest</a> test,
<a href="../../../../javax/jms/Message.html" title="interface in javax.jms">Message</a> received)</pre>
</li>
</ul>
<a name="testProperties(com.solacesystems.jcsmp.impl.sdt.JMSInteropTest, javax.jms.Message, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>testProperties</h4>
<pre>public static void testProperties(<a href="../../../../com/solacesystems/jcsmp/impl/sdt/JMSInteropTest.html" title="class in com.solacesystems.jcsmp.impl.sdt">JMSInteropTest</a> test,
<a href="../../../../javax/jms/Message.html" title="interface in javax.jms">Message</a> received,
int testNo)
throws <a href="../../../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</a>,
<a href="../../../../com/solacesystems/jcsmp/SDTException.html" title="class in com.solacesystems.jcsmp">SDTException</a></pre>
<dl><dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</a></code></dd>
<dd><code><a href="../../../../com/solacesystems/jcsmp/SDTException.html" title="class in com.solacesystems.jcsmp">SDTException</a></code></dd></dl>
</li>
</ul>
<a name="testReplyTo(com.solacesystems.jcsmp.Destination, javax.jms.Destination, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>testReplyTo</h4>
<pre>public static void testReplyTo(<a href="../../../../com/solacesystems/jcsmp/Destination.html" title="interface in com.solacesystems.jcsmp">Destination</a> expected,
<a href="../../../../javax/jms/Destination.html" title="interface in javax.jms">Destination</a> received,
int testNo)
throws <a href="../../../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</a></pre>
<dl><dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</a></code></dd></dl>
</li>
</ul>
<a name="testMapValues(com.solacesystems.jcsmp.SDTMap, javax.jms.MapMessage, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>testMapValues</h4>
<pre>public static void testMapValues(<a href="../../../../com/solacesystems/jcsmp/SDTMap.html" title="interface in com.solacesystems.jcsmp">SDTMap</a> expected,
<a href="../../../../javax/jms/MapMessage.html" title="interface in javax.jms">MapMessage</a> received,
int testNo)
throws <a href="../../../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</a>,
<a href="../../../../com/solacesystems/jcsmp/SDTException.html" title="class in com.solacesystems.jcsmp">SDTException</a></pre>
<dl><dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</a></code></dd>
<dd><code><a href="../../../../com/solacesystems/jcsmp/SDTException.html" title="class in com.solacesystems.jcsmp">SDTException</a></code></dd></dl>
</li>
</ul>
<a name="testStreamValues(com.solacesystems.jcsmp.SDTStream, javax.jms.StreamMessage, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>testStreamValues</h4>
<pre>public static void testStreamValues(<a href="../../../../com/solacesystems/jcsmp/SDTStream.html" title="interface in com.solacesystems.jcsmp">SDTStream</a> expected,
<a href="../../../../javax/jms/StreamMessage.html" title="interface in javax.jms">StreamMessage</a> received,
int testNo)
throws <a href="../../../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</a>,
<a href="../../../../com/solacesystems/jcsmp/SDTException.html" title="class in com.solacesystems.jcsmp">SDTException</a></pre>
<dl><dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</a></code></dd>
<dd><code><a href="../../../../com/solacesystems/jcsmp/SDTException.html" title="class in com.solacesystems.jcsmp">SDTException</a></code></dd></dl>
</li>
</ul>
<a name="testBytesValues(byte[], javax.jms.BytesMessage, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>testBytesValues</h4>
<pre>public static void testBytesValues(byte[] expected,
<a href="../../../../javax/jms/BytesMessage.html" title="interface in javax.jms">BytesMessage</a> received,
int testNo)
throws <a href="../../../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</a>,
<a href="../../../../com/solacesystems/jcsmp/SDTException.html" title="class in com.solacesystems.jcsmp">SDTException</a></pre>
<dl><dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</a></code></dd>
<dd><code><a href="../../../../com/solacesystems/jcsmp/SDTException.html" title="class in com.solacesystems.jcsmp">SDTException</a></code></dd></dl>
</li>
</ul>
<a name="testObjectValues(java.lang.Object, javax.jms.ObjectMessage, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>testObjectValues</h4>
<pre>public static void testObjectValues(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> expected,
<a href="../../../../javax/jms/ObjectMessage.html" title="interface in javax.jms">ObjectMessage</a> received,
int testNo)
throws <a href="../../../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</a>,
<a href="../../../../com/solacesystems/jcsmp/SDTException.html" title="class in com.solacesystems.jcsmp">SDTException</a></pre>
<dl><dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</a></code></dd>
<dd><code><a href="../../../../com/solacesystems/jcsmp/SDTException.html" title="class in com.solacesystems.jcsmp">SDTException</a></code></dd></dl>
</li>
</ul>
<a name="createMessageByNumber(javax.jms.Session, javax.jms.MessageProducer, java.lang.Integer)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createMessageByNumber</h4>
<pre>public static <a href="../../../../javax/jms/Message.html" title="interface in javax.jms">Message</a> createMessageByNumber(<a href="../../../../javax/jms/Session.html" title="interface in javax.jms">Session</a> session,
<a href="../../../../javax/jms/MessageProducer.html" title="interface in javax.jms">MessageProducer</a> producer,
<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a> msgId)
throws <a href="../../../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</a>,
<a href="../../../../com/solacesystems/jcsmp/SDTException.html" title="class in com.solacesystems.jcsmp">SDTException</a></pre>
<dl><dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</a></code></dd>
<dd><code><a href="../../../../com/solacesystems/jcsmp/SDTException.html" title="class in com.solacesystems.jcsmp">SDTException</a></code></dd></dl>
</li>
</ul>
<a name="createJMSMessage(javax.jms.Session, javax.jms.MessageProducer, com.solacesystems.jcsmp.impl.sdt.JMSInteropTest)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>createJMSMessage</h4>
<pre>public static <a href="../../../../javax/jms/Message.html" title="interface in javax.jms">Message</a> createJMSMessage(<a href="../../../../javax/jms/Session.html" title="interface in javax.jms">Session</a> session,
<a href="../../../../javax/jms/MessageProducer.html" title="interface in javax.jms">MessageProducer</a> producer,
<a href="../../../../com/solacesystems/jcsmp/impl/sdt/JMSInteropTest.html" title="class in com.solacesystems.jcsmp.impl.sdt">JMSInteropTest</a> test)
throws <a href="../../../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</a>,
<a href="../../../../com/solacesystems/jcsmp/SDTException.html" title="class in com.solacesystems.jcsmp">SDTException</a></pre>
<dl><dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../javax/jms/JMSException.html" title="class in javax.jms">JMSException</a></code></dd>
<dd><code><a href="../../../../com/solacesystems/jcsmp/SDTException.html" title="class in com.solacesystems.jcsmp">SDTException</a></code></dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/InteropTest.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/solacesystems/jms/encoding/DefaultJMSEncoder.html" title="class in com.solacesystems.jms.encoding"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../com/solacesystems/jms/encoding/InteropTestEncoder.html" title="class in com.solacesystems.jms.encoding"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/solacesystems/jms/encoding/InteropTest.html" target="_top">Frames</a></li>
<li><a href="InteropTest.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li><a href="#field_summary">Field</a> | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#field_detail">Field</a> | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small><i>Copyright 2004-2020 Solace Corporation. All rights reserved.</i></small></p>
</body>
</html>
| 57.198397 | 1,448 | 0.655175 |
1f9e75c8e3d1e5ddee47760892e6b8576bf695c7 | 36 | css | CSS | public/css/styles.css | cheemurakami/the_word_definer | 7857924135a00e7208f28813f4b23a9f7e2247c7 | [
"MIT"
] | null | null | null | public/css/styles.css | cheemurakami/the_word_definer | 7857924135a00e7208f28813f4b23a9f7e2247c7 | [
"MIT"
] | 2 | 2021-09-28T02:55:43.000Z | 2022-02-26T07:56:25.000Z | public/css/styles.css | cheemurakami/the_word_definer | 7857924135a00e7208f28813f4b23a9f7e2247c7 | [
"MIT"
] | null | null | null | body{
background-color: #42f5e0;
} | 12 | 28 | 0.694444 |
759ec18dfa598eb7a6facc260593708440f3888e | 664 | c | C | demo/simple/csum.c | paulwratt/cin-5.34.00 | 036a8202f11a4a0e29ccb10d3c02f304584cda95 | [
"MIT"
] | 10 | 2018-03-26T07:41:44.000Z | 2021-11-06T08:33:24.000Z | demo/simple/csum.c | paulwratt/cin-5.34.00 | 036a8202f11a4a0e29ccb10d3c02f304584cda95 | [
"MIT"
] | null | null | null | demo/simple/csum.c | paulwratt/cin-5.34.00 | 036a8202f11a4a0e29ccb10d3c02f304584cda95 | [
"MIT"
] | 1 | 2020-11-17T03:17:00.000Z | 2020-11-17T03:17:00.000Z | /* -*- C++ -*- */
/*************************************************************************
* Copyright(c) 1995~2005 Masaharu Goto (root-cint@cern.ch)
*
* For the licensing terms see the file COPYING
*
************************************************************************/
/* #! /usr/local/bin/cint */
#include <stdio.h>
main(argc,argv)
int argc;
char *argv[];
{
int i;
printf("argc=%d\n",argc);
for(i=0;i<argc;i++) {
printf("argv[%d]=\"%s\" , sum=%d\n"
,i,argv[i],sumchar(argv[i]));
}
}
int sumchar(char *string)
//int sumchar(string)
//char *string;
{
int sum=0,i=0;
while(string[i]!='\0') {
sum += string[i++];
}
return(sum);
}
| 20.75 | 74 | 0.436747 |
0be559c994893ff30ea3f58fcbd410a2fe7c5142 | 1,563 | swift | Swift | NHS-COVID-19/Core/Sources/Domain/IsolationPayment/IsolationPaymentStore.swift | faberga/covid-19-app-ios-ag-public | ee43e47aa1c082ea0bbfb0a971327dea807e4533 | [
"MIT"
] | 135 | 2020-08-13T12:37:37.000Z | 2021-02-12T06:07:22.000Z | NHS-COVID-19/Core/Sources/Domain/IsolationPayment/IsolationPaymentStore.swift | faberga/covid-19-app-ios-ag-public | ee43e47aa1c082ea0bbfb0a971327dea807e4533 | [
"MIT"
] | 15 | 2020-09-21T11:47:19.000Z | 2021-01-11T17:08:29.000Z | NHS-COVID-19/Core/Sources/Domain/IsolationPayment/IsolationPaymentStore.swift | faberga/covid-19-app-ios-ag-public | ee43e47aa1c082ea0bbfb0a971327dea807e4533 | [
"MIT"
] | 17 | 2020-08-13T13:37:38.000Z | 2020-12-25T20:13:20.000Z | //
// Copyright © 2021 DHSC. All rights reserved.
//
import Combine
import Foundation
private struct IsolationPaymentInfo: Codable, DataConvertible, Equatable {
var isEnabled: Bool
var ipcToken: String?
}
class IsolationPaymentStore {
@PublishedEncrypted private var isolationPaymentInfo: IsolationPaymentInfo?
private(set) lazy var isolationPaymentRawState: DomainProperty<IsolationPaymentRawState?> = {
$isolationPaymentInfo
.map { $0.flatMap(IsolationPaymentRawState.init) }
}()
init(store: EncryptedStoring) {
_isolationPaymentInfo = store.encrypted("isolation_payment_store")
}
@available(*, deprecated, message: "Use isolationPaymentRawState instead.")
func load() -> IsolationPaymentRawState? {
isolationPaymentRawState.currentValue
}
func save(_ state: IsolationPaymentRawState) {
switch state {
case .disabled:
isolationPaymentInfo = IsolationPaymentInfo(isEnabled: false)
case .ipcToken(let token):
isolationPaymentInfo = IsolationPaymentInfo(isEnabled: true, ipcToken: token)
}
}
func delete() {
isolationPaymentInfo = nil
}
}
extension IsolationPaymentRawState {
fileprivate init?(_ info: IsolationPaymentInfo) {
if info.isEnabled {
if let tokenString = info.ipcToken {
self = .ipcToken(tokenString)
} else {
return nil
}
} else {
self = .disabled
}
}
}
| 27.421053 | 97 | 0.642994 |
65dab67a26e611306e86ccf15316e98aea2aad2a | 4,350 | kt | Kotlin | grammar/src/test/org/jetbrains/kotlin/spec/grammar/TestRunner.kt | mikesamuel/kotlin-spec | e754e90bda5686479797a9d90944fe09b89324f5 | [
"Apache-2.0"
] | null | null | null | grammar/src/test/org/jetbrains/kotlin/spec/grammar/TestRunner.kt | mikesamuel/kotlin-spec | e754e90bda5686479797a9d90944fe09b89324f5 | [
"Apache-2.0"
] | null | null | null | grammar/src/test/org/jetbrains/kotlin/spec/grammar/TestRunner.kt | mikesamuel/kotlin-spec | e754e90bda5686479797a9d90944fe09b89324f5 | [
"Apache-2.0"
] | null | null | null | package org.jetbrains.kotlin.spec.grammar
import com.intellij.testFramework.TestDataPath
import org.junit.Test
import org.junit.runner.RunWith
import java.io.File
import org.jetbrains.kotlin.spec.grammar.parsetree.ParseTreeUtil
import org.jetbrains.kotlin.spec.grammar.psi.PsiTextParser
import org.jetbrains.kotlin.spec.grammar.util.DiagnosticTestData
import org.jetbrains.kotlin.spec.grammar.util.PsiTestData
import org.jetbrains.kotlin.spec.grammar.util.TestDataFileHeader
import org.jetbrains.kotlin.spec.grammar.util.TestUtil
import org.jetbrains.kotlin.spec.grammar.util.TestUtil.assertEqualsToFile
import org.junit.Assert.assertTrue
import org.junit.Assume.assumeFalse
import java.util.regex.Pattern
@TestDataPath("\$PROJECT_ROOT/grammar/testData/")
@RunWith(com.intellij.testFramework.Parameterized::class)
class TestRunner {
@org.junit.runners.Parameterized.Parameter
lateinit var testFilePath: String
companion object {
private const val ERROR_EXPECTED_MARKER = "WITH_ERRORS"
private const val MUTE_MARKER = "MUTE"
private val antlrTreeFileHeaderPattern =
Pattern.compile("""^File: .*?.kts? - (?<hash>[0-9a-f]{32})(?<markers> \((?<marker>$ERROR_EXPECTED_MARKER|$MUTE_MARKER)\))?$""")
@org.junit.runners.Parameterized.Parameters(name = "{0}")
@JvmStatic
fun getTestFiles() = emptyList<Array<Any>>()
@com.intellij.testFramework.Parameterized.Parameters(name = "{0}")
@JvmStatic
fun getTestFiles(klass: Class<*>) = File("./testData").let { testsDir ->
testsDir.walkTopDown().filter { it.extension == "kt" }.map {
arrayOf(it.relativeTo(testsDir).path.replace("/", "$"))
}.toList()
}
}
@Test
fun doTest() {
val testFile = File(testFilePath.replace("$", "/"))
val testData = TestUtil.getTestData(testFile)
val header = if (testData.antlrParseTreeText.exists())
antlrTreeFileHeaderPattern.matcher(testData.antlrParseTreeText.readText().lines().first()).run {
if (!find())
return@run null
val marker = group("marker")
val hash = group("hash")
TestDataFileHeader(marker, hash)
}
else null
if (header != null)
assumeFalse(header.marker == MUTE_MARKER || header.hash != testData.sourceCodeHash)
val (parseTree, errors) = ParseTreeUtil.parse(testData.sourceCode)
val (lexerErrors, parserErrors) = errors
val errorExpected = header?.marker == ERROR_EXPECTED_MARKER
val dumpParseTree = parseTree.stringifyTree("File: ${testFile.name} - ${testData.sourceCodeHash}" + (if (errorExpected) " ($ERROR_EXPECTED_MARKER)" else ""))
assertEqualsToFile(
"Expected and actual ANTLR parsetree are not equals",
testData.antlrParseTreeText,
dumpParseTree,
false
)
val lexerHasErrors = lexerErrors.isNotEmpty()
val parserHasErrors = parserErrors.isNotEmpty()
println("HAS ANTLR LEXER ERRORS: ${if (lexerHasErrors) "YES" else "NO"}")
lexerErrors.forEach { println(" - $it") }
println("HAS ANTLR PARSER ERRORS: ${if (parserHasErrors) "YES" else "NO"}")
parserErrors.forEach { println(" - $it") }
when (testData) {
is PsiTestData -> {
val psi = PsiTextParser.parse(testData.psiParseTreeText)
val psiErrorElements = PsiTextParser.getErrorElements(psi)
val psiHasErrorElements = psiErrorElements.isNotEmpty()
val verdictsEquals = (lexerHasErrors || parserHasErrors) == psiHasErrorElements
println("HAS PSI ERROR ELEMENTS: ${if (psiHasErrorElements) "YES" else "NO"}")
psiErrorElements.forEach { println(" - Line ${it.second.first}:${it.second.second} ${it.first}") }
assertTrue((verdictsEquals && !errorExpected) || (errorExpected && !psiHasErrorElements))
}
is DiagnosticTestData -> {
val hasAnyErrors = lexerHasErrors || parserHasErrors
assertTrue((!hasAnyErrors && !errorExpected) || errorExpected && hasAnyErrors)
}
}
}
}
| 43.069307 | 165 | 0.64023 |
70aadf5f39c9f8219d73ef4a143bc76c1de9cca0 | 534 | kt | Kotlin | module_base/src/main/java/com/linda/module_base/bean/Header.kt | zhoulinda/eyepetizer_kotlin | 7dfc8eef169fd16326dc64560edf9ebb21618b05 | [
"MIT"
] | 72 | 2021-02-28T09:52:04.000Z | 2022-03-28T09:24:31.000Z | module_base/src/main/java/com/linda/module_base/bean/Header.kt | zhoulinda/eyepetizer_kotlin | 7dfc8eef169fd16326dc64560edf9ebb21618b05 | [
"MIT"
] | null | null | null | module_base/src/main/java/com/linda/module_base/bean/Header.kt | zhoulinda/eyepetizer_kotlin | 7dfc8eef169fd16326dc64560edf9ebb21618b05 | [
"MIT"
] | 12 | 2021-03-02T06:18:05.000Z | 2022-03-18T02:59:40.000Z | package com.linda.module_base.bean
import android.annotation.SuppressLint
import android.os.Parcelable
import kotlinx.android.parcel.Parcelize
/**
* 描述 :
*
* @author: linda
* email: zhoulinda@lexue.com
* 创建日期: 2020/9/10
*/
@SuppressLint("ParcelCreator")
@Parcelize
data class Header(
val id: Int?,
val title: String?,
val name: String?,
val actionUrl: String?,
val icon: String?,
val description: String?,
val time: Long?,
val showHateVideo: Boolean?,
val rightText: String
) : Parcelable | 20.538462 | 39 | 0.689139 |